Help with setting up a raid system with Turris Omnia NAS - for a beginner

Here are some modifications of Paul_Totterman’s instructions (thanks!) that highlight how to create a RAID1 (mirrorring) array if you already have data on your harddisk (assuming data is on partition /dev/sdb1). I am using those to migrate my old NAS harddrives to the Turris Omnia NAS:

# Create a “degraded” RAID1 device that uses the ext4 file system:
# WARNING: content of /dev/sda1 DELETED!
mdadm --create --verbose /dev/md0 --level=mirror --raid-devices=2 /dev/sda1 missing
mkfs.ext4 /dev/md0

# Check the status of your RAID1 array
mdadm /dev/md0 --detail

# register raid array in the mdadm config
mdadm --detail --scan > /etc/mdadm.conf

# create a startup script
cat > /etc/init.d/mdadm << EOF
#!/bin/sh /etc/rc.common
START=30
start() {
mdadm --assemble /dev/md0
}
stop() {
mdadm --stop /dev/md0
}
EOF
chmod +x /etc/init.d/mdadm

# enable assembly of raid array at startup
/etc/init.d/mdadm enable

Add the mount point by going to the LuCI GUI, set up /mnt/nas as mount point for the /dev/md0 device. At this stage, the RAID array is usable, although it is missing its second disk.

# Copy your data to the array using Rsync (adapt this command to your needs)
cd /mnt/nas
rsync -avz rsync://192.168.1.111:/mydata/ mydata

When the data copy is finished, physically move the disk that contained “mydata” to the Turris Omnia NAS. We assume the device is now called /dev/sdb (and its partition /dev/sdb1).

# Finally, add the disk/partition to the existing RAID array
# WARNING: content of /dev/sdb1 DELETED!
mdadm /dev/md0 --add /dev/sdb1

# Check the status of your RAID1 array
mdadm /dev/md0 --detail

Now to find out if I can receive notifications upon RAID array failure, etc… This is critical because you won’t notice a thing when a first harddrive fails. When the second one fails, you will notice, but it will be too late!

2 Likes