Kitz Forum

Computer Software => Linux => Topic started by: Bowdon on August 23, 2017, 12:25:51 PM

Title: Is there a simple guide to optimise linux for ssd?
Post by: Bowdon on August 23, 2017, 12:25:51 PM
I'm going to be testing Linux Mint soon on my old computer. I've been watching quite a few videos on how to install it.

When I install it on an ssd quite a few people on youtube keep mentioning about optimising it for ssd.

So my question is, does anyone have a clear and simple (very simple for me  ;D ) guide to optimise linux mint for ssd?
Title: Re: Is there a simple guide to optimise linux for ssd?
Post by: roseway on August 23, 2017, 12:44:16 PM
This is quite good: https://wiki.archlinux.org/index.php/Solid_State_Drives
Title: Re: Is there a simple guide to optimise linux for ssd?
Post by: roseway on August 25, 2017, 08:18:51 AM
I found this useful guide to setting up trim on a recent Debian system, and it will very likely work on an Ubuntu-based system such as Mint. I've done this on my Debian Stretch system, and it all worked fine.

Quote
Command to trim an SSD:

sudo fstrim --all (or sudo fstrim -a)

Returns 0 (success), 32 (all failed) or 64 (some failed)

Commands to enable automatic trim:

A systemd .timer that will automatically run `fstrim -a` every week can be enabled in Debian with these commands:
sudo apt install util-linux
sudo cp /usr/share/doc/util-linux/examples/fstrim.{service,timer} /etc/systemd/system
sudo systemctl enable fstrim.timer
sudo systemctl start fstrim.timer

Check the status of the .timer with:
sudo systemctl list-timers

Stop the .timer from running automatically with:
sudo systemctl disable fstrim.timer

Read `man systemctl` & `man systemd.timer` for more on this.
Title: Re: Is there a simple guide to optimise linux for ssd?
Post by: Chrysalis on August 25, 2017, 09:35:08 AM
a modern version of linux should do the 4k alignment for you, the only thing left is to mount with the discard flag which is needed for trim. :)
Title: Re: Is there a simple guide to optimise linux for ssd?
Post by: roseway on August 25, 2017, 10:31:20 AM
Some SSD drives have problems with continuous trim (the discard flag), and it's widely recommended to use periodic trim instead, as described in my reply number 2 above. This is discussed in the Arch Linux article I linked to earlier.
Title: Re: Is there a simple guide to optimise linux for ssd?
Post by: Chrysalis on August 25, 2017, 11:59:57 AM
thanks for clarifying eric :)

just had a quick look at the article you posted and learnt something new, it explains why discard was never added as a default flag. :)
Title: Re: Is there a simple guide to optimise linux for ssd?
Post by: roseway on August 25, 2017, 12:27:46 PM
Yes, the Arch Linux documentation is very good.
Title: Re: Is there a simple guide to optimise linux for ssd?
Post by: parkdale on August 25, 2017, 06:33:54 PM
In Ubuntu 16.04 and in Linux Mint 18.x automatic TRIM is enabled by default, when you install Ubuntu 16.04 or Linux Mint 18.x on an SSD. Namely by a weekly "cron job".