SSD drives and Linux

Sandisk SSD

Here is what I’ve done on my laptop to ensure better longevity of my shiny new SSD. The idea is to minimize write unnecessary write actions on the drive to prolong it’s life. For this I’ve followed few different sources, with one of them being the most specific and prescriptive.

  1. Ensure that your drive is set to AHCI in your computer BIOS
  2. When installing, use ETX4 filesystem as it seems to be best for SSD support. This is a journaling filesystem which does incur some extra write but apparently not by much. It provides greater safety for your data, so it is worth just going with it.
  3. Disable “access time stamp” that the OS sets on files by default upon their access.
    • Open fstab file for editing (as a sudo). In Terminal type the following (you will be prompted for password once you hit Enter):
      gksu gedit /etc/fstab
    • Add noatime to each partition in that file except for swap and boot (the following is all one line):
      UUID=55ae6f33-5075-465a-b225-6f8a9d9787e7 /               ext4    noatime,errors=remount-ro 0       1
  4. Enable trim command to be executed upon system boot (good for laptops)
    • Open rc.local file for editing (as a sudo). In Terminal type the following (you will be prompted for password once you hit Enter):
      gksu gedit /etc/rc.local
    • Add fstrim command for each partition in that file except for swap and boot and make sure that you add these lines before exit 0:
      fstrim /
      fstrim /home
  5. Disable weekly trim action that is configured by the OS automatically by moving cron job configuration file:
    sudo mv -v /etc/cron.weekly/fstrim /fstrim.disabled_weekly_cron
  6. Limit swap partition wear:
    • Open sysctl.conf file for editing (as a sudo). In Terminal type the following (you will be prompted for password once you hit Enter):
      gksudo gedit /etc/sysctl.conf
    • Add the following line into the file:
      vm.swappiness=1
  7. Limit Firefox caching on disk
    • Open Advanced category of Firefox Preferences (accessed via Firefox menu)
    • Click on Network tab
    • Check “Override automatic cache management” in Cached Web Content section
    • Set “Limit” to 0
  8. Disable hibernation as that will write a lot of data on the drive every time you hibernate the computer. Maybe go without it if you can.

 

Leave a comment


Name*

Email(will not be published)*

Website

Your comment*

Submit Comment

 
© Copyright Alexander Yermakov. My life. - Designed by Pexeto