6

I have a RAID setup using mdadm with 4 harddrives. The server should not always run the harddrives, so I searched for a solution to put HDDs in standby and found this:

hdparm -S 240 /dev/sda

which should put drive /dev/sda in standby and sets auto-spindown-timer to 20 minutes, so the next time it will be idle for more than 20 minutes it will be spin down again. The output of the command also states this:

/dev/sdb:
 setting standby to 240 (20 minutes)

But in fact, the drive spins down after about 5 seconds after the last access, and

hdparm -C /dev/sdb

displays:

/dev/sdb:
 drive state is:  standby

It is impossible to access the RAID, since it is a RAID5 and data is spread among devices, so reading a file results in waking up one drive, then the second drive, but after 5 seconds the first drive was idle, it spins down again and so on...

Sometimes, if I execute hdparm -C to check the current status of the drive, it spins up, which is definitely not what I want, since I wanted to write a monitor script checking the status every minute or so.

Since mdadm is running and the RAID is mounted, it may be the case that mdadm is accessing the disks too often, so this may be the problem but I don't really think so.

Another question is: Is it possible to check a drive's temperature when it is in standby? Using hddtemp gives me SLP which obviously stands for standby, so using hdparm wouldn't be a solution to check for temperature in standby mode. But it may be an alternative solution for checking the status of the drive?

So there are actually three problems:

  • Drive spins down too fast using hdparm -S ...
  • Drive spins up when checking its status using hdparm -C
  • Checking temperature of drive in standby mode isn't possible using hddtemp

Do you know what I'm doing wrong?

15
  • 1
    Spinning hard drives up and down is bad for them. You might save a tiny amount of power, but you could cost yourself a large amount of money replacing it early.
    – Basil
    May 15, 2012 at 13:11
  • 2
    That's the reason why I don't want them to spin up and down too often. I use the RAID only as a network device for multimedia data and backups, so the drives should be in stand by most of the time. I expect the drives to spin up about 1 to 2 times a day in average. The timeout of 2 minutes is for testing purposes and will be increased to about 1 hour.
    – leemes
    May 15, 2012 at 13:23
  • 2
    +1. I've been waiting years for someone to phrase this question well.
    – tomfanning
    May 15, 2012 at 14:44
  • 2
    Spinning up twice a day is worse than letting them spin unused.
    – Basil
    May 15, 2012 at 14:59
  • 3
    @tomfanning Since this question isn't welcome here, I asked it again on askubuntu, where I got help very quickly: askubuntu.com/questions/137577/…
    – leemes
    May 16, 2012 at 11:22

0

Browse other questions tagged .