Installing a new boot SSD on Ubuntu
Before beginning I downloaded an iso for RedoBackup and created a bootable CD. I booted that my system with that CD and backed up my two Ubuntu partitions to a USB drive.
Then I opened up my case and added my new SSD as a second drive on my system and formatted it with Gparted. To get the alignment right I did two things:
- Unchecked the box that says “align to cylinders”
- Left 1MB of free space *before* the new partition. This results in an offset of exactly 2^20 bytes or 2048 512B disk sectors, which is excellent alignment for virtually all applications, SSD types, RAID array stripe sizes, etc.
Then I created two partitions one for the root file system and the second for home. I made both just slightly larger than the corresponding partitions on my current system disk. Note I did not create a swap partition, I put that on a spare hard disk to minimize wear on the SSD. Finally I set the boot flag on the root partition.
Next I rebooted to a Clonezilla cd and copied my root and home partitions to the new SSD. That left to almost ready to boot. All that remained was to install Grub2 and editing /etc/fstab. Both these steps were accomplished using a Ubuntu Live CD.
I installed grub following the steps in an earlier post. Then, still in the Live CD I opened the root of my new ssd from the Places menu. Right clicking in the window, I opened Properties which showed the UUID of the partition. The partition is mounted under /media/UUID. So I selected the UUID i needed with the mouse and copied it to the clipboard (CTRL C). Then I opened a terminal and:
cd /media/(CTRL v to paste the UUID I needed)
gksudo gedit ./etc/fstab
# /etc/fstab: static file system information.
# Use ‘blkid -o value -s UUID’ to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
proc /proc proc nodev,noexec,nosuid 0 0
#the following is my root partition which is /dev/sda1
UUID=the-UUID-of-my-root-partition / ext4 noatime,discard,errors=remount-ro 0 1
#The following is my swap partition on a regular hard disk
/dev/sdb2 none swap sw 0 0
#The following is my home partition on sda2
UUID=the-UUID-of-my-home-partition /home ext4 noatime,discard,defaults,user_xattr 0 2
# This is a partition on my hard disk sdb1 which I use because my new ssd is only 96gb
/dev/sdb1 /media/secondhome ext4 defaults 0 3
I saved the file and at that point I rebooted into my SSD. Not you might also want to move your temporary files from the ssd to memory. Alternatively you could move them to the regular hard disk but that would slow your system a bit.
What remained was to temporarily enable the backports repository and install the Maverick kernel backport that supports TRIM, which the Lucid kernel does not.
Select Settings/repositories Select the Updates tab Tick the box marked Unsupported updates (lucid-backports) Then click Close and Reload to update your package list
In the search box enter
Install the package
Finally I disabled the backports repository and rebooted.
Add either “elevator=noop” or “elevator=deadline” to grub2.
the line that starts “GRUB_CMDLINE_LINUX_DEFAULT” of /etc/default/grub,
gksudo gedit /etc/default/grub
Find the line:
and change it to:
GRUB_CMDLINE_LINUX_DEFAULT=”elevator=deadline quiet splash”
then run save and exit gedit. Run