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
/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
- Checking temperature of drive in standby mode isn't possible using
Do you know what I'm doing wrong?