It seems that you still need to create a boot partition for else the deployment will fail. I just now tried deploying a server were both boot SSD are in a RAID 1, then setup to use LVM with an XFS filesystem mounted at /
Solution:
Here’s what I did to get it to work.
- Create a 1024MB partition on each of the drives. On sda1, I mounted it at
/boot/efi
as FAT32. I left sdb1 as unmounted and unformatted.
- I then created a second partition on each of the drives, using up the remaining space on each of the drives but leaving them unformatted.
- A raid 1 volume was created from sda2 and sdb2, also unformatted
- A volume group was then created by selected the md0 volume.
- After that, I created the logical volume and mounted it at
/
as XFS
- The machine was deployed using ubuntu 22
- After the machine was deployed, I ran
dd if=/dev/sda1 of=/dev/sdb1
to copy the boot partition from the primary boot drive to the secondary.
Testing
- I tested the setup by removing the drive sled from the server will it was running. I got a warning from letting me know that the drive was removed.
- I installed some additional packages and rebooted the server with /dev/sda still removed from the server. The server was able to boot from
sdb
, however once it was booted it assumed the role of sda
.
- I reinserted the primary drive and it was mounted as
/dev/sdh
. From there, I re-added the device using mdadm --add /dev/md0 /dev/sdh2
and watched the process using watch cat /proc/mdstat
.
- After a few minutes. the rebuild was successful!
- Keep in mind, since I did not install a fresh drive, there may be a few more steps to format a new drive before it can be used to replace a failed drive in a live scenario.
I’m still not sure if this is the best practice for deploying a software raid 1 as the boot drive. Hardware raid may be more robust, but I’m using other drives on the same HBA for a ceph deployment so my raid card had to be configured in HBA mode. I would still like to hear what everyone else is using. Thanks for the read and I hope you found it useful!