Installing an SSD on a Linux Box

If my i7 can't beat the Core2 apples to apples, I'll change the i7 to an orange. At least that's the plan. Adding an SSD should perk it up a little. I've spent a lot of time tuning this box and I don't want to reinstall, so I have to figure out how to do it without trashing the boot volume. I searched, and found this website explaining the process.

The SSD

Everything but the home directory occupied around 15 GB on the boot drive. A 90 GB drive would be more than adequate. I wanted the SandForce controller, so the Corsair Force3 seemed right. It has an advertised 500+ MB/S read and write throughput. Here is the process I went through. The link above is general terms, and my description is specific to my machine.

Preparing the SSD

First, remove all drives from the computer, and install the SSD, making sure it is plugged into a SATA III port. Removing the other drives gives one some confidence that Gparted won't be run on the wrong drive. I booted off of a Linux Mint 13 live DVD. I always have to add "noacpi noapic modeset" to the boot string by hitting tab on the "Boot from CD" option. It's a video thing. In GParted the drive was partitioned with two partitions - an ext4 for the system and a swap for the swap drive. That swap partition turned out not to be needed. Ext4 seems to be the recommended file system for SSD's.


poopster dallmon $ sudo blkid
/dev/sda1: UUID="930290ea-5a79-48fa-8845-e2b18340c57c" TYPE="ext4"
/dev/sda5: UUID="c275fa36-e108-4aa0-9aee-b6bee9e74fd2" TYPE="swap"
	

The UUID is recorded so the drive can be recognized later, and the machine powered down. The old system drive is reinstalled, and the machine booted again from the live DVD.

Moving data to the SSD

"sudo blkid" shows the drives again:


poopster dallmon $ sudo blkid
/dev/sda1: UUID="930290ea-5a79-48fa-8845-e2b18340c57c" TYPE="ext4"
/dev/sda5: UUID="c275fa36-e108-4aa0-9aee-b6bee9e74fd2" TYPE="swap"
/dev/sdb1: UUID="02e8e9a6-e883-40c1-bb73-3ce1308db0f0" TYPE="ext4"
/dev/sdb5: UUID="3520d1a2-a978-4bc9-a383-57b076833588" TYPE="swap"
	

Make two directories "/mnt/oldboot" and "/mnt/newboot" and mount the two volumes:


sudo mkdir /mnt/oldboot
sudo mkdir /mnt/newboot
sudo mount -t ext4 /dev/sdb1 /mnt/oldboot
sudo mount -t ext4 /dev/sda1 /mnt/newboot
	

You want to get the mounts right. You are copying from the old drive to the new drive. Use "cp".


sudo cp -afv /mnt/oldboot/* /mnt/newboot
	

Fix the SSD

Unmount the drives.


sudo umount /mnt/oldboot
sudo umount /mnt/newboot
	

You have to set the UUID's of the new drive to match those of the old drive.


sudo tune2fs -U 02e8e9a6-e883-40c1-bb73-3ce1308db0f0 /dev/sda1
sudo tune2fs -U 3520d1a2-a978-4bc9-a383-57b076833588 /dev/sda5
	

Now the two drives appear to be identical, software-wise. You will need to power off and remove the old drive, then boot again from the live DVD. When the machine comes back up...


sudo grub-install /dev/sda
sudo grub-update
	

Fix up /etc/fstab to reflect the new drive.


UUID=02e8e9a6-e883-40c1-bb73-3ce1308db0f0 /               ext4    defaults,noatime,discard 0       1
	

Reboot again and the thing comes up on the new SSD. Then you need to get some directories off of the SSD and put them on a hard drive. I have seen people say to put the /tmp, /var directories in RAM, but I need both, so I created a new volume on the WD 1TB drive and mounted it on /var. I left /tmp on the SSD for now. I'm not sure I want to keep it there, though.

Results

I ran some tests. First on the WD drive:

Then on the SSD drive:

SSD Update:

Here's something to consider if you try this. I thought the SSD performance was off - way off. I was getting 213 MB/s write and 294 MB/s read. Over and over I tested and always the same results. Then I read on a forum that you should use the "Intel port", meaning the one on the chipset, as opposed to the Marvell port. I switched the SSD to the P67's built in SATA3 controller and the performance jumped up into the 400's. Just something to keep in mind.