Glam Prestige Journal

Bright entertainment trends with youth appeal.

Do I need to change any settings of Ubuntu Gnome 17.04 to increase the lifespan of my samsung ssd drive? or is it optimized by default?

1

2 Answers

TRIM function for SSD has been enabled by default since Ubuntu 14.04. This is the major function to help increase the performance and life of your disk.

So, short answer is yes it is optimized, since TRIM is the major function you should worry about. Although you can always check another settings, see link below.

TRIM enables an operating system to notify the SSD of pages which no longer contain valid data. For a file deletion operation, the operating system will mark the files sectors as free for new data, then send a TRIM command to the SSD. After trimming, the SSD will not preserve any contents of the block when writing new data to a page of flash memory, resulting in less write amplification (fewer writes), higher write throughput (no need for a read-erase-modify sequence), thus increasing drive life.

Reference:

Trim- Wikipedia
How to optimize your Solid State Drive for Linux Mint 18.1, Ubuntu 16.04 and Debian

3

Given that TRIM is already enabled by default in Ubuntu, here are a few things I did on my workstations.

Install iostat

sudo apt install sysstat

It should give you an idea of how much writing you actuall do. Nominally the kB_wrtn/s column gives you an average since the last reboot. If you usually turn off the computer at the end of the day, take note of that number before shutting down.

Check the manufacturer of your SSD for a TWB estimate (Total Bytes Written until end of life).

If, for example, your SSD is expected to die after 100TB written, and you your daily average is 500Kb/s, the math should be quite simple. Convert Terbytes to Kilobytes, and:

100TB / (500Kb/s * 60s * 60m * 24h * 365d) = 13.9 years

If you are not playing games all the time or pumping heavy workloads, such as video editing, training neural networks for artificial intelligence, and things like that... Then you might be able to reduce that daily average of Kb/s.

Mount volatile directories as RAM disks

If you have enough RAM, you can map some common system directories as tmpfs in memory. Edit your /etc/fstab to something like:

## Disable atime in your SSD partition (noatime)
/dev/<SSD> / ext4 noatime,errors=remount-ro 0 1
## Mount your browser's cache to RAM
tmpfs /home/<USER>/.cache/mozilla tmpfs rw,nodev,nosuid,size=1G 0 0
## Mount tmp and log directories to RAM
tmpfs /var/log tmpfs defaults,noatime,mode=0755 0 0
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
tmpfs /var/tmp tmpfs defaults,noatime,mode=1777 0 0

Notes:

Performance gains are questionable, but noatime makes the OS stop writing the access time to every file in opens. For most people this will not be an issue. But if something stops working, consider not using this or using relatime. It should mostly affect older software that relied on atime. Common desktop users will not feel anything.

Remember that the content of these directories will be lost after every reboot. You may need to disable some of those mounts to persist log files and diagnose issue throughout reboots.

With broadband internet, nowadays, you won't notice a difference if your browser rebuilds its cache once in a while. Reconsider this if your internet has monthly or weekly caps, and you need to save on your data usage.

Decrease OS swappiness

Normally, the OS will start dumping things to SWAP when free RAM goes down to 60%. You can lower that bar to 15% or 10% by editing your /etc/systctl.conf:

vm.swappiness = 10

Reload before reboot with sudo sysctl -p

Results

My average was anywhere from 500Kb/s to 1Gb/s everyday. With these tweaks, I managed to cut that down to 100Kb/s or even 50Kb/s.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy