nas:build_a_linux_nas:create_a_software_raid_array

This is an old revision of the document!


NAS - Build a Linux NAS - Create a Software RAID Array

Create a Software RAID Array

sudo mdadm --create --verbose /dev/md0 --level=5 --raid-devices=3 /dev/sdb1 /dev/sdc1 /dev/sdd1
 
or 
 
sudo mdadm --create --verbose /dev/md0 --level=5 --raid-devices=3 --spare-devices=1 /dev/sd{b,c,d, e}1

NOTE: This created a new block device /dev/md0.

  • This device represents the RAID 5 of /dev/sdb1, /dev/sdc1 and /dev/sdd1.
  • Obviously other RAID types could be used instead.

Ensure the RAID Array is reassembled automatically each time the system boots

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

NOTE: This saves the RAID configuration in the /etc/mdadm/mdadm.conf file.

  • In the background, mdadm will sync the data of these disks.
  • This can take a very long time as it requires reading and writing a lot of data depending on the size of the disks.

Check the RAID Status

sudo mdadm --detail /dev/md0

returns:

 

NOTE: This also displays not only the health, but also the sync status.

nas/build_a_linux_nas/create_a_software_raid_array.1632586318.txt.gz · Last modified: 2021/09/25 16:11 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki