Due to "Meltdown" I am in the progress of moving our CentOS7-XEN-PV-DomUs to HVM mode. See here on why I need to migrate to HVM
This involves installing a bootloader - unnessesary on PV-DomUs, since they use pygrub to emulate the grub/grub2 boot process.
What works: Boot the HVM DomU via PXE into a rescue CentOS7 image, chroot the disks, grub2-install. I can not do this from the Dom0 - since that is SLES11 SP4 - with grub, not grub2.
I would like to automate this by just copying the grub2-sectors via dd from an alredy converted VM to a VM which still needs the step.
Question: How big is grub2 - so how many bytes do I have to copy?
I already found out that 62 sectors with sector-size 512 byte is not enough.
Update 2018-01-22: The first answer hinted a potential problem.
In my scenario you will have a uniform disk-layout with identical first partition, starting at about 9 MiB. On that partition /boot is located.
I could do what I wanted by:
sfdisk -d ALREADYCONVERTEDDISK >oldpart.sfdisk
dd if=VM-DISK-WITH-GRUB2 of=NEWDISK bs=1M count=8
sfdisk ALREADYCONVERTEDDISK <oldpart.sfdisk
The the question boils down to: What would be the minimal space needed for grub2?