[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Installing grub2-bios into a raw partition instead of MBR gap

From: Pascal-liste
Subject: Re: Installing grub2-bios into a raw partition instead of MBR gap
Date: Thu, 18 Feb 2021 00:05:14 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:68.0) Gecko/20100101 Thunderbird/68.9.0

Le 17/02/2021 à 09:20, Christian Eggers a écrit :
I would like to install grub2 to a non-EFI machine with Windows+Linux (MBR 
table). As Linux uses LVM and the first partition starts at sector 63,

That must be a very old partition table.

there is not enough
space in the MBR gap for grub. But I have a spare partition before the LVM 
starts (/dev/
sda5, 1 MB) where I would like
to install grub.

# grub2-install /dev/sda5
grub2-install error embedding is not possible but this is required for raid and 
lvm install

Why is "embedding" required for a LVM install?

Because block lists (the opposite of embedding), beside being unreliable, can be used only on disks or plain partitions and some filesystems, not on complex devices such as LVM or RAID.

Anyway this command would not do what you want. GRUB-install installs two parts :
- the boot image in the specified device boot sector
- a core image (rescue shell + modules required to read /boot/grub), either embedded in a dedicated location (MBR gap, BIOS boot partition, btrfs or LVM reserved boot area...) or as a regular file /boot/grub/i386-pc/core.img.

Your command would write the boot image in /dev/sda5 boot sector, not in the disk MBR. This requires another boot loader to be installed in the MBR and chainload GRUB. If you want to go that way you need a bigger partition so that you can format it as btrfs which has a reserved boot area. AFAIK, the minimum size of a btrfs partition is 16 MiB.

why can't I use a bare partition (like on an EFI system)?
Regretfully GRUB developpers did not implement a option to explicitly select an arbitrary area for the core image. With a GPT partition table, you could create a "BIOS boot" partition where grub-install would write the core image, but there is no such thing with a DOS partition table, and Windows stands in the way of converting the disk to GPT. A workaround would be to create a hybrid DOS/GPT MBR, but this is quite hackish and unstable.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]