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.


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.

  • 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.


  • 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: https://help.ubuntu.com/community/PowerManagement/ReducedPower

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

  • 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 clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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