2

I'm running Ubuntu 11.10 on an Acer Aspire One 722. Whenever I'm on battery power I get a clicking sound from my hard drive every 5 seconds or so (this does not happen when the laptop is plugged in). I'm dual booting with Windows 7 and I don't get the clicking sound in Windows.

The clicking sound stops when I run the command:sudo hdparm -B 254 /dev/sda

Also, according to:sudo smartctl -H /dev/sda my hard drive is healthy.

Is this clicking sound something I can just ignore? Or is it a serious problem and will it eventually damage my computer? If so, how would I fix it?

I have tried adding hdparm -B 254 /dev/sda to my /etc/rc.local file, but I still run into the clicking problem if my computer boots while plugged in and is then unplugged. Also, I'm finding this fix to be unreliable. Sometimes it works, sometimes it does not. Is this a good solution and is there a better way of doing this? Also, would running my laptop with a -B value of 254 have any negative effects? (I read somewhere about a lower level protecting the hard drive from bumps)

Blank
  • 41

6 Answers6

2

gksudo gedit /etc/hdparm.conf

Enter and on the "bottom" of the gedit file

 /dev/sda {
    apm = 254
    apm_battery = 254
}
leoquant
  • 304
2

This is a duplicate of: Laptop's hard drive doesn't really spin down

WRT regards to the posters who have dumped a series of commands, an explanation would be nice. There are trade offs to disabling hard drive power management completely, like the hard drive will better survive the shock from a drop were the heads parked.

Profiling your usage and minimizing disk hits is really the way to go here. Creating a tmpfs to cache things you can afford to lose, like a browser cache, is up to your discretion.

WRT keeping hdparm parameters consistent across boot and suspend/resume, this is managed by the pm-utils and driven by this script here: /usr/lib/pm-utils/power.d/95hdparm-apm. /etc/hdparm.conf should govern these values per hdparm_options in /lib/hdparm/hdparm-functions. If it doesn't, it's a bug.

hdparm -B

   -B     Get/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).
ppetraki
  • 5,531
0

Sounds like it's trying to park the heads very aggressively. Your hdparm command basically turns it off.

If you watch the Load_Cycle_Count value in smartctl, does it increase by one per click? That would support this theory.

It is quite possible that it is shortening the life of your drive, it is stressing moving parts more than they need to be after all. I would put the hdparm command in /etc/rc.local - you can fiddle with the -B value from 0 to 254. 127 is the highest that will let the drive spin down (see man hdparm).

In my experience HDs don't really get a chance to spin down in Linux anyway because syslogd is always writing something or other about cron or whatever.

Caesium
  • 16,207
  • 4
  • 42
  • 48
0

Check in software center or synaptics if you have laptop mode tools installed. If so you can change the above mentioned settings to 254 when on battery by editing the file /etc/laptop-mode/laptop-mode.conf. To edit this file go to the terminal and type gksudo gedit, and navigate to the file and than change and save the settings. I cant provide a screenshot as I dont want to install this programm.

Another possibility is to modify the file etc/hdparm.conf by adding the following at the end of the script:

/dev/sda {
    apm = 254           # power
    apm_battery = 254   # battery
    spindown_time = 0   # no spin down
}
Eric Carvalho
  • 55,453
dago
  • 2,384
0

This problem has been around for ages (at least a couple of years). The reason of the problem is the following: - Due to power saving settings while running on battery several types of hard disks park their heads very soon after the last access (that makes the click) Now several services, AFAIK including the kernel itself (ext3), are programmed without the goal of saving energy, they try to access the hard disk every, say, 10 seconds, which unparks the heads again - Even if nothing has changed at all. And here we go, the load cycle count increases rapidly. Due to the fact that this is no issue on desktops and servers nobody of the coders involved gives a t... ;)

The hdparm fix sets the powersaving timers to much higher values, therefore not parking heads at all. You can imagine how well your energy balance is with that :)

that's my 10 cents to this never-ending story.

best, Manfred

-1

sudo hdparm -B 254 /dev/sda

in the terminal.

reduce swappiness: gksudo gedit /etc/sysctl.conf

beneath the config file

vm.swappiness=10

reboot your machine

control: cat /proc/sys/vm/swappiness

leoquant
  • 304