Software RAID (mdadm) - Running RAID 0 alongside RAID 1

Draft - Incomplete, but kept mostly for my own sake so I can find my way back to it at a later date.

  1. Create empty partitions using fdisk. Ended up with: /dev/sda5, /dev/sdb5 etc.
    • fdisk /dev/sda
      • n (new partition)
        • Note the partition number. For me the last partition number ended up being 5 for all disks, which I used in the mdadm command later.
      • Select start block, end block etc. (or just leave default to use remaining space)
      • w to write partition table
  2. Create a new RAID0 array using new partitions, with mdadm:
    • mdadm --create --verbose /dev/md3 --level=0 --raid-devices=4 /dev/sda5 /dev/sdb5 /dev/sdc5 /dev/sdd5
    • Note: Might wanna check lsblk to verify that /dev/md3 isn't already taken. When I ran installimage I ended up with:
      • md0 = swap
      • md1 = boot
      • md2 = root partition (/)
  3. Run mdadm --detail --scan and find the line that matches /dev/md3. Copy that line and put it at the end of /etc/mdadm/mdadm.conf
    • A lot of tutorials suggest piping that to tee -a /etc/mdadm/mdadm.conf so it appends all the lines to the end of /etc/mdadm/mdadm.conf. In this case since there's already an existing RAID array, there will be duplicate lines and potential for conflicts.
  4. Double check that /etc/mdadm/mdadm.conf looks correct, then run update-initramfs -u so that the RAID array is available during the boot process.

Revision #4
Created 16 July 2022 23:50:51 by Alex Thomassen
Updated 27 March 2023 16:03:11 by Alex Thomassen