Thursday 3 July 2008

Ticking Dell Laptop - its a power saving thing

My Dell Vostro 1700 laptop ticks like a noisy old clock. It ticks roughly every 30 seconds when on mains power but more than once a second when on battery. Its loud enough to be very irritating to other people in a quiet room (as several people have pointed out to me). Its been there since I got the machine and is the same under Vista and Ubuntu. Its not a normal working disk noise that you might hear on any make of laptop. Its like the noise of a floppy having its cover opened or like the insistent ticking of an old clock or watch. The ticks are in time with the disk activity light which flashes briefly on each tick.

As it happens the drive that came with my laptop has errors; after a couple of weeks it developed bad sectors that wiped the Vista install out. But I'm pretty confident that its not the noise of a drive dying.

There's quite a lot of people posting the same problem and asking if their disks are damaged and about to fail, but the consensus is that they are not and its the way the machine is handling the drive as part of its power saving settings. This fits in with the fact that the noise is frequent when I'm running on battery power.

Suggestions for solutions are:
  • use hdparm to change the power saving parameters for the drive. This should stop the ticking but will reduce the great battery life of the machine (i'm getting just under 4 hours surfing on this Vistro with its 8 cell battery).
  • consider installing Powertop to see what is spinning the disks. (There may not be much you can do about it though unless you are willing to download patches for the programs you use).
This thread on ideastorm explains the problem and suggesting hdparm. Hdparm is already part of your ubuntu distribution (and presumably on many other linuxes as well). Theres also a Windows port of hdparm that the people on the 'clicking Dell' threads report works and takes the same arguments.

The hdparm argument we are interested in is -B. Man hdparm tells us:
-B Set Advanced Power Management feature, if the drive supports it.

A low value means aggressive power management and a high value means better performance.

Possible settings range from values 1 through 127 (which permit spin-down), and values 128 through 254 (which do not permit spin-down). The highest degree of power management is attained with a setting of 1, and the highest I/O performance with a setting of 254.

A value of 255 tells hdparm to disable Advanced Power Management altogether on the drive (not all drives support disabling it, but most do).
Everything that follows assume you have a hard drive called sda.

To find out what your drive(s) are called open a terminal and type:
sudo fdisk -l
For me this gives:
Disk /dev/sda: 160.0 GB, 160041885696 bytes
and then lots of other info listing the partitions. But the key point is my drive is indeed /dev/sda

I cant find any way of seeing what the power saving settings are for the drive. You can get some info with sudo hdparam -i /dev/sda but its not enough. Among other info I get told it has AdvancedPM=yes: unknown setting which is great but not very helpful.
To see if altering the power settings changes the ticking noise type:
sudo hdparm.exe -B 254 /dev/sda
this sets the disk to some minimal power saving with no parking. The clicking should stop instantly. It does for me and others report the same.

Setting to anything smaller than 254 does nothing to reduce the rate of clicks.

The implication of the original thread is that you should set the disk back to 128 as soon as you can bear to hear the clicks again because its safer as it allows the OS to park the disk. Not what I would have understood from the man page; I would have assumed a number below 128 was needed.

The original poster also believed that the value would reset to the default 128 on the next reboot and hence start ticking again. This is not what my machine does. So I assume that what you set with hdparm survives a reboot making it more important to set the value back when you have finished.

edit: Correction to the above. The settings do revert after the machine is shutdown and then booted back up. But they didn't reset after a simple restart.

No comments: