Roads Less Taken

A blend of programming, boats and life.

New SSD for My Lenovo X220

| Comments

After the conundrum with my Intel 320 SSD I did some googling and decided to invest a fair chunk of money in a really good SSD - the Samsung 840 Pro, 512GB. The 840 Pro seems to be the king of the hill right now and it’s only 7mm thick which is what I need for my X220 (although people have shoved 9mm drives into it with a bit of force).

The actual replacement was trivial, one normal screw to remove the lid on the side, pull out the old disk, move the plastic rails over to the new disk (just pull off and slide onto the new drive), add a piece of tape as a pull handle (to make it easy to remove) and slide it in. If it doesn’t want to go in you need to flip the rails.

Reboot, go into BIOS and make sure AHCI is selected for SATA and off to happy land. I installed Ubuntu 12.10 from a USB stick and just let it do the automatic thing. This creates a swap partition on the SSD, but that is fine with me - I adjust the swappiness instead to make sure it is only used when really needed.

You can test performance to make sure all looks ok:

hdparm -tT /dev/sda

…or whatever /dev you have. I get around 7000MB/sec for cached reads and 515 MB/sec for buffered reads.

In /etc/fstab I added the options “noatime,nodiratime,discard”. The “nodiratime” is not really necessary since it is implied by noatime. This makes Linux not update access time on files which in turn reduces write operations a lot which prolongs the life of the SSD and increases performance.

The “discard” option is to make sure we enable TRIM on the disk. I just followed this article (and this other) describing it and how to test it works. Another good page on AskUbuntu. Some people say that the test in that article is not reliable, but still, if you do get zeroes then you can rest assured it works. :)

Next up is setting down swappiness, changing to a disk scheduler more suitable for an SSD and setting /tmp up using tmpfs in RAM. I will not repeat all this - instead I offer some links to good instructions at Tombuntu or in the ArchLinux wiki or this one going even deeper.

Rergarding partition alignment - I read that it should be automatic so I didn’t bother looking into that.