Ubuntu Software RAID 1 on EFI

- Use the "manual" partitioning option during install.

- For each of your disks, delete the partition table, and then "automatically partition" the free space. There might be some 1 MB space left at the beginning and at the end of the automatically created partitioning table, just ignore them.

- Modify the automatically generated partition table: use the ext4 and swap partition as "physical RAID devices".

- Leave the EFIboot partition untouched. When you "automatically partition" the second drive, you will notice that the Ubuntu installer deletes the EFIboot partition on the first drive: there should be only one in total. The previous one will be marked as fat32, and you can leave it like this.

- Create the RAID devices and continue installation as usual and reboot.

- Copy the EFI boot partition from drive sda to sdb:


dd if=/dev/sda1 of=/dev/sdb1

- Using efibootmgr create boot menu entries for the second drive in GRUB:

see the list of menu items:


sudo efibootmgr -v

add new menu item:

For CentOS:


efibootmgr --create --disk /dev/sdb --label "CentOS Backup" --load "\\EFI\\redhat\\grub.efi"

For Ubuntu:


sudo efibootmgr -c -d /dev/sdb -L backup -l \\EFI\\ubuntu\\shimx64.efi

If after testing degraded RAID the system won't boot then login to the server in rescue mode and run:

echo "sleep 20" > /etc/initramfs-tools/scripts/init-premount/delay
chmod a+x delay
update-initramfs -u
exit
shutdown -r now

To re-add the disk run:


mdadm --re-add /dev/md1 /dev/sdb3

If after re-adding the drive the system shows:


W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.

then login in rescue mode, change the mdadm.conf with the result of mkconf:


/usr/share/mdadm/mkconf > /etc/mdadm/mdadm.conf

Then update the INITRAMFS:


update-initramfs -u
sudo touch /forcefsck

Exit the rescue mode and reboot the system.

Tags:

Add new comment

Filtered HTML

  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.