Fstrim.timer or discard=async on btrfs-SSD (root.Partition only)

This is my /etc/fstab:

UUID=E6DE-3AD7                              /boot/efi    vfat    umask=0077 0 2
UUID=ad93372f-89de-4719-ba29-f9ff18128859   /            btrfs   subvol=/@,defaults,discard=async,noatime,compress=zstd:3 0 0
UUID=ad93372f-89de-4719-ba29-f9ff18128859   /home        btrfs   subvol=/@home,defaults,discard=async,noatime,compress=zstd:3 0 0
UUID=ad93372f-89de-4719-ba29-f9ff18128859   /var/cache   btrfs   subvol=/@cache,defaults,discard=async,noatime,compress=zstd:3 0 0
UUID=ad93372f-89de-4719-ba29-f9ff18128859   /var/log     btrfs   subvol=/@log,defaults,discard=async,noatime,compress=zstd:3 0 0
UUID=ad93372f-89de-4719-ba29-f9ff18128859   /swap        btrfs   subvol=/@swap,defaults,discard=async,noatime,compress=zstd:3 0 0
/swap/swapfile                               swap        swap    defaults,noatime 0 0
tmpfs                                       /tmp         tmpfs   defaults,noatime,mode=1777 0 0

I took the hint about continuous trimming using discard=async from the Arch wiki. It sounds sensible to me, but since I don’t know enough about Btrfs yet, I have a bad feeling about the effects on the lifespan of my SSD. The SSD with Btrfs does not contain any important data (are on Xfs-HDD, will be integrated into the fstab), but only the system itself. I have now activated discard=async and deactivated the fstrim.timer on a trial basis. What do you think, can it stay like this?

discard=async is the default. You don’t need to set it in /etc/fstab

That being said, it won’t hurt anything to add it.

1 Like

And deactivate fstrim.timer? That would be redundant, wouldn’t it?

You can if all your filesystems are btrfs.

Only the subvolumes, as seen in my fstab, are btrfs.

UUID=E6DE-3AD7                              /boot/efi    vfat    umask=0077 0 2
UUID=ad93372f-89de-4719-ba29-f9ff18128859   /            btrfs   subvol=/@,defaults,discard=async,noatime,compress=zstd:3 0 0
UUID=ad93372f-89de-4719-ba29-f9ff18128859   /home        btrfs   subvol=/@home,defaults,discard=async,noatime,compress=zstd:3 0 0
UUID=ad93372f-89de-4719-ba29-f9ff18128859   /var/cache   btrfs   subvol=/@cache,defaults,discard=async,noatime,compress=zstd:3 0 0
UUID=ad93372f-89de-4719-ba29-f9ff18128859   /var/log     btrfs   subvol=/@log,defaults,discard=async,noatime,compress=zstd:3 0 0
UUID=ad93372f-89de-4719-ba29-f9ff18128859   /swap        btrfs   subvol=/@swap,defaults,discard=async,noatime,compress=zstd:3 0 0
/swap/swapfile                               swap        swap    defaults,noatime 0 0
tmpfs                                       /tmp         tmpfs   defaults,noatime,mode=1777 0 0

Then there is this line:

UUID=d69fb88d-2a9b-408d-8d04-e2dcfabbdd1b   /mnt/data    xfs     defaults,noatime 0 2

It won’t hurt anything to leave the timer in place for your other filesystems.

An extra periodic trim is not a big deal either way.

1 Like

many thanks @dalto :+1:

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.