Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a home-fileserver with 6 desktop harddisks in a md-raid.

The server isn't accessed a lot, so I think it would be good for the harddrives to go in standby-mode after some idle time (e.g. with the hdparm -S or hd-idle command).

Is this safe when using mdadm or could this cause errors/degraded harddisks?

share|improve this question
As a quick answer, I believe that if something is supposed to write/read the drive, it will come out of standby. – soandos Aug 26 '11 at 21:35
I take it you're not using a desktop environment on this computer? It'd be really safe if gnome or kde did it for you. – digitxp Aug 26 '11 at 21:36
@soandos: Yes that's the behaviour I would expect too. – Dani31 Aug 26 '11 at 21:43
@digitxp: You're right, but why do you think it would be really safe with a desktop environment? – Dani31 Aug 26 '11 at 21:44
@Dani31 You know the Gnome guys, they'll make something absolutely idiotproof or if they can't they'll pretend such a feature never existed. – digitxp Aug 26 '11 at 21:47
up vote 3 down vote accepted

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.

share|improve this answer

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:

share|improve this answer

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.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .