Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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)

share|improve this question
    
Um... I'd back up fairly soon if I were you - every hard drive I've had that made a clicking noise did not last long.... –  Mark Rooney Nov 26 '11 at 5:32
    
I've only had the computer for about a month, and it doesn't click when its plugged in, or running Windows 7. Hopefully it isn't about to fail. Either way, suggestion taken. I've got it all backed up. –  Blank Nov 26 '11 at 5:51
    
possible duplicate of Laptop's hard drive doesn't really spin down –  Jorge Castro Nov 28 '11 at 20:05

6 Answers 6

gksudo gedit /etc/hdparm.conf

Enter and on the "bottom" of the gedit file

 /dev/sda {
    apm = 254
    apm_battery = 254
}
share|improve this answer
    
This managed to stop the clicking even if the computer starts and is later unplugged. However, it did not really address my question about if setting hdparm to 254 for battery power is a good idea, and if there are any negative side effects to this. –  Blank Nov 30 '11 at 0:52

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).
share|improve this answer
    
when you talk about a "shock from a drop" are you talking about the computer being physically dropped? –  Blank Nov 30 '11 at 0:32
    
Yes, it doesn't have to connect to hard surface. It could be from waist high to the cushions on a comfy couch. Or simply being jerked around. It's the acceleration and how fast you come to a stop that matters, "shock from a drop" was an over simplification. If you end up traveling a lot like I do, an SSD is really the way to go. Unnecessary disk access however still costs energy, using powertop to run these down like I mentioned in the linked post is worthwhile no matter what media you have. It's kinda fun too :). –  ppetraki Nov 30 '11 at 17:40

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.

share|improve this answer
    
Thanks for the great reply. My Load_Cycle_Count does go up by one for each click. I tried a few different -B values but it seems like 254 is the only one that stops the clicking. If I put the hdparm -B 254 /dev/sda command into my rc.local and it does stop the clicking, is my Ubuntu safe to use or are there side effects to tweaking the Power Management Level? –  Blank Nov 26 '11 at 18:25
    
No side effects other than maybe slightly higher power consumption. As I say, I find that HDs can't spin down in Linux anyway unless you put /var on a tmpfs or something because there's logs and stuff being written to all the time. –  Caesium Nov 26 '11 at 18:33
    
I just put hdparm -B 254 /dev/sda/ in /etc/rc.local and rebooted. I don't get the clicking sound anymore and my Load_Cycle_Count hasn't gone up in the past few minutes. I've noticed that when I start the computer while it is plugged in and then unplug it, the clicking sound starts again. Is there any way to fix that? –  Blank Nov 26 '11 at 19:36
    
Some power management scripts may be reversing your hdparm change when they detect the power source changing. I'm afraid I don't know what though, nothing in /etc seems immediately obivous. You'd be best adding this info into the original question to see if anyone knows. –  Caesium Nov 26 '11 at 21:05

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

}

share|improve this answer

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

share|improve this answer
    
In reference to my question, is it a good idea to set hdparm so that it doesn't park the heads? –  Blank Nov 30 '11 at 0:29

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

share|improve this answer
    
What would doing all that do and why would it fix the problem? –  Blank Nov 26 '11 at 20:57
    
Because it fixed my hard disk "clicking" on two acer laptops blank....Yes the "clicking" sound is your harddisk and it is harmful for your harddisk. It has something to do with powermanagment build-in laptops. –  leoquant Nov 27 '11 at 18:32
    
Why adding this info into the original question:sudo hdparm -B 254 /dev/sda? –  leoquant Nov 27 '11 at 18:41
    
I just tried this and it didn't stop the clicking. Thanks for the suggestion. –  Blank Nov 27 '11 at 18:59
    
"If I put the hdparm -B 254 /dev/sda command into my rc.local and it does stop the clicking" "The clicking sound stops when I run the command:sudo hdparm -B 254 /dev/sda"I really don't understand your point. I did suggest doing that, you put my suggestion in your first question. What did not help stopping the clicking sound? Less swappiness is less using your harddisk and is faster on systems with 2gb or more RAM. Doesn't stop the clicking..... –  leoquant Nov 27 '11 at 19:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.