On 20.04.2013 03:34, Wolfgang S. Rupprecht wrote:
Has anyone succeeded in spinning down disks under Fedora?
I've done the following and the "hdparm -C" does show the disk spun down, but the next time I look it is spun up, and it stays up. The disk is unmounted and I've stopped and disabled smartd, so it isn't accessing the disks. I don't think anything else is either. I'm probably missing a trick somewhere, but what???
disk=/dev/sdc hdparm -S 120 $disk hdparm -y $disk hdparm -C $disk
yum info sdparm … : Warning: It is possible (but unlikely) to change SCSI disk settings : such that the disk stops operating or is slowed down. Use with care.
i.e. /usr/bin/diskungfu: #!/bin/sh # Disk stop - spin down
grep -w sdc /proc/diskstats >dstat.1st sleep 60 grep -w sdc /proc/diskstats >dstat.2nd if cmp dstat.1st dstat.2nd >/dev/null 2>&1 then echo Stopping disk, spinning down… sdparm -f -r -q -v -C stop /dev/sdc exit 0 else echo Disk busy. exit 1 fi EOF
Change the parameters as needed, set-up a cron job, and there you go. ;)
poma