I use Ubuntu 12.04 on a home server. There are 5 hard drives: one SSD with the OS and 4 HDDs (Samsung HD204UI) configured as a RAID5 using mdadm.
I don't need the RAID very often (say, about once per day in average); it contains multimedia data and some backups, so I decided to put the drives to standby most of the time.
I configured the drives to automatically spin-down after 20 minutes using hdparm, here
/dev/sda as an example:
hdparm -S 240 /dev/sda
The output of the command confirmed this:
/dev/sdb: setting standby to 240 (20 minutes)
But the problem is that the drive spins down after about 5 seconds (instead 20 minutes) after the last access, and
hdparm -C /dev/sdb
/dev/sdb: drive state is: standby
Why doesn't the drive wait the 20 minutes as configured? Does it have something to do with the RAID setup? (I don't think so...)
This very short timeout is problematic since it is a RAID5 and when I access a file, it is spread block-wise around the four drives. Since drive 1 isn't needed when drive 2 is read, it went asleep when it will be used the next time (after drive 3 has been read from). So the drives keep spinning up and down the whole time resulting in a throughput near zero.
For the people being concerned about the life of my drives: It will be no problem that the drives are spinned up and down once a day in average since I prefer saving energy and heat over health of the drives (I use RAID5 and the content isn't very important).