QNAP TS-210 Turbo NAS Notes

Multi RAID

Out of the box the TS-210 did not support multiple RAID partitions. I wanted to have a 500gb RAID-1 for important stuff and a 3tb RAID-0 for unimportant media.The first step was to partition the drives as follows:

/dev/sda1   *           1          66      530141   83  Linux
/dev/sda2              67         132      530142   82  Linux swap / Solaris
/dev/sda3             133      243138  1951945695    5  Extended
/dev/sda4          243139      243200      498012   83  Linux
/dev/sda5             133       60921   488287638+  fd  Linux raid autodetect
/dev/sda6           60922      243138  1463658048+  fd  Linux raid autodetect

I noticed that the software did not have device nodes for the extra partitions I had created, so I added them:
 
mknod /dev/sda5 b 8 5
# mknod /dev/sda6 b 8 6
# mknod /dev/sdb5 b 8 21
# mknod /dev/sdb6 b 8 22

I created the new md devices:

# mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sda5 /dev/sdb5
# mdadm --create /dev/md1 --level=0 --raid-devices=2 /dev/sda6 /dev/sdb6
# mke2fs -t ext4 -L store -m 1 /dev/md0
# mke2fs -t ext4 -L dump -m 1 /dev/md1

I needed a way for this to get done automatically when the NAS rebooted, so I created autorun.sh on the config partition:

[/etc/init.d] # mount /dev/mtdblock5 /tmp/config/
[/tmp/config] # cat autorun.sh 
mknod /dev/sda5 b 8 5
mknod /dev/sda6 b 8 6
mknod /dev/sdb5 b 8 21
mknod /dev/sdb6 b 8 22

mdadm --assemble /dev/md0 /dev/sda5 /dev/sdb5
mdadm --assemble /dev/md1 /dev/sda6 /dev/sdb6

mkdir /share/MD0_DATA
mkdir /share/MD1_DATA

mount -t ext4 /dev/md0 /share/MD0_DATA
mount -t ext4 /dev/md1 /share/MD1_DATA

I had to set some other files as well:

/etc/config/raidtab
raiddev /dev/md0
        raid-level      1
        nr-raid-disks   2
        nr-spare-disks  0
        chunk-size      4
        persistent-superblock   1
        device  /dev/sda5
        raid-disk       0
        device  /dev/sdb5
        raid-disk       1

raiddev /dev/md1
        raid-level      0
        nr-raid-disks   2
        nr-spare-disks  0
        chunk-size      4
        persistent-superblock   1
        device  /dev/sda6
        raid-disk       0
        device  /dev/sdb6
        raid-disk       1

mdadm.conf
ARRAY /dev/md0 devices=/dev/sda5,/dev/sdb5
ARRAY /dev/md1 devices=/dev/sda6,/dev/sdb6

/etc/storage.conf
[VOLUME 1]
device name = /dev/md0
raid level = 1
raid disks = 1,2
spare raid disks =
status = 0
record_time = Fri Jun  3 15:50:36 2011

filesystem = 104
[VOLUME 2]
device name = /dev/md1
raid level = 0
raid disks = 1,2
spare raid disks =
status = 0
record_time = Fri Jun  3 15:50:36 2011

filesystem = 103
[Global]
Available Disk = 2

Once done log into the web interface and go to Access -> Share Folders -> Create Default Folders



Comments