Is it safe to put harddisks of a md-software-raid to standby?

Solution 1:

I should think so. I have been using it my backup machine with RAID-1 for about a year. Got the tips from this page. It is also mentioned on the Gentoo wiki and [H]ardforum threads.

Also, the man page for hdparm marks the similar power off mode (-s ) as VERY DANGEROUS but makes no mention about risks in the hd-idle section.

Solution 2:

In my experience, it is safe. I have run a home server for several years with "hdparm -S 240" and didn't experience any problems.

Be aware though:

  • All the disks time out and wake up individually. In a RAID-5 this may take a long time, because the disks wake up one after each other.

Also, some popular drives like the WD RED series lack APM features and can't be handled by hdparm.

I have written a script (tested on Debian 8.0) to overcome both problems:

  • https://github.com/thomask77/raid-sleep

Solution 3:

As stated in the hdparm man page for -S:

This timeout value is used by the drive to determine how long to wait (with no disk activity) before turning off the spindle motor to save power. Under such circumstances, the drive may take as long as 30 seconds to respond to a subsequent disk access, though most drives are much quicker.

The Red Hat Power Management guide states:

Many applications scan configuration files for changes. In many cases, the scan is performed at a fixed interval, for example, every minute. This can be a problem, because it forces a disk to wake up from spindowns.

Both of these strongly indicate that spinning down disks is safe, as if any disk activity occurs that requires a particular disk to be spun up, it will be spun up automatically. This also agrees with my personal experience; any disk I/O will make a spun-down drive spin up. You can also manually cause I/O to the drive to force it to spin up if you know it'll soon be needed; hdparm's -z option might be useful for that:

-z Force a kernel re-read of the partition table of the specified device(s).

Note that as stated in the hdparm man page, the spin-up process can take considerable time during which the I/O request will appear nonresponsive to the userland process. I suggest trying this beforehand to make sure your disks don't take excessive time to spin up, which might make mdraid kick them out of your array (which leads to Bad Things when you drop below your array's redundancy threshold). Spinup times shouldn't be a problem with modern drives, but you never know for certain before you test in your particular environment.