# disk not spinning down [solved]

## shugaa

Hi,

I seem to have a problem concerning hdparm (in combination with laptop-mode) on my notebook. I got the laptop-mode-tools ebuild from bugzilla and it installed fine and also seems to be working. When running on battery there are only "dirtied inode" messages but no more "WRITE" messages except after a "READ" or when "MAX_AGE" has expired but this is perfectly normal. The problem is that the harddisk won't spin down. 

In /etc/laptop-mode/laptop-mode.conf I set "DO_HD_POWERMGMT=0" and "DO_HD=0". Then I unplugged the power cable and issued "hdparm -S1 /dev/hda". Though absolutely nothing is written to disk (echo 1 > proc/sys/vm/block_dump and dmesg) the harddrive does not spin down after 5 seconds. In fact it doesn't spin down at all. On the other hand when I put it into standby explicitly ("hdparm -y /dev/hda") it remains in standby until the next "READ" or until MAX_AGE has expired (which tells me laptop-mode is working).

When I leave managing the spindown time to laptop_mode ("DO_HD=1") the result is the same. The harddrive won't spin down.

There is no cron or syslog running by the way (anyway I made sure there are no "WRITE"s).

Any help would be really welcome. Any Ideas what I might try?

shugLast edited by shugaa on Sun Feb 27, 2005 10:42 am; edited 1 time in total

----------

## petlab

 *shugaa wrote:*   

> I set "DO_HD_POWERMGMT=0"

 

I don't know that package, but should it be =1 ?

I emerged hdparm, then apmd and my hd started spinning down appropriately.

I read that apmd doesn't do it, but hdparm is supposed to.  So, maybe try turning off whatever laptop-mode scripts, and see if hdparm and apmd will make it spin down..?

HTH

----------

## shugaa

Thanks for your reply.

 *petlab wrote:*   

>  *shugaa wrote:*   I set "DO_HD_POWERMGMT=0" 
> 
> I don't know that package, but should it be =1 ?
> 
> 

 

No. This tells laptop_mode not to do powermanagement for harddrives because I want to do it myself using hdparm (if I understand this correctly).

 *petlab wrote:*   

> 
> 
> I read that apmd doesn't do it, but hdparm is supposed to.  So, maybe try turning off whatever laptop-mode scripts, and see if hdparm and apmd will make it spin down..?

 

I'm using ACPI here. Anyway testing hdparm without laptop-mode-tools isn't that easy because kjournald is accessing the disk every 0-5 seconds.

Maybe I need to clarify the problem as it does not necessarily seem to be laptop-mode-tools related:

Nothing is written to disk. "hdparm -S1 /dev/hda" tells me it has set the spindown timeout to 5 seconds. But the drive doesn't spin down after 5 seconds. I can put the drive into standby manually though and it remains in that state.

Why does the drive not spin down automatically?

----------

## shugaa

I have been investigating on this a bit further and came across this post: http://mailman.linux-thinkpad.org/pipermail/linux-thinkpad/2004-February/016031.html.

That guy seems to have the same problem as I do (also on a Thinkpad). So I followed his suggestions, got smartmontools and disabled SMART (The BIOS won't let me do that). Although SMART could successfully be disabled the drive still does not spin down  :Crying or Very sad:  . So this didn't solve the problem for me but it might be helpful for someone else.

Guys, this is making my hair fall out. So _anything_ which might relate to my problem would be really really welcome!! 

Maybe someone can tell me if it is possible to monitor the harddisk's sleep timer somehow (set by "hdparm -S"). That would be great for the beginning.

shug

----------

## ribx

some questions to help us to understand ur problem.

- did u look for/find other poeple with a similar system (laptop or hd etc)

- did u try an bios update?

- if u spin down manualy everything works as expected? (in laptop mode: hp spinns down for 10min?)

- do u use a unstable kernel? which version?

- did u looked for processes which write to disc all over the time? do u have a cron or a log process? did u try to disable both?

-ribx

----------

## shugaa

Thank you so much for your reply!! I can use every little bit of info on this. 

 *ribx wrote:*   

> 
> 
> - did u look for/find other poeple with a similar system (laptop or hd etc)
> 
> 

 

Couldn't find much information on this problem. I spent hours and hours googleing but couldn't come up with anything useful except the link in my last post which unfortunately didn't solve my problem.

 *ribx wrote:*   

> 
> 
> - did u try an bios update?
> 
> 

 

Yes I checked that already. Latest BIOS here.

 *ribx wrote:*   

> 
> 
> - if u spin down manualy everything works as expected? (in laptop mode: hp spinns down for 10min?)
> 
> 

 

Right, unless I do not explicitly read something from disk there is no activity and the hd remains spun down for at least 10 laptop-mode minutes.

 *ribx wrote:*   

> 
> 
> - do u use a unstable kernel? which version?
> 
> 

 

Not an unstable kernel. gentoo-dev-sources-2.6.10-r6.

 *ribx wrote:*   

> 
> 
> - did u looked for processes which write to disc all over the time? do u have a cron or a log process? did u try to disable both?
> 
> 

 

Yes, I disabled all services except the ones which are vital for system operation. Yet this doesn't make a difference. Also the drive wouldn't remain in manually enforced standby if there was disk activity, would it?! 

Thanks for your help!

----------

## ribx

hmm.. realy strange (as u know for sure  :Wink:  )

so the last thing i can think of is jounalising. which fs do u use? try to mount your file system with

```
-o noload
```

 if your are using ext3 (i hope u do) i dont know the parameter for reiserfs.

its realy strange...

-ribx

----------

## shugaa

 *ribx wrote:*   

> hmm.. realy strange (as u know for sure  )
> 
> so the last thing i can think of is jounalising. which fs do u use? try to mount your file system with
> 
> ```
> ...

 

Thanks for the hint, it didn't do the trick though  :Crying or Very sad:  . My harddrive doesn't care. Really strange, for sure. 

Anyway thank you very much for your concern!

----------

## ribx

look what i found in /usr/src/linux/laptop_mode.txt:

 *Quote:*   

> If you want to find out which process caused the disk to spin up, you can
> 
> gather information by setting the flag /proc/sys/vm/block_dump. When this flag
> 
> is set, Linux reports all disk read and write operations that take place, and
> ...

 

maybe you find out what spins your disc up with that feature

good luck

-ribx

----------

## shugaa

Haha, now that's cool. You're already reading the kernel docs for me. The Gentoo people rule! Thanks again for your effort. If you're ever around remember to stop by for a beer or something.

Back on topic: I have read the laptop-mode docs and the hdparm manpage numerous times and could prolly recite them from memory by now  :Wink:  . I also came across the excerpt you posted above and of course tried what was suggested. When laptop-mode is enabled dmesg is absolutely silent, when I disable laptop-mode though dmesg is populated with a whole lot of "WRITE"s from kjournald, pdflush, bash and whatnot every few seconds. So I assume laptop-mode is doing it's job just fine.

I'm somewhat starting to wonder if this might be a BIOS issue. In the BIOS I have the possibility to set a standby timer for the harddisk. Available options are "3/5/20min", "immediate" and "disabled". I've tried all of them, again to no avail. The Disk does not spin down, not even if "immediate" is selected.

Well, I guess I am doomed.

----------

## ribx

no, i did read the kernel docs only for you sry  :Wink: 

you brought me to enabling laptop mode on my laptop. i wanted to do the for a long time now. the old scripts didnt worked for me and i wanted to add laptop mode to my own acpi script.

i just though at you when i stumbled over the doc  :Smile: 

if i ever come to luebek, i want to try the beer you are trinkin there  :Smile: 

----------

## shugaa

May I ask if you have succeeded setting up laptop-mode on your notebook (including hd powermanagement)?

If so, what model/brand are you using? Just out of interest.

Greets

shug

----------

## shugaa

 :Question:   :Question:   :Question: 

IT IS FINALLY WORKING!! And I haven't got a clue why. This morning I was sitting in front of that damn laptop again typing "hdparm -B1 -S1 /dev/hda" for probably the 1000th time. And I couldn't believe my f***ing ears when I heard the drive spin down. I spun up the disk and I just couldn't believe that after another 5 seconds it went right to sleep again, yeah! I set DO_HD in laptop-mode.conf, rebooted and checked if laptop-mode was now taking care of hd powermanagement. And it did!! It is all working now. I'd like to know why though. I had not touched the machine since my last post here. Maybe it just needed some recreation. 

Anyway, thank you all for your help and patience!!

Yaaaaahhhhh!!!! 

 :Razz:   :Very Happy: 

----------

