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
-wolfgang
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-wolfgang
The value after -S is not seconds, for people who don't use that option. The drive will stay up a long time when accessed. As the man page says "The encoding of the timeout value is somewhat peculiar." If it doesn't spin down after an hour something is wrong.
One thing wrong might be jumpers, Other than that, I suspect something is still accessing it. udev?
Bill Davidsen davidsen@tmr.com writes:
Wolfgang S. Rupprecht wrote:
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
One thing wrong might be jumpers, Other than that, I suspect something is still accessing it. udev?
Thanks for the good ideas.
This is a WD Caviar Green and the jumpers are only documented to slow down the SATA by one notch and add spread spectrum clocking for rf noise reduction.
I'll have to try to check for udev. Maybe running lsof in a loop will catch it.
-wolfgang
Wolfgang S. Rupprecht wrote:
Bill Davidsen davidsen@tmr.com writes:
Wolfgang S. Rupprecht wrote:
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
One thing wrong might be jumpers, Other than that, I suspect something is still accessing it. udev?
Thanks for the good ideas.
This is a WD Caviar Green and the jumpers are only documented to slow down the SATA by one notch and add spread spectrum clocking for rf noise reduction.
Wanted to be sure that people knew "-S 120" doesn't mean "spin down after two minutes."
I'll have to try to check for udev. Maybe running lsof in a loop will catch it.
Did you take out the rule for that? I'm not a guru, can't tell you which rule without looking it up, but I have found it, since my hot backup drive on a USB dongle goes down and stays that way. I bet someone will remind us which rule checks that before you can look. ;-)
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
poma pomidorabelisima@gmail.com writes:
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
Thanks! I had forgotten about sdparm. (Boy do I miss the days when I just installed everything and then could do something like "man -k disk" to find likely candidates.
Monitoring /proc/diskstats might also give me a clue as to what is touching the disks.
-wolfgang