SSD installation checklist
IMPORTANT NOTE: This document was initially written around November 2010 when SSD support was still considered recent in GNU/Linux distributions and Ubuntu in general. Be careful when deciding to apply any of the information it contains.
A few assumptions are made in this list:
/dev/sda is your SSD device
- Performance is preferred to reliability. Therefore, you backup regularly or use this for non-critical (even expendable) data.
- You already have a backup of any important data (can't stress this enough).
If you contribute something to this list, please make sure whatever it is has a justification, explanation, reference, or all three.
Check for firmware upgrades for your drive and apply any pending.
$ sudo hdparm -I /dev/sda | grep Firmware
Firmware Revision: 2CV102M3
Bugs #663349 and #672764 have been filed about lshw and udev, mark those as affecting you if you wish so. Once you know your firmware version, go to your manufacturer's site:
- Boot from a Live CD
Find out your hard disk information with sudo fdisk -l /dev/sda | grep sectors. Example output:
255 heads, 63 sectors/track, 4865 cylinders
Partition & format your disk aligning the partition blocksize to the SSD erase block size, with the above information (1 partition, no swap, no journaling ext4):
sudo fdisk -H 255 -S 63 /dev/sda
sudo mke2fs -t ext4 -O ^has_journal /dev/sda1
Warning: formatting without journaling will increase chances of data loss. Use with caution. Omit the -O ^has_journal option otherwise. The Linux Documentation Project has complete information about fdisk partitioning.
Make sure SATA AHCI mode is enabled in BIOS. See SATA AHCI Mode Bios Setting. What Does it do?
- Reboot the the Alternate Ubuntu installer CD, install normally - use manual partitioning though, mounting / to your single partition, accepting warnings about swap not being present.
- Kernel boot options:
- Change the I/O scheduler to NOOP:
If you only have one disk and it is SSD, and don't use external storage often, just add elevator=noop to your kernel boot parameters in /etc/default/grub (append to GRUB_CMDLINE_LINUX_DEFAULT). This is also OK if you occasionally use USB sticks.
If you have several disks or a mix of SSD and mechanical disks, install the sysfsutils package and add the following line at the end of /etc/sysfs.conf:
block/sda/queue/scheduler = noop
To change the scheduler without rebooting:
sudo echo noop > /sys/block/sda/queue/scheduler
- Change the I/O scheduler to NOOP:
- Disk mounting options (in /etc/fstab):
Example mounting line:
UUID=41b6b187-be76-4447-b18b-d39cc744b184 / ext4 noatime,discard,data=writeback,errors=remount-ro 0 1
Add the noatime mounting option. The default is relatime which adds write operations to set the Last Accessed Time attribute to files.
Add the discard mounting option. This controls whether ext4 should issue discard/TRIM commands to the underlying block device when blocks are freed. This is useful for SSD devices and sparse/thinly-provisioned LUNs, but it is off by default until sufficient testing has been done.
Add the data=writeback mounting option if you formatted the disk without journaling. Otherwise add data=ordered which sould be a good compromise between full journaling and none at all. See Ext4 Filesystem documentation for more details.
- Mount /tmp in ram
Use the following line in /etc/fstab and reboot:
tmpfs /tmp tmpfs nodev,nosuid,noexec,mode=1777 0 0
Rationale: In the past when SSD controllers had bad wear leveling and limited amounts of writes, mounting anything that was often wrote to (like /tmp) was a good idea. Nowadays it helps with performance but also as some caveats.
- Put the Firefox cache in /tmp (which is in RAM)
Type about:config in the location bar
Find/create this key: browser.cache.disk.parent_directory. Set it to /tmp
Verify the cache location information in about:cache
- Placing your browser cache in /tmp, and mounting /tmp in RAM is a sure boost to page rendering.
- Do only with at least 4Gb of RAM
- Watch for GUI apps (disc burners etc) writing large files to /tmp
- In multi-user systems if other users are logged in they will have access to your temporary files in /tmp
http://www.linuxhowtos.org/System/iosched.htm - including information on how to change the I/O scheduler at runtime