How to optimize a solid state drive: Difference between revisions

From Wiki
Jump to navigation Jump to search
 
Line 24: Line 24:
== TRIM support ==
== TRIM support ==
TRIM is executed weekly by <code>/etc/cron.weekly/fstrim</code>
TRIM is executed weekly by <code>/etc/cron.weekly/fstrim</code>
You can also test manually with
<pre>
root@gpu:~# fstrim -v /
/: 194551808 bytes were trimmed
</pre>


== OLD: Updates to /etc/fstab ==
== OLD: Updates to /etc/fstab ==

Latest revision as of 16:13, 29 May 2015

Important background

The SSD Anthology: http://www.anandtech.com/show/2738

Wiping the drive

https://ata.wiki.kernel.org/index.php/ATA_Secure_Erase

http://www.anandtech.com/show/2738/11

You should do a complete drive erase whenever you rebuild the OS.

Rebuilding the partitions

Don't put a swap partition on the SSD. You also want to worry about "alignment" of partitions. I avoided this issue by filling the entire drive with a single partition.

Kernel support

To get TRIM support in Linux, you need the 2.6.33 kernel or better. To get this working in Lucid (2.6.32):

sudo add-apt-repository ppa:kernel-ppa/ppa 
sudo apt-get update
sudo apt-get install linux-headers-2.6.36-1 linux-headers-2.6.36-1-generic
sudo apt-get install linux-image-2.6.36-1-generic

TRIM support

TRIM is executed weekly by /etc/cron.weekly/fstrim

You can also test manually with

root@gpu:~# fstrim -v /
/: 194551808 bytes were trimmed

OLD: Updates to /etc/fstab

  • Activate TRIM by adding a "discard" option to the SSD file system mount line. Also add "noatime" for efficiency:
UUID=7b019be8-1708-40a1-b811-4fd138246dab / ext4 errors=remount-ro,noatime,nodiratime,discard 0 1
  • Mount /tmp directly in RAM:
tmpfs /tmp tmpfs noexec,defaults,noatime 0 0