There’s something about TRIM in LinuxMint or Ubuntu Linux

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.

vm.swappiness=20

:wq

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

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

Set browser.cache.memory.capacity
about:config
and change value from -1 to 1048576

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s