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

RAID1 & UEFI: testing a setup with 2 twin ESPs



Hello again Debian EFI support developers,
I would like to follow up on my effort to set up a UEFI machine with
two drives in software RAID1 configuration.

My plan was described in (the second option of):
https://lists.debian.org/debian-efi/2015/09/msg00005.html

Summary: I manually performed all the necessary extra steps and tested
the result by unplugging one of the two drives and attempting to boot.
The EFI boot seems to work, but something is unexpectedly wrong with
the root filesystem, which cannot be found unless both drives are
connected.

Please note that these extra steps will hopefully be performed
automatically in the future, once we have implemented support for
multiple ESPs in grub-efi-amd64 (and possibly other packages).


Detailed explanation: I installed Debian stretch. I chose to manually
partition the two drives with two identical partition tables.
sda1 and sdb1 are two identical 539 Mbyte ESPs, md0 (sda2 & sdb2) is
the root md device, other md devices host /home, /usr, and so forth...

Then, in order for the system to be able to boot from any of the two
drives, with the other one non-working, I performed the following extra
steps:

 A) Since the first ESP is mounted on /boot/efi, we can mount the
second ESP on /boot/efi2

     # mkdir /boot/efi2
     # vim /etc/fstab
     # grep efi2 /etc/fstab
     # /boot/efi2 was on /dev/sdb1 during installation
     UUID=CE67-EBDD  /boot/efi2      vfat    umask=0077     0      1
     # mount /boot/efi2

 B) I manually copied the content of /boot/efi/ to /boot/efi2/:

     # cp -a /boot/efi/EFI /boot/efi2/

Please note that /boot/efi2/ will have be manually kept in sync
with /boot/efi, until grub-efi-amd64 will be able to do that
automatically (by repeating the update process on a configurable list
of ESPs)

 C) I set up the boot order:

     # efibootmgr
     BootCurrent: 0000
     Timeout: 1 seconds
     BootOrder: 0000
     Boot0000* debian
     # efibootmgr --create --disk /dev/sdb \
       --loader '\EFI\debian\grubx64.efi' \
       --label debian2 --part 1
     BootCurrent: 0000
     Timeout: 1 seconds
     BootOrder: 0001,0000
     Boot0000* debian
     Boot0001* debian2
     # efibootmgr --bootorder 0000,0001
     BootCurrent: 0000
     Timeout: 1 seconds
     BootOrder: 0000,0001
     Boot0000* debian
     Boot0001* debian2


At this point, I tested the reboot process (with both drives connected)
and played with the BootOrder in order to see whether the BootCurrent
value would change. Everything worked as expected: with
BootOrder: 0000,0001 I got BootCurrent: 0000 after rebooting; with
BootOrder: 0001,0000 I got BootCurrent: 0001 after rebooting.

Then, I tried to reboot with one drive only (by unplugging the other
one). GRUB was run, the initial ram disk was loaded, but, after a
timeout, I got the error:

  Gave up waiting for root device.
  [...]
  ALERT! /dev/disk/by-uuid/XX-XX-XX-XXXX does not exist!
  [...]

and I was dropped to a BusyBox shell.
The XX-XX-XX-XXXX is the exact UUID of md0, as seen by the system when
running correctly (with both drives connected).
For some obscure reason, the system does not seem to be able to find
the md0 root partition, when only one drive is connected.
This is really awkward, since I have set up other software RAID1
systems in the past, and I have never experienced such issue: those
(BIOS-based) systems were able to boot from one drive only, whenever
the other drive died.

Does anyone has any idea on what's going on?
I can't see what I failed to do properly...
If you need any further detail, please don't hesitate to ask.

Thanks for your time!


P.S.: I am not subscribed to debian-efi@l.d.o, so please CC me on
replies. Thanks for your understanding!

-- 
 http://www.inventati.org/frx/
 There's not a second to spare! To the laboratory!
..................................................... Francesco Poli .
 GnuPG key fpr == CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE

Attachment: pgpgwBbMZop7t.pgp
Description: PGP signature


Reply to: