====== Boot RAID on Linux ====== Debian and derivatives (Devuan) now allow you to set up RAID for all volumes, though it is kind of weird. I'm starting to use UEFI. Never wanted to on servers, but it looks like it is the way of the future. So, this is focused on UEFI. If I do another BIOS install, I'll write it up here. ===== UEFI ===== For each of the disks, we want the partitions at the beginning of the disk. Also, on SSD's, we do not use up the whole disk, as Linux Software RAID does not do trim very well, so leaving 20% of the disk free allows the internal BIOS (on industrial SSDs) to do a background TRIM. ==== Create UEFI and RAID parition ==== * Create a new Partition Table (press enter on the drive itself) * Create partition of 550M on each, setting them up as EFI System Partition, bootable * Create an additional partition of 80% of the drive and configure as Physical Volume for RAID * Configure Software RAID, creating a RAID-1 from the two partitions created (usually sda2 and sdb2) * Select RAID partition * Use As ext4, mounted at /, options noatime, nodiratime, label 'rootfs' if desired * Finish. It will complain about no swap space, but we do that as a swap file ==== After install finished ==== After booting, run the following command as root, changing the drive and partitions to match what you set up. This will duplicate the UEFI from the first partition to the second, so both drives are bootable. dd if=/dev/sda1 of=/dev/sdb1 bs=1M status=progress **Note**: Dave suggested setting up the UEFI partition as a RAID. I'll try that some time when I'm not in a crunch. ===== Links ===== * https://superuser.com/questions/1310927/what-is-the-absolute-minimum-size-a-uefi-system-partition-can-be * https://www.cmsws.com/blog/how-to-debian-11-uefi-software-raid/