For Synology and QNAP, under normal circumstances, the ideal state of accessing data on a specific hard drive where only that hard drive itself works while other unrelated hard drives remain in hibernation is not possible by default. This is because, by default, both products use RAID 1 technology to write critical system data to all hard drives simultaneously, which causes all hard drives to wake up whenever there is a read or write operation. The prerequisite to solving this problem is to insert only one hard drive (preferably an SSD) when initializing the NAS, and then insert other data hard drives after the system is completely installed (this way, all apps will only be installed and run on the SSD, so at least the system operation and the functioning of these apps will no longer affect other data hard drives.
Secondly, the mdadm command is used to process the data hard drives. Because even if the system is installed on the SSD first, when data hard drives are subsequently added to the NAS, Synology and QNAP will still add multiple RAID1 arrays to these drives to store some critical data. Therefore, to hibernate in an ideal state, each data hard drive needs to be removed from the RAID1 arrays. However, due to security considerations, it is also necessary to briefly add the hard drives back to each RAID1 array daily to synchronize data. See the actual steps below for specific details.
Note: This article only covers Synology. For QNAP's setup method, some bloggers have already written very detailed tutorials online, which you can search for yourself.
First, log in to the Synology system via SSH. I don't need to explain how to SSH in detail, right...
After SSHing, switch to the root user
sudo -i
Use the command
cat /proc/mdstat
to check how many mds (md is RAID1) there are and which hard drives are used. The image below shows my Xpenology (black Synology) NAS:

There are 4 RAID arrays here: md0, md1, md2, md3, among which md0 and md1 use all hard drives, while md3 only uses 4 mechanical hard drives. md2 corresponds to the disk where the system is located. Since we previously recommended inserting only the SSD during initialization, there is only sdf3 here.
Note: In this article, sdf is the SSD solid-state drive, and 3 represents the 3rd partition of this SSD.
First, check md0 and md1, which are similar to md9 and md13 on QNAP.
mdadm -D /dev/md0

As can be seen from the figure above, md0 contains 4 data hard drives, namely sda, sdb, sdc, and sdd, plus sdf1. Here, 1 is the partition number of each hard drive in this md, and the same applies below.
mdadm -D /dev/md1

md1 also contains 4 data hard drives, namely sda2, sdb2, sdc2, and sdd2, plus sdf2.
mdadm -D /dev/md3

md3 only contains 4 data hard drives, namely sda, sdb, sdc, and sdd. Therefore, our next goal is also clear, which is md0 and md1. Because these 2 RAID arrays contain both data drives and the system SSD, any system read/write operation will inevitably wake up the 4 data drives. Stripping the 4 data drives from md0 and md1 is what we need to do next. However, for your respective Synology systems, how do you distinguish which are SSDs and which are HDD data drives? (Why do I say HDD data drives? Rich people using SSDs as data drives would directly ask, why hibernate?) Use the
parted /dev/sd(#) printcommand to find out which are HDD data drives and which are SSDs. To achieve the ideal method we mentioned earlier, why do we need to install the system only on the SSD? Because the drive where the system is installed must run constantly and cannot hibernate. All others are HDD data drives that need to hibernate, so making a clear distinction is a prerequisite.
parted /dev/sdf print

parted /dev/sda print

You can see that my sdf is the system SSD, and the others (a, d, c, b) are HDD drives, which are our targets. Let's start the operation. Use the following commands to set the corresponding partitions of sda1, sdb1, sdc1, and sdd1 in md0 to fail:
mdadm /dev/md0 -f /dev/sda1
mdadm /dev/md0 -f /dev/sdb1
mdadm /dev/md0 -f /dev/sdc1
mdadm /dev/md0 -f /dev/sdd1
mdadm /dev/md0 -f /dev/sdb1
mdadm -D /dev/md0

mdadm /dev/md0 -f /dev/sdc1
mdadm /dev/md1 -f /dev/sda2
mdadm /dev/md1 -f /dev/sdb2
mdadm /dev/md1 -f /dev/sdc2
mdadm /dev/md1 -f /dev/sdd2
mdadm /dev/md0 -f /dev/sdb1
mdadm -D /dev/md1

Then run again
As seen from the figure above, after running the command, the states of sda1, sdb1, sdc1, and sdd1 are all displayed as faulty. Similarly, perform the same operation on sda2, sdb2, sdc2, and sdd2 of md1:
hdparm -S 120 /dev/sda
hdparm -S 120 /dev/sdb
hdparm -S 120 /dev/sdc
hdparm -S 120 /dev/sdd
mdadm /dev/md1 -f /dev/sdb2

mdadm /dev/md1 -f /dev/sdc2
hdparm -C /dev/sda | grep state

After running the command, the states of sda2, sdb2, sdc2, and sdd2 are also displayed as faulty.
Next, set a 10-minute hibernation for each of the 4 hard drives:
hdparm -S 120 /dev/sda
hdparm -S 120 /dev/sdb
vim /volume1/@userpreference/admin/rebulid_md.sh
hdparm -S 120 /dev/sdd
#!/bin/bash
echo Re-adding md0
mdadm /dev/md0 --re-add /dev/sda1
mdadm /dev/md0 --re-add /dev/sdb1
mdadm /dev/md0 --re-add /dev/sdc1
mdadm /dev/md0 --re-add /dev/sdd1
echo Re-adding md1
mdadm /dev/md1 --re-add /dev/sda2
mdadm /dev/md1 --re-add /dev/sdb2
mdadm /dev/md1 --re-add /dev/sdc2
mdadm /dev/md1 --re-add /dev/sdd2
vim /volume1/@userpreference/admin/disconnect_md.sh
hdparm -C /dev/sda | grep state
#!/bin/bash
echo Disconnecting md0
mdadm /dev/md0 --fail /dev/sda1
mdadm /dev/md0 --fail /dev/sdb1
mdadm /dev/md0 --fail /dev/sdc1
mdadm /dev/md0 --fail /dev/sdd1
echo Disconnecting md1
mdadm /dev/md1 --fail /dev/sda2
mdadm /dev/md1 --fail /dev/sdb2
mdadm /dev/md1 --fail /dev/sdc2
mdadm /dev/md1 --fail /dev/sdd2
vim /volume1/@userpreference/admin/hdd_sleep.sh
hdparm -C /dev/sda | grep state
hdparm -S 120 /dev/sda
hdparm -S 120 /dev/sdb
hdparm -S 120 /dev/sdc
hdparm -S 120 /dev/sdd
mdadm /dev/md0 --fail /dev/sda1
chmod +x /volume1/@userpreference/admin/rebulid_md.sh
chmod +x /volume1/@userpreference/admin/disconnect_md.sh
chmod +x /volume1/@userpreference/admin/hdd_sleep.sh
mdadm /dev/md0 --fail /dev/sdc1




mdadm /dev/md0 --fail /dev/sdd1



echo Disconnecting md1



mdadm /dev/md1 --fail /dev/sda2
Following the steps was a complete success. Daily standby for 12 disks is 140w, and after hibernation, the power drops to 75w. The key is that hibernation can greatly reduce the burden on the hard drives. Thank you, OP, for your selfless sharing! This is the most detailed and clearest tutorial on the entire internet. Although there is a tiny flaw, which is the warning about being unable to access the system partition, I feel Synology's thinking is very rigid. They could completely learn from TrueNAS and set up the system disk separately, or leave the choice of the boot partition to the user. Enterprise-grade products actually care quite a bit about electricity bills, right?
p.s. The sleep script seems to need to be run by the root user as well; the admin user doesn't seem to be able to run it.
p.s. The sleep script seems to need to be run by the root user as well; the admin user doesn't seem to be able to run it.
Yes, it definitely needs root. However, although I wrote this based on XPEnology, I actually use QNAP (and did similar processing). After messing around with XPEnology for a long time, it turns out it's basically useless now~.
There is also a small issue, I don't know if you have encountered it. My machine always automatically wakes up in the background. That is, hibernation succeeds, but it doesn't last long before waking up.
When you first installed the system, did you only plug in the system disk to install? I remember the article mentioned that if you installed the system with all disks plugged in, it is equivalent to having system code on every disk, and it will definitely wake up automatically at every turn.
I didn't plug in the HDD during installation, just plugged in the new HDD yesterday. When installing the system, there were just two virtual hard drives, which puzzles me. Now that I'm at work, I can't log into SSH. I'll check the wakeup logs in detail when I get back.
Hey expert, another small question. Why is it that as soon as I execute the rebuild_md.sh script now, it prompts:
bash /volume1/@userpreference/admin/rebulid_md.sh
Re-adding md0
mdadm: –re-add for /dev/sata1p1 to /dev/md0 is not possible
mdadm: –re-add for /dev/sata2p1 to /dev/md0 is not possible
mdadm: –re-add for /dev/sata3p1 to /dev/md0 is not possible
mdadm: –re-add for /dev/sata4p1 to /dev/md0 is not possible
mdadm: –re-add for /dev/sata5p1 to /dev/md0 is not possible
mdadm: –re-add for /dev/sata6p1 to /dev/md0 is not possible
mdadm: –re-add for /dev/sata7p1 to /dev/md0 is not possible
mdadm: –re-add for /dev/sata8p1 to /dev/md0 is not possible
mdadm: –re-add for /dev/sata9p1 to /dev/md0 is not possible
mdadm: –re-add for /dev/sata10p1 to /dev/md0 is not possible
mdadm: –re-add for /dev/sata11p1 to /dev/md0 is not possible
mdadm: –re-add for /dev/sata12p1 to /dev/md0 is not possible
Re-adding md1
mdadm: –re-add for /dev/sata1p2 to /dev/md1 is not possible
mdadm: –re-add for /dev/sata2p2 to /dev/md1 is not possible
mdadm: –re-add for /dev/sata3p2 to /dev/md1 is not possible
mdadm: –re-add for /dev/sata4p2 to /dev/md1 is not possible
mdadm: –re-add for /dev/sata5p2 to /dev/md1 is not possible
mdadm: –re-add for /dev/sata6p2 to /dev/md1 is not possible
mdadm: –re-add for /dev/sata7p2 to /dev/md1 is not possible
mdadm: –re-add for /dev/sata8p2 to /dev/md1 is not possible
mdadm: –re-add for /dev/sata9p2 to /dev/md1 is not possible
mdadm: –re-add for /dev/sata10p2 to /dev/md1 is not possible
mdadm: –re-add for /dev/sata11p2 to /dev/md1 is not possible
mdadm: –re-add for /dev/sata12p2 to /dev/md1 is not possible
All of them are not possible. Permissions have been set, and yet this system partition can be restored by clicking repair in the system. Has the system been secretly modified?
bash /volume1/@userpreference/admin/rebulid_md.sh
mdadm: --re-add for /dev/sata1p1 to /dev/md0 is not possible
cat /proc/mdstatmdadm: --re-add for /dev/sata2p1 to /dev/md0 is not possiblemdadm: --re-add for /dev/sata5p1 to /dev/md0 is not possible
mdadm: --re-add for /dev/sata6p1 to /dev/md0 is not possible
mdadm: --re-add for /dev/sata8p1 to /dev/md0 is not possible
mdadm: --re-add for /dev/sata9p1 to /dev/md0 is not possible