Skip to content

Instantly share code, notes, and snippets.

@viral32111
Created July 27, 2022 11:59
Show Gist options
  • Select an option

  • Save viral32111/0fd979df6436d8a6bc9e6cbed4c866fd to your computer and use it in GitHub Desktop.

Select an option

Save viral32111/0fd979df6436d8a6bc9e6cbed4c866fd to your computer and use it in GitHub Desktop.
Linux RAID reference

RAID

Setup

Create GPT on with a single Linux RAID partition for each disk that will be in the array.

Create Array

--level is the RAID level (e.g. 0, 1, 5, etc.)

mdadm --create --name myraid --level=0 --raid-devices=2 /dev/md0 /dev/sda1 /dev/sdb1

Sync Status

cat /proc/mdstat

Save Configuration

mdadm --detail --scan | tee -a /etc/mdadm.conf

Next Steps

The /dev/md0 is the new RAID volume. You can format it as a filesystem, setup LVM on it, encrypt it with LUKS, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment