Skip to content

adrw // Andrew Alexander

Synology Raid Expansion

Tech1 min read

After 5.5 years of faithful service, one of the drives in my Synology DS916+ 4-bay NAS died.

Since I had Synology Hybrid Raid, I could lose one drive and have no data loss. I slotted a new drive in and it rebuilt successfully over a few days.

I got a good deal on some higher capacity drives so I decided to add another drive and switch the RAID mode to SHR-2 which can handle the loss of two drives. This RAID expansion ended up running much more slowly and initially was estimated to take over 2 weeks for ~5-6TB of data in 8TB of total capacity.

In Synology GUI in Volume Manager > Global Settings, there's an option in RAID Resync to allow for faster speed which made a big difference cutting expansion time down to 1 week.

I turned off VMs and other disk heavy services to try and improve throughput but it didn't seem to make much of a difference.

Then, I came across this great script that allows much more fine tweaking of RAID resync settings than the Synology GUI reveals. Using the script as provided cut resync time from a week to 13 hours.

1# Prepare
2sudo su -
3
4cat /sys/block/md2/md/stripe_cache_size
5cat /proc/sys/dev/raid/speed_limit_min
6cat /sys/block/md2/queue/read_ahead_kb
7
8cat /proc/mdstat
9
10# Accelerate RAID Expansion
11echo 32768 > /sys/block/md2/md/stripe_cache_size
12echo 50000 > /proc/sys/dev/raid/speed_limit_min
13echo 32768 > /sys/block/md2/queue/read_ahead_kb
14
15# Cleanup
16echo 4096 > /sys/block/md2/md/stripe_cache_size
17echo 10000 > /proc/sys/dev/raid/speed_limit_min
18echo 512 > /sys/block/md2/queue/read_ahead_kb

In the cat /proc/mdstat readout, the speed change from initial was ~4000K/sec before Synology GUI change to ~20000K/sec with the faster resync to over ~48000K/sec with the script refinements.

Speeding up resync was a big win to reduce the amount of time the RAID volume was in a rebuilding/expanding state.

This might not always be the case but while the faster rebuild/expansion was running, my Synology DSM from browser was unavailable which was not ideal but since the expansion was supposed to finish in 13 hours and be done the next day, I decided to let it run.

In the case where the DSM browser GUI isn't available, I learned you can start and stop packages from SSH with the following commands.

1$ /usr/syno/bin/synopkg start zerotier
2$ /usr/syno/bin/synopkg stop zerotier
3$ /usr/syno/bin/synopkg list
4...
5zerotier-1.1.1: An Ethernet switch for Earth. Create flat virtual networks of almost unlimited size...
6# The package name is everything before the dash and the version number.
© 2022 by adrw // Andrew Alexander. All rights reserved.
Theme by LekoArts