PDA

View Full Version : Debian Disk Spindown Question



Stoker
2007-10-01, 05:56
Hi all

I'm running Debian on an old PC, I've got 2 hard drives installed and mounted:

hdb1 (type ext3) has the Debian install and slimserver on it
hda1 (type ext2) has my music collection on it.

Since this machine is running all the time (and my lan card/motherboard doesn't support wake on lan) I've started to worry about disk spindown. Does anyone know what, if anything, I can do to ensure that the disks spin down after say 20 minutes of no accesses? How can I tell if they are already spinning down after some period of inactivity?

mflint
2007-10-01, 06:48
"hdparm" is what you need.

The hdparm settings for spindown are a little odd, but they tend to work well.

The hardest part is making sure that no running service keeps the drive from spinning down. This will probably involve setting "noatime" options in /etc/fstab, and stopping syslog from writing occasional "MARK" entries to /var/log/syslog.

Matthew

Stoker
2007-10-01, 07:42
Hi Mflint

Thanks for the (very quick) reply. I've apt-got and installed hdparm and I can check the status of my drives with:

hdparm -C /dev/hdxx

I find that my music drive /dev/hda1 is in standby mode, which the man page suggests is spun down. The other drive (/dev/hdb1) is showing as "active/idle" which (I think) is still spinning, which is what I'd expect since I guess just running commands from a terminal will access the operating system drive.

Is there a way to query the spin down parametes? I can use the -S switch to set the time out but I can see no way to get the current time out period from the drive?

One final question, are any changes I make to the spindown time remembered if I re-boot?

mflint
2007-10-01, 08:10
I can check the status of my drives with:

hdparm -C /dev/hdxx

I find that my music drive /dev/hda1 is in standby mode, which the man page suggests is spun down. The other drive (/dev/hdb1) is showing as "active/idle" which (I think) is still spinning
Correct... see 'man hdparm' for the details.


Is there a way to query the spin down parametes? I can use the -S switch to set the time out but I can see no way to get the current time out period from the drive?
Not that I can find...


One final question, are any changes I make to the spindown time remembered if I re-boot?

On my Ubuntu system, I edited "/etc/hdparm.conf" and added "hdparm" to runlevel2. I'd guess Debian will be similar. You'll need to use whatever runlevel is appropriate...

Matthew

Stoker
2007-10-01, 09:06
Thanks again Matthew.