There are many FOSS frameworks for managing disks and accessing remote file systems via NFS and Samba. These include FreeNAS and Open Media Vault (OVM). However, this document describes the low-level view when using Software Redundant Array of Independent/Inexpensive Disks (RAID) via mdadm
.
RAID is not a backup. Data on the disks used in this document will be erased.
aptitude install mdadm
Obviously you need at least two disks for RAID 0.
Use fdisk
or your tool of choice to partition the HDD.
As root
mdadm --create --verbose /dev/md0 --level=0 --raid-devices=2 /dev/sda1 /dev/sdb1
mkdir /mnt/raid0
mkfs.xfs /dev/md0 # Or your filesystem of choice
mount /dev/md0 /mnt/raid0
mdadm --detail /dev/md0
Edit /etc/fstab
/dev/md0 /mnt/raid0 xfs defaults,noatime 0 1
Add configuration to mdadm
mdadm --detail --scan | tee -a /etc/mdadm/mdadm.conf
Check if the configuration is OK.
reboot
Verify that the RAID comes up.
Obviously you need also at least two disks for RAID 1. The process is basically the same as for RAID 0. Here the summary:
Use fdisk
or your tool of choice to partition the HDD.
As root
mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1
mkdir /mnt/raid1
mkfs.xfs /dev/md0 # Or your filesystem of choice
mount /dev/md0 /mnt/raid1
mdadm --deatil /dev/md0
Edit /etc/fstab
/dev/md0 /mnt/raid1 xfs defaults,noatime 0 1
Add configuration to mdadm
mdadm --detail --scan | tee -a /etc/mdadm/mdadm.conf
Check if the configuration is OK.
reboot
Verify that the RAID comes up.
Version | Date | Notes |
---|---|---|
0.1.1 | 2024-02-15 | + RAID 1 |
0.1.0 | 2023-04-23 | Initial release |