Skip to main content
Software RAID (mdadm) - Running RAID 0 alongside RAID 1
- Specific scenario: Hetzner installimage with RAID1
- RAID1 with less storage for the OS and "important" stuff.
- RAID0 with the remaining storage across all 4 of the disks (Linux ISOs).
- 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
- 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 (/)
- 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.
- 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.
- TODO: Creating filesystem, mounting, append to fstab.