How do I manually install GRUB2 to the boot partition instead of the master boot sector?

The Linux partition scheme is as follows, with /dev/sdb5 being the /boot partition

|-sdb5 8:21 0 512M 0 part /mnt/sysroot/boot
`-sdb6 8:22 0 7.5G 0 part
|-rl-root 253:2 0 6G 0 lvm /mnt/sysroot
`-rl-swap 253:3 0 1.5G 0 lvm [SWAP]

During installation, the Boot check option of the target disk was deliberately removed from the SELECTED DISK AND BOOT LOADER interface.

After installation, Linux really can’t be started, start it again with the installation disc and enter the Troubleshooting menu item

Run the grub2-install command to install grub2 to the /dev/sdb5 partition

sh-4.4# grub2-install -d /mnt/sysroot/usr/lib/grub/i386-pc/ /dev/sdb5

The returned result is incorrect

Installing for i386-pc platform.
grub2-install: error: hostdisk//dev/sdb appears to contain a xfs filesystem which isn’t known to reserve space for DOS-style boot. Installing GRUB there could result in FILESYSTEM DESTRUCTION if valuable data is overwritten by grub-setup (–skip-fs-probe disables this check, use at your own risk).

It looks like the installation failed because the default filesystem is using xfs.

Reinstall the system again, this time all partitions are formatted as ext4

Then enter Trubleshooting mode again

Run the grub2-install command again to install grub2 to /dev/sdb5

sh-4.4# grub2-install -d /mnt/sysroot/usr/lib/grub/i386-pc/ /dev/sdb5

The return result is still incorrect:

Installing for i386-pc platform.
grub2-install: warning: File system `ext2’ doesn’t support embedding.
grub2-install: error: embedding is not possible, but this is required for cross-disk install.

So, how do I manually install GRUB to the /boot partition?

How to reserve space for DOS-style boot and how can there be cross-disk install problems?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.