What SSD optimization are needed on latest Ubuntu version?
The thing is , first most important part about SSDs is minimizing the writes to the disk, which is why people add nodiratime
, noatime
to the /etc/fstab
file.
Second , is running TRIM
which reclaims unused blocks of NAND memory back to SSD. Windows has TRIM enabled by default, AFAIK, so no one bothers there. With Ubuntu, it does have a weekly cronjob for TRIM, however for I've learned from Rinzwind's answer that the cron job only runs on Intel and Samsung SSDs. That's why you have to edit that /etc/cron.weekly/fstrim
file to have exec fstrim-all --no-model-check
line, so that it runs no matter what is your SSD model.
Over the recent years, this has not changed - these are still key points , minimizing writes and enabling TRIM.
Removing writes and expensive storage amount is the two factors why people also remove swap area. By default, Ubuntu creates swap partition equal to your RAM size. I have a 128 SSD and 6 GB of RAM. That means that by default Ubuntu will chop off 6 GB from 128GB, leaving 122GB for my OS, and 5% is typically reserved for root, so that leaves me 122-122*0.05=115.9 GB for myself. I might as well use that storage for something else, which is why I have only one main partition, no swap partition, but I do have a 512 MB swap file as a protective feature (not that I plan on running out of RAM, but it's always recommended to have swap)
The only thing you may need to do is to add --no-model-check
to /etc/cron.weekly/fstrim
.
The line should look this way
exec fstrim-all --no-model-check
Check that your SSD supports TRIM (almost all recent models do) by
sudo hdparm -I /dev/sda | grep "TRIM supported"
if your SSD is /dev/sda
. If it does, add --no-model-check
.
It works fine with SSD which supports TRIM
for 16.04 there is no
fstrim-all
simple fstrim does not have
--no-model-check
and it works fine with sandisk ssd