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
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
And now "efibootmgr -v" shows:
Boot000E* debian backup
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
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).