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

Re: UEFI + Raid



On 05/11/2017 12:21 AM, Pascal Hambourg wrote:
Le 11/05/2017 à 00:53, Sam Smith a écrit :
On 05/09/2017 05:44 PM, Pascal Hambourg wrote:

Or use grub-install with --removable and --efi-directory for each disk.
Or use grub-install with --efi-directory and --bootloader-id to install
a copy of GRUB wherever you want and add an EFI boot entry for it.
(...)
I tried to use "grub-install -v  --target=x86_64-efi
--bootloader-id=grub /dev/sdb"

But as far as I could tell everything was installed to the first disk
still (sda) and /boot/efi/EFI/ then had two entries, the old 'debian'
one and then new 'grub' one.

With EFI targets, grub-install ignores the specified device, because it
is irrelevant. This i why I told to use --efi-directory to indicate
which EFI partition (mounted on the specified directory instead of
/boot/efi) to install the GRUB core image on.

dd if=/dev/sda1 of=/dev/sdb1
efibootmgr -c -d /dev/sdb -p 1 -w -L 'debian backup' -l
'\EFI\debian\grubx64.efi'

And now "efibootmgr -v" shows:

Boot000E* debian backup
HD(1,GPT,96aa190b-b6c0-4753-ab6f-171ccc37b745,0x800,0x79800)/File(\EFI\debian\grubx64.efi)


Boot000F* debian
HD(1,GPT,3ec825d3-e2f7-4491-b4a5-321032b0ab8c,0x800,0x79800)/File(\EFI\debian\grubx64.efi)


Beware that using dd clones the partition, including the UUID and label.
So both the original and cloned partition have the same UUID, which will
confuse libblkid and result in either being mounted on /boot/efi.

I guess that will work, though I haven't rebooted yet. What I find weird
is that grub in legacy mode will install to all hard drives in the
system, or at least it would prompt you for what hard drives you wanted
it to be installed to. Why can't grub with efi just automatically do
that same?

Because grub-install works quite differently on EFI targets. It does not
install on a device but on an EFI system partition mount point. Also, it
requires to specify explicit IDs for multiple copies. Also, whhen using
the default ID ("debian"), it deletes any existing EFI boot entry whose
name contains "debian" (case insensitive IIRC).





Ah, this was the info I was missing. Didn't know the partition had to be mounted. I've used this now: grub-install -v --target=x86_64-efi --bootloader-id=debian2 --efi-directory=/mnt/efi

and I think all is well.


Regards,


Reply to: