There’s something about TRIM in LinuxMint or Ubuntu Linux (Speed up SSDs)

Got a new PCIe NVMe SSD device? It starts lagging after a few months of use on Linux Mint and to optimize it, do the following after opening a terminal window

$ journalctl | grep fstrim.service <enter>
This will display when the TRIM was last executed. It normally does this once a week. Verify when the trim was last run.

How to execute TRIM manually
Close all files and applications then open a terminal window and run the following command.
$ sudo fstrim -av <enter>

It displays something like the below:
/home/user: 400 GiB (429544349696 bytes) trimmed on /home/user/abcde
/boot/efi: 503.2 MiB (527626240 bytes) trimmed on /dev/nvme0n1p1
/boot: 392.3 MiB (411348992 bytes) trimmed on /dev/nvme0n1p2
/: 0 B (0 bytes) trimmed on /dev/mapper/vg-root

How to reduce the need to swap in Linux when using SSD
$ sudo mousepad /etc/sysctl.conf <enter>

Add below lines at end of the file.



Start Firefox browser and optimize it to reduce read/writes to the SSD
Set browser.cache.disk.enable
and change value of above to true.

Set browser.cache.memory.enable
and change value of above to true.

Set browser.cache.memory.capacity
and change value from -1 to 1048576 in case of more RAM else, 524288 does fine on 8GB RAM system.

Set browser.sessionstore.interval
and change value from 15000 to 15000000