— Tech — 1 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# Prepare2sudo su -34cat /sys/block/md2/md/stripe_cache_size5cat /proc/sys/dev/raid/speed_limit_min6cat /sys/block/md2/queue/read_ahead_kb78cat /proc/mdstat910# Accelerate RAID Expansion11echo 32768 > /sys/block/md2/md/stripe_cache_size12echo 50000 > /proc/sys/dev/raid/speed_limit_min13echo 32768 > /sys/block/md2/queue/read_ahead_kb1415# Cleanup16echo 4096 > /sys/block/md2/md/stripe_cache_size17echo 10000 > /proc/sys/dev/raid/speed_limit_min18echo 512 > /sys/block/md2/queue/read_ahead_kb
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 zerotier2$ /usr/syno/bin/synopkg stop zerotier3$ /usr/syno/bin/synopkg list4...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.