Enable weekly trim (not needed on buster)
But on a test installation of Buster on a 120 GB SSD I don't see fstrim active.
Found no further info ....
Enable weekly trim (not needed on buster)
# apt install util-linux
# systemctl enable --now fstrim.timer
systemctl list-timers
kalle123 wrote:But that is contrary to what that wiki article says
Head_on_a_Stick wrote:kalle123 wrote:But that is contrary to what that wiki article says
That wiki page is full of dubious advice. For example, there hasn't been any need to reduce writes to the SSD for a while now because drive longevity is greatly improved compared to the early production models.
kalle123 wrote:Different wiki pages give different information
Head_on_a_Stick wrote:FWIW, just treat the SSD as if it were a spinning rust drive, they don't need any special treatment.
p.H wrote:What about TRIM
p.H wrote:defragmentation
p.H wrote:proper alignment
$ sudo parted /dev/sda align-check opt
Partitionnumber? 1
1 aligned
- Add the "noatime"
(or "relatime") mount option in /etc/fstab, to disable (or significantly reduce) disk writes whenever a file is read.
$ sudo cp /usr/share/doc/util-linux/examples/fstrim.{service,timer} /etc/systemd/system
$ sudo systemctl enable fstrim.timer
$ systemctl status fstrim.timer
View fstrim.timer status:
$ systemctl status fstrim.timer
● fstrim.timer - Discard unused blocks once a week
Loaded: loaded (/lib/systemd/system/fstrim.timer; enabled; vendor preset: enabled)
Active: active (waiting) since Thu 2018-07-05 05:45:11 BST; 4h 42min ago
Trigger: Mon 2018-07-09 00:00:00 BST; 3 days left
Docs: man:fstrim
Start/Stop/Restart fstrim.timer:
(immediate activate/deactivate/reactivate, does not change startup status)
$ sudo systemctl [start/stop/restart] fstrim.timer
Enable/Disable fstrim.timer:
(add to/remove from startup, does not change immediate active status)
$ sudo systemctl [enable/disable] fstrim.timer
View fstrim.timer configuration:
$ systemctl cat fstrim.timer
# /lib/systemd/system/fstrim.timer
[Unit]
Description=Discard unused blocks once a week
Documentation=man:fstrim
[Timer]
OnCalendar=weekly
AccuracySec=1h
Persistent=true
[Install]
WantedBy=timers.target
View fstrim.service configuration:
$ systemctl cat fstrim.service
# /lib/systemd/system/fstrim.service
[Unit]
Description=Discard unused blocks
[Service]
Type=oneshot
ExecStart=/sbin/fstrim -av
View related systemd journal entries:
$ journalctl -u fstrim.timer
Jul 04 14:18:41 user-laptop systemd[1]: Started Discard unused blocks once a week.
Jul 04 21:59:26 user-laptop systemd[1]: Stopped Discard unused blocks once a week.
etc...
$ journalctl -u fstrim.service
Jun 25 10:59:44 user-laptop systemd[1]: Starting Discard unused blocks...
Jun 25 10:59:48 user-laptop fstrim[955]: /: 92.5 GiB (99335237632 bytes) trimmed
Jun 25 10:59:48 user-laptop systemd[1]: Started Discard unused blocks.
-- Reboot --
Jul 02 04:27:41 user-laptop systemd[1]: Starting Discard unused blocks...
Jul 02 04:27:46 user-laptop fstrim[1032]: /: 92.3 GiB (99150807040 bytes) trimmed
Jul 02 04:27:46 user-laptop systemd[1]: Started Discard unused blocks.
etc...
$ grep . /sys/block/sd?/queue/rotational
/sys/block/sda/queue/rotational:1
/sys/block/sdb/queue/rotational:1
/sys/block/sdc/queue/rotational:0 <=== Only this is SSD!
# echo deadline > /sys/block/$YOURDRIVE/queue/scheduler
$ grep . /sys/block/sd?/queue/scheduler
/sys/block/sda/queue/scheduler:noop deadline [cfq]
/sys/block/sdb/queue/scheduler:noop deadline [cfq]
/sys/block/sdc/queue/scheduler:noop [deadline] cfq <== That is!
kalle123 wrote:- Add the "noatime"
kalle123 wrote:On https://wiki.debian.org/SSDOptimization I find this noteEnable weekly trim (not needed on buster)
But on a test installation of Buster on a 120 GB SSD I don't see fstrim active.
Found no further info ....
util-linux (2.32.1-0.2) unstable; urgency=medium
... * debian/util-linux.README.Debian: Add information about the fstrim.timer
bw123 wrote:The wiki might be referring to the fact that fstrim.timer does not have to be copied manually from /usr/share/doc/util-linux/examples
Users browsing this forum: No registered users and 6 guests