Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Ubuntu 12.04 the power management does not allow control of hard disk spinning preferences. As a result, when the laptop is on battery the hard disk continues to stop spinning to save power.

I could change manually the settings via the command

sudo hdparm -B 255 /dev/sda

that disables the hard disk power management and lets it spin continuously also on battery. But when I plug the laptop to power and then return to battery the manual setting is lost.

Is there a way to configure this permanently? I really don't care if the laptop consumes more power, but I don't like the disk stopping and starting when I am on battery.

share|improve this question

an other option (I used myself) can be to edit the hdparm configuration file:


In there you find a commented line like this:

#apm = 255

Just delete the # to uncomment so that the hd power management will be disabled by default.

In my case I did it because my laptop disk was turned off and on several times in short time intervals. By the way I discovered that it is the BIOS that is doing that and not hdparm policies and the likes... It happens when I am on battery though.

share|improve this answer
Thank you! Helped me. – Dmitriy Ugnichenko Feb 7 '13 at 23:02
What about apm_battery? Will it make sense to change only that setting? – int_ua Mar 31 '14 at 19:23

If nothing else, you can do a dirty hack by using cron (the Linux task scheduler) to issue that command periodically. It's not exactly ideal though.

share|improve this answer
Yes, you're right. A cron schedule to use hdparm is not exactly the ideal solution. Thanks for the tip anyway. – planck2007 May 9 '12 at 20:41

You can put a script inisde /etc/pm/ folder. Check the info described here:

Sorry for not providing a complete solution - I'm at work, pretending to be productive :)

share|improve this answer
I read the link and it is not exactly a piece of cake. It gives hints though. I found disappointing that in 12.04 the removed the possibility to configure hard disk power management in system settings. Thanks anyway for the suggestion, I will keep it in mind if I don't find anything more user friendly – planck2007 May 9 '12 at 20:39

Your Answer


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.