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.