Dennis ten Hoove


Arch Linux bootable software RAID-0

I decided to speed up my old laptop a bit by running two Samsung 750 Evo SSDs in a RAID configuration. Here I have documented the steps I took.


Go through the installation like normal until you have to partition the disks. Partition both disk identically, here is an example layout;
Device Start End Sectors Size Type
/dev/sda1 2048 1050623 1048576 512M EFI-system
/dev/sda2 1050624 488397134 487346511 232,4G Linux RAID
/dev/sdb1 1050624 488397134 487346511 232,4G Linux RAID
Note that sdb does not have a boot partition, the disk instead has a 512M white space at the beginning of the disk. It is very important that all partitions which you intent to RAID start and end at the exact same location on the disk. Format the boot partition on /dev/sda1 like normal, mkfs.fat -F32 /dev/sda1 Now to create the RAID, mdadm --create --verbose --level=0 --metadata=1.2 --raid-devices=2 /dev/md/md0 /dev/sda2 /dev/sdb1 You can now partition your RAID device like you would partition a normal disk, I am using EXT4. mkfs.ext4 /dev/md/md0 Time to mount the disks. mount /dev/md/md0 /mnt mkdir /mnt/boot mount /dev/sda1 /mnt/boot Now continue installing and configuring Arch like normal.


Once the base system is installed and you have chroot in to the new install we will have to make a few tweaks to make the RAID bootable. Install mdadm if you haven't already, pacman -S mdadm Configure your /etc/mkinitcpio.conf like the following, BINARIES=(mdmon) HOOKS=(base udev autodetect keyboard modconf block mdadm_udev filesystems fsck) Make sure that mdadm_udev is loaded in after block. Generate a new initial RAM filesystem, mkinitcpio -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-zen.img -k 5.6.14-zen1-1-zen Make sure the second filepath points to your initramfs and that the kernel being referred to by -k is listed in /lib/modules. Check the output of mkinitcpio to confirm that mdadm_udev was detected and hooked correctly. Exit out of the chroot and configure mdadm, mdadm --details --scan >> /mnt/etc/mdadm.conf Now archchroot back in to your system and finish the installation like normal.