Making hdparm setting permanent in Ubuntu 12.04

Ubuntu 12.04 and 11.10 (perhaps other distros as well) set the APM default very aggressively, leading your hard drive to hundreds and thousands of load/unload cycles in too short period of time. Typically HDD are only rated for 600,000 load/unload cycles, so it is beneficial to reduce this cycling.

You can slow down the cycling manually, but the system will FORGET this setting upon reboot. Here is one method to make this setting semi-permanent.

Open a Terminal, and do:
1) type sudo gedit /etc/pm/power.d/90_hdparm
2) in gedit, type only this line: hdparm -B 250 /dev/sda, where /dev/sda is the HDD you’re wanting to stop cycling.
3) save and exit gedit.
4) type sudo chmod +x /etc/pm/power.d/90_hdparm
5) type sudo cp /etc/pm/power.d/90_hdparm /etc/pm/sleep.d

Reboot, and check that your setting “stayed” by typing at Terminal:
sudo hdparm -B /dev/sda

This setting allows the drive to unload after an extended period without use, perhaps helping the HDD run a bit cooler without excessive wear. Instead of 250 you could use 254, which is thought to disallow unloading altogether–I used 254 for several months and noticed my HDD stayed at about 100 degrees Fahrenheit.

To check how many load/unload cycles you’re using, go into Disk Utility, SMART data, and scroll down to Load/Unload cycle count.

After figuring this out on my own, I found much the similar procedure at:

MATLAB R2012a (student version) in Ubuntu 11.10 (64-bit)

The student version (32-bit) of MATLAB R2012a under Ubuntu 11.10 64-bit seems to work just fine.

With R2011a student version, I had issues with the Symbolic Toolbox not working, i.e. using 100% CPU and needing to use “xkill” to stop MATLAB.

No such issues with R2012a student version, thankfully.
Provided that you chose to install with symbolic links (e.g. in usr/local/bin), you can start MATLAB by typing

matlab -glnx86 -desktop

in the Terminal, or just make a shortcut.