You are not logged in.

#1 2010-08-31 21:36:29

halfgaar
Member
Registered: 2010-05-22
Posts: 50

Spinning down a hard disk and keeping it spinned down

Hi,

I have a third hard disk in my computer for Windows which I want to spin down in Linux, because of noise reasons. On several servers I maintain I just set the standby timeout to several minutes with hdparm and because the disk is not used (spare disk for RAID array), it spins down. However, on my desktop, it keeps spinning up again.

I put these commands in /etc/rc.local:

echo "Spinning down Windows disk and setting timeout to 1 min..."
hdparm -S 12 /dev/sdc
hdparm -y /dev/sdc

But the timeout option doesn't seem to work, because after spinning down, it spins up again and never spins down. When I issue the first hdparm command again, the disk does go into stand by after a minute. It's almost as though the timeout is reset at some point after rc.local is started. What could that be?

What is accessing the disk all the time? Is it some hotplug/automount thing?

How do I keep the disk spinned down?

Offline

#2 2010-09-01 23:41:35

Dave158
Member
Registered: 2010-09-01
Posts: 9
Website

Re: Spinning down a hard disk and keeping it spinned down

Try hdparm -S 120 /dev/sdX. I could be wrong, but it should work better.

Offline

#3 2010-09-02 07:38:36

halfgaar
Member
Registered: 2010-05-22
Posts: 50

Re: Spinning down a hard disk and keeping it spinned down

Why would that work better? It just changes the time.

I think I noticed what's happening. The disk spins down properly and everything, but as soon as I start KDE, it spins up again. It doesn't matter if I wait long or short before logging into KDE. And, the disk doesn't spin down anymore.

I think KDE changes the spindown timeout, but I can't find anything about it in the settings.

Is there a way to spin down the disk and then tell the kernel to discard the drive? I mean, I don't need access to it in Linux.

Offline

#4 2010-09-02 14:55:10

ozar
Member
From: USA
Registered: 2005-02-18
Posts: 1,686

Re: Spinning down a hard disk and keeping it spinned down

Try sdparm... it works for me:

sdparm --command=stop /dev/sdc


oz

Offline

#5 2010-09-02 23:37:21

Dave158
Member
Registered: 2010-09-01
Posts: 9
Website

Re: Spinning down a hard disk and keeping it spinned down

Actually I posted something different from yours halfgaar. You posted sdc while I posted sdX, changes it a bit. And I was going based on what worked for my friend.

Offline

#6 2010-09-03 07:14:29

halfgaar
Member
Registered: 2010-05-22
Posts: 50

Re: Spinning down a hard disk and keeping it spinned down

@ozar
That is basically the same as hdparm -y. I need something that makes the drive inaccessible.

@Dave158
What is /dev/sdX besides a notation that normally requires the user to replace the X with a, b, c, d, etc? /dev/sdX doesn't exist and therefore hdparm will say "/dev/sdX: No such file or directory".

Offline

#7 2010-09-03 07:44:39

djgera
Developer
From: Buenos Aires - Argentina
Registered: 2008-12-24
Posts: 723
Website

Re: Spinning down a hard disk and keeping it spinned down

This is because KDE -> HAL -> pm-utils. When KDE starts always set APM in "AC mode". You can do the trick at differents levels:

* Disable power management from KDE. (in system settings)
* Deny power management messages in HAL (/etc/dbus-1/system.d/hal.conf)
* Disable harddisk management from pm-utils (touch /etc/pm/power.d/harddrive /etc/pm/power.d/readahead)

Offline

#8 2010-09-03 10:22:43

alecmg
Member
Registered: 2008-12-21
Posts: 86

Re: Spinning down a hard disk and keeping it spinned down

laptop-mode tools worked for me

Last edited by alecmg (2010-09-07 07:41:03)


Xyne wrote:
"We've got Pacman. Wacka wacka, bitches!"

Offline

#9 2010-09-04 00:23:34

Dave158
Member
Registered: 2010-09-01
Posts: 9
Website

Re: Spinning down a hard disk and keeping it spinned down

halfgaar wrote:

@ozar
That is basically the same as hdparm -y. I need something that makes the drive inaccessible.

@Dave158
What is /dev/sdX besides a notation that normally requires the user to replace the X with a, b, c, d, etc? /dev/sdX doesn't exist and therefore hdparm will say "/dev/sdX: No such file or directory".

Yeah, I feel like an idiot now. Thanks for letting me know what I should have known. Sorry. I'm new to Arch.

Offline

#10 2010-09-04 08:19:32

halfgaar
Member
Registered: 2010-05-22
Posts: 50

Re: Spinning down a hard disk and keeping it spinned down

It seems that the "touch /etc/pm/power.d/harddrive /etc/pm/power.d/readahead" worked smile

Offline

Board footer

Powered by FluxBB