brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: fstrim -av tells the SSD which blocks of the disk are free

Disk
~/tips/tip-disk-fstrim-av-ssd

sudo fstrim -av

Trims all mounted filesystems that support it, which keeps SSD write speed up.

An SSD stays fast when it knows which blocks no longer hold data. A weekly trim is enough for most machines.

sudo fstrim -av
systemctl status fstrim.timer

-a trims every mounted filesystem that supports it and -v prints how many bytes were passed down to the device. Ubuntu enables fstrim.timer by default, so check that before you add a cron job. A filesystem on a virtual disk or on some hardware RAID setups does not support trim, and with -a fstrim silently skips them, so no output for a mount can mean it was skipped.

Further reading: fstrim manual page

More Disk tips sudo e2freefrag /dev/sdb1 sudo smartctl -a --json /dev/sda | jq '.smart_status.passed' lsscsi -s udisksctl power-off -b /dev/sdX du -sh — .[!.]* * 2>/dev/null | sort -h All Disk tips (44) All topics

Link