These are the steps I took to install and optimize my new SSD on my
Ubuntu 14.04 64 bit system. The / (root) and /home directories go to the
SSD. The rest go to the HDD, which is mounted in /media/Data/.Use EXT4 file systemSSDs work better with the ext4 files system, than with the NTFS.Enable TRIMThe TRIM command let an OS know which SSD blocks are not being used and can be cleared.Back up the fstab file, in case something goes wrong: # cp /etc/fstab ~/fstab.bk Edit the fstab file: #sudo gedit /etc/fstab Add the option "discard" after ext4 for all the SSD partitions (except swap): UUID=0ee549f0-1946-4136-8aa4-c5219a568981 / ext4 discard,errors=remount-ro 0 1 Adding noatime and nodiratimenoatime disables atime updates on file system while nodiratime disables atime updates on directory system. This reduces unnecessary writes to the SSD.Edit the fstab file: #sudo gedit /etc/fstab Add noatime,nodiratime after ext4 for all the SSD partitions (except swap): UUID=0ee549f0-1946-4136-8aa4-c5219a568981 / ext4 discard,noatime,nodiratime,errors=remount-ro 0 1 Make sure I have the option "defaults" for the HDD. This way I do not need root rights to write/delete on it. # /media/Data was on /dev/sdb1 during installation. 1TB HDD TMPFSI decided to use tmpfs (which practically creates a RAM disk) to store some temporary files. Once the system is restarted, everything in tmpfs will be gone. This however may cause a problem, if for example I want to edit a huge video file.These are some recommended settings to add at the end of /etc/fstab: # temporary directories Edit the fstab file: #sudo gedit /etc/fstab I decided to use only the following settings. I placed them at the end of /etc/fstab: # SSD optimization, send these temporary files to tmpfs /var/tmp holds temporary files to be preserved between reboots, so I decided to exclude it from tmpfs. About /var/spool and /var/lock, I decided not to risk it. I had some problem with HPLIP printing. So this is my final /etc/fstab file: # / was on /dev/sda1 during installation. SSD Disable hibernationHibernation will put a lot of writes to your SSD and is not desirable for SSD health. #sudo gedit /usr/share/polkit-1/actions/org.freedesktop.upower.policy Look for <allow_active>yes</allow_active>There are two instances, one for hibernation, and another one for suspend, so make sure you change the correct one. Change it from “yes” to “no”: <allow_active>no</allow_active> Move the Downloads, Videos, Pictures and Music directories to the HDDFrom terminal I run these commands to move the Downloads directory :mv Downloads /media/Data/Downloads Now if I run: ls -ld Downloads It should return: Downloads -> /media/Data/DownloadsI did the same for Videos, Pictures and Music directories. Set a low value for swappinessThe default swappiness value is 60, while the recommended value for desktop with lots of RAM is 10 (accepted values are 0-100). To reduce swap usage to the minimum, set it close to 1:gksudo gedit /etc/sysctl.confThen edit or add command: vm.swappiness = 3If you want to check the swappiness value of the system run: $ cat /proc/sys/vm/swappiness I/O SchedulerFor SSDs, the "noop" or the "deadline" I/O schedulers are recommended over the traditional CFQ. In Ubuntu 14.04 the default scheduler is the Deadline (in previous version the default was the CFQ). Still there is a recommended setting for the deadline/SSD combination that needs to be added into the /etc/rc.local file:echo 1 > /sys/block/sda/queue/iosched/fifo_batch So just to be safe, I defined the deadline scheduler for my sda SSD drive: sudo gedit /etc/rc.local Then I put the following lines before the exit 0. echo deadline > /sys/block/sda/queue/scheduler To check what is the active scheduler for a device (sdX) run this in a terminal: cat /sys/block/sdX/queue/scheduler In my system the result is: $ cat /sys/block/sda/queue/scheduler Move browser cache on the HDD Most tutorials recommend moving browser cache to RAM. This makes the browser super fast, but has the drawback that after reboot the cache is cleared, so the browser becomes slow again. I want to keep the cache, so I will move it to the HDD. This is the procedure to move the Firefox cache to the HDD:
BIOS/UEFI settingsMake sure the AHCI feature is activated for SATA (instead of IDE). |
|