I have 3TB as the main active storage on my workstation, across two SSD’s, now I know that defraging and SSD has no point, in fact just adds additional wear and tear. I was wondering should I be doing any maintenance to my file systems /root /home /.snapshot, on the SSD’s. they have been working for three years now with no problems or errors but just wondered what others thought
Set up fstrim to run once a week or so and scrub your disks periodically. It will not fix any errors unless you have a RAID but it will still tell you if there are any corrupted blocks. If you delete large blocks of data you might want to rebalance every now and then. You really shouldn’t need to do maintenance on a filesystem.
I’d mostly focus on scrub, but I’ll also recommend that you keep an eye on your unallocated blocks, running out of them can get you into out-of-space situations that are non-trivial to fix. My general recommendation is about 5G per device, that should give it enough breathing room that it won’t
-ENOSPC
on most workloads. Also, please note that unallocated space is a subset of free space, that is, all unallocated space is free space but the inverse isn’t true.Getting more unallocated space is as easy as running a balance with a filter, say “
btrfs balance start -dusage=10 /mountpoint
”. Just don’t balance metadata unless you want to convert it.Regarding defrag, I still defrag databases, system journal files, etc, even on SSDs. Those workloads tend to cause a lot of fragmentation that can impact your performance (try reading your
journalctl
logs before and after a defrag, as an example).