Feb 222011
- Use the mount option
relatime(ornoatimeif you are brave) for the SSD partitions in/etc/fstab. - Replace several directories (those, the system writes to frequently) with a tmpfs file system as shown below.
- Disable Firefox caching by setting
browser.cache.disk.enableto false in about:config.
Alternatively create the entrybrowser.cache.disk.parent_directoryand set it to/tmp. - Tell grub2 to boot the kernel without optimisation for regular HDDs by adding
elevator=noopto theGRUB_CMDLINE_LINUX_DEFAULT=parameter in/etc/default/grub. Afterwards runsudo update-grub2.
If you want to use the elevator deadline (not noop) you may enable the fifo_batch for sda:echo 1 > /sys/block/sda/queue/iosched/fifo_batch - Try write-back caching instead of write-through by running
hdparm -W1 /dev/sda. If this succeeds add it to/etc/rc.local. - Disable hibernation (writes large amounts of data to the SSD): See above.
Append this to /etc/fstab in order to replace /tmp, /var/tmp and /var/log with ramdisk folders:
1 2 3 4 | # mount /tmp to ram (tmpfs)
tmpfs /tmp tmpfs nodev,nosuid,noexec,relatime,mode=1777,size=15% 0 0
tmpfs /var/tmp tmpfs defaults,size=5% 0 0
tmpfs /var/log tmpfs defaults,size=5% 0 0
|
But you also need to recreate some folders (in order for some programs to be happy). So add the following script in your /etc/rc.local just above exit 0:
1 2 3 4 5 6 7 | #!/bin/sh
# you may want to add more folders to be checked/created to this list:
for dir in apparmor apt ConsoleKit cups dist-upgrade fsck gdm installer news ntpstats samba speech-dispatcher unattended-upgrades; do
if [ ! -e /var/log/$dir ] ; then
mkdir /var/log/$dir
fi
done
|
To disable hibernation completely, tell Policy Kit hibernation is forbidden for all users:
1 2 3 4 5 6 7 8 | cat << EOF | sudo tee /etc/polkit-1/localauthority/50-local.d/02-disable-hibernation.pkla
[Disable hibernate/suspend for all groups]
Identity=unix-group:*
Action=org.freedesktop.upower.hibernate
ResultActive=no
ResultInactive=no
ResultAny=no
EOF
|
resources
- main resource: http://opentechnow.blogspot.com/2010/02/linux-ssd-optimization-guide.html
- more on tmpfs mounts: http://forums.debian.net/viewtopic.php?t=16450
- tips for Windows (might serve as an inspiration):http://thessdreview.com/optimization-guides/the-ssd-optimization-guide-2/
- great resource on SSDs with Linux: https://wiki.ubuntu.com/MagicFab/SSDchecklist
- fifo_batch: http://ubuntuforums.org/showthread.php?t=1464706
- http://www.ocztechnologyforum.com/forum/showthread.php?54379-Linux-Tips-tweaks-and-alignment&p=598608&viewfull=1#post598608
- https://help.ubuntu.com/community/AA1/Using#line-5
- Forbid hibernation using PolicyKit: https://bugs.launchpad.net/ubuntu/+source/policykit-1/+bug/621416/comments/5
- Presentation on SSDs on Linux (German)
[...] the installation you might follow my guide for SSD optimizations on Linux that I wrote after I optimized my the ASUS eeePC [...]
[...] file systems need to go on the HDD to minimize the number of writes to the SSD? Tips on blogs such as this one suggest putting /tmp/ and /var/tmp/ in a ramdisk but I will be burning a lot of DVDs so that isn't [...]