I prepared an Ubuntu server image with VirtualBox. To transfer the image to the server's SSD I first dd
ed the MBR (512 bytes) and then the LVM partition (PV containing the root partition shrunk to 3GB). The server failed to boot because some parts of GRUB were missing. The grub rescue prompt was showing up.
As I learned from GRUB's documentation, this makes sense, because parts of it are (usually) stored in the disk space between the MBR and the first partition.
But how do I found out where exactly?
I am aware that I could just copy the whole space in front of the first partition, but I am curious if there is some command that shows the exact locations of the various parts of GRUB.
Clarification: There is no separate boot partition. There is only the LVM physical volume containing only the root partition (with the /boot folder). The boot issue can also be fixed by chroot
ing into the copied image and executing grub-install
.