Grub-install: warning: this GPT partition label contains no BIOS Boot Partition; embedding won’t be possible

grub

when boot, I hit "grub rescue" and can boot with "set root=(hd1,gpt1) …"
after boot, ran "sudo update-grub" and then ran "sudo grub-install /dev/sda", but facing error below

on /boot/grub/grub.cfg, I can see "set root='hd0,gpt1'",
so if I can modify it to hd1, I suppose my boot issue will be resolved.
(I have checked /etc/grub.d/* and /etc/default/grub, but I did not find how to edit hd(x))
my cmos says "UEFI" FYI,
please advise.

sudo grub-install /dev/sda  
Installing for i386-pc platform.  
**grub-install: warning: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible.**  
grub-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..  
**grub-install: error: will not proceed with blocklists.**  



Disk /dev/sda: 2.7 TiB, 3000592982016 bytes, 5860533168 sectors  
Units: sectors of 1 * 512 = 512 bytes  
Sector size (logical/physical): 512 bytes / 4096 bytes  
I/O size (minimum/optimal): 4096 bytes / 4096 bytes  
Disklabel type: gpt  
Disk identifier: EB47D80D-DD29-474D-8267-A6CFE06F828A  

Device          Start        End    Sectors   Size Type  
/dev/sda1  5078124544 5860532223  782407680 373.1G Linux filesystem  
/dev/sda2        2048   62500863   62498816  29.8G Linux swap  
/dev/sda3    62500864 5078124543 5015623680   2.3T Linux filesystem  

Best Answer

If you want to use UEFI boot mode, then you're installing the wrong GRUB variant to the wrong place.

UEFI systems do not hold their bootloader directly in the 'MBR' of /dev/sda. They require a special partition, called the "EFI system partition", which holds files that comprise the bootloader. (For example, installing GRUB2 would copy a "grubx64.efi" file to that partition.)

So you must first create that partition, set the correct "partition type" in fdisk, format it with the correct filesystem, and mount it on e.g. /boot/efi.

(The EFI system partition should be ~200 MB, with partition type C12A7328-F81F-11D2-BA4B-00A0C93EC93B on GPT disks, and must be formatted as FAT32 using mkfs.vfat. It can be anywhere on the disk, so just shrink one of your existing partitions to make some space.)

After creating and mounting the partition, tell grub-install to install everything into /boot/efi and do not specify a disk name:

sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi
sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --removable

More detailed instructions can be found in:


Note: The error message is shown because grub-install is currently trying to install GRUB2 for BIOS, not for UEFI. This might be because your system has currently been booted in "legacy mode" (e.g. from an UEFI-incompatible .iso image).

If you're in this situation but want the main system to use UEFI, ignore the error messages and just follow the above instructions. You may need to use grub-install with --removable at first, then reboot into your freshly-installed system, and install grub again (but this time without --removable) to set up the NVRAM entries as they should be.

However, if you actually want to install the BIOS GRUB variant, you still need a special partition because of the BIOS+GPT combination. This time, the "BIOS boot partition" (as the name says, only used in BIOS mode) needs to be ~2 MB, not formatted, and – I think – somewhere within the first 2 TiB of the disk.

Again, more information can be found at:

Related Question