summary |
---|
RAID using mdadm - a predecessor of ZFS and its RAID features |
sudo apt install mdadm
mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sda1 /dev/sdb1 /dev/sdc1
cat /proc/mdstat
mdadm --detail /dev/md0
insert any of its devices
sudo mdadm -E /dev/sda1
/dev/md/0 /mnt/raid_01 ext4 defaults 0 0
...or use its uuid...
sudo mdadm --detail --scan >> /etc/mdadm/mdadm.conf
Results is ARRAY /dev/md/0 metadata=1.2 name=server:0 UUID=xxxxxxxx:xxxxxxxx:xxxxxxxx:xxxxxxxx
mdadm --add /dev/md/0 /dev/sdd1
mdadm --re-add /dev/md/0 /dev/sdd1
- Mark it as failing (or it already has an (F) in mdstat)
mdadm --fail /dev/md/0 /dev/sdd1
- Remove it...
mdadm --remove /dev/md/0 /dev/sdd1