42
13
There seems to be quite a bit of discussion about this but I can't find a simple answer.
When I try to install grub2 I get this error:
# grub2-install /dev/sda
Installing for i386-pc platform.
grub2-install: warning: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible.
grub2-install: warning: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
grub2-install: error: will not proceed with blocklists.
Here is the layout of /dev/sda:
Disk /dev/sda: 111.8 GiB, 120034123776 bytes, 234441648 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 7ECE06D0-9F0C-44FF-BCFB-142283172CCA
Device Start End Sectors Size Type
/dev/sda1 2048 411647 409600 200M Linux filesystem (/boot)
/dev/sda2 411648 4605951 4194304 2G Linux swap
/dev/sda3 4605952 46548991 41943040 20G Linux filesystem (/)
/dev/sda4 46548992 234441614 187892623 89.6G Linux LVM (/var)
Is there a simple way that I can get around this problem? I understand that I need to create a tiny partition at the beginning of the disk as a "BIOS Boot Partition". I suppose one option would be to move the swap to /dev/sda4 as a logical volume, and use /dev/sda2 as /boot.
Alternatively I could just go back to grub-legacy and not worry about that (is there really an advantage to upgrading to grub2 if it causes this much trouble?).
Thoughts?
Thanks for your very helpful answer. I got things working on a virtual machine with a bit of messing around. When I try to do this on my "production" machine (which has two hard drives) I have a number of problems:
grub2-install grub-setup=/bin/true /dev/sda
givesgrub2-install: error: More than one install device?.
. On my working VM the starting sector is marked as 32, but on the production machine its 2048. Don't know if this is relevant. – Robert S – 2015-04-19T06:12:27.873As Flow suggests in his answer the partition type of the BIOS Boot Partition must be set to 0x04 that is "BIOS boot" otherwise grub fails to install. This can be set for example with fdisk's "t" command. – user1225999 – 2017-12-21T12:02:03.803
Is there a way to make grub 2 install without a bios boot partition? I only want to use UEFI. – CMCDragonkai – 2018-03-08T04:29:58.750
1
In an EFI-mode installation, GRUB 2 does not use a BIOS Boot Partition. If GRUB is asking for one, then chances are you've booted in BIOS mode, not in EFI mode. Check your boot options to be sure your CSM is disabled, as described on my Web page on the subject: http://www.rodsbooks.com/efi-bootloaders/csm-good-bad-ugly.html
– Rod Smith – 2018-03-12T02:28:19.870