? releases deleted space to the
https://easylinuxtipsproject.blogspot.com/p/ssd.html
TRIM an SSD in Linux
https://kb.plugable.com/data-storage/trim-an-ssd-in-linux
cat
sudo mkdir -v /etc/systemd/system/fstrim.timer.d
You can switch your system to automatic daily trimming as follows:
a. Copy/paste the following command line into the terminal, in order to create a new folder:
sudo mkdir -v /etc/systemd/system/fstrim.timer.d
Press Enter. Type your password when prompted. In Ubuntu this remains entirely invisible, not even dots will show when you type it, that’s normal. In Mint this has changed: you’ll see asterisks when you type. Press Enter again.
b. Copy/paste the following command line into the terminal, in order to create a new file in that new folder:
sudo touch /etc/systemd/system/fstrim.timer.d/override.conf
Press Enter.
c. Copy/paste the following command line into the terminal, in order to edit the new file:
xed admin:///etc/systemd/system/fstrim.timer.d/override.conf
(Note: the three consecutive slashes aren’t a typo, but intentional! For Ubuntu: type gedit instead of xed.)
Press Enter.
d. Now copy/paste this blue text into that empty text document:
[Timer]
OnCalendar=
OnCalendar=daily
Note: the double entry for OnCalendar is no mistake but intentional!
Save the modified file and close it.
e. Reboot your computer.
f. Confirm that you’ve successfully edited trim’s configuration by executing this terminal command:
systemctl cat fstrim.timer
Your output should look approximately like this:
/lib/systemd/system/fstrim.timer
[Unit]
Description=Discard unused blocks once a week
Documentation=man:fstrim
ConditionVirtualization=!container
[Timer]
OnCalendar=weekly
AccuracySec=1h
Persistent=true
[Install]
WantedBy=timers.target
/etc/systemd/system/fstrim.timer.d/override.conf
[Timer]
OnCalendar=
OnCalendar=daily
Let’s take a look at this output. The first part shows the default setting (weekly), the second part shows the overriding setting that you’ve applied. That overriding setting contains two elements: first the existing OnCalendar setting (weekly) is being deleted, and then a new OnCalendar setting is being applied (daily).
If you ever want to check whether fstrim has actually happened, and when it happened, you can use this terminal command:
journalctl | grep fstrim.service
If you’re done with this step, you can continue with item 8.
How to undo (back to a weekly job)
6.1. Want to undo? It’s easy to change the daily job back to a weekly job, namely as follows:
a. Copy/paste the following command line into the terminal, in order to remove the overriding settings:
sudo rm -v /etc/systemd/system/fstrim.timer.d/override.conf
Press Enter. Type your password when prompted. In Ubuntu this remains entirely invisible, not even dots will show when you type it, that’s normal. In Mint this has changed: you’ll see asterisks when you type. Press Enter again.
b. Reboot your computer.