You are not logged in.
I have read Arch wiki recently and found a topic:
SSD TRIM
After more research I've found antother topic:
Btrfs Ready For Linux 5.6 With Async Discard For Better Efficiency + Performance
I use btrfs and I have fstrim.timer enabled
1. Can I change fstab mount options on installed system? (I know I can but is this advisable?)
2. Can / should I disable fstrim.timer and enable discard=async in fstab?
3. If such a change is possible then should I balance file system or will it work after system reboot?
4. I have 1TB nvme drive. I couldn't find information if this change will be better for drive like this.
Last edited by 860lacov (2021-05-18 06:26:05)
Offline
I can see 'discard' being seriously better than fstrim.timer if you write (and delete) hundreds of GB every week on your 1TB drive. With the fstrim.timer service, the drive only gets the free space back once a week.
Here's some more thoughts:
(1) Yes, changing fstab is okay.
(2) You need to decide yourself if you should do this. I don't think there's a way to be 100% confident about this change.
(3) You don't need to do anything after enabling 'discard'. Do not balance because of this change.
(4) With the 'discard' mount option, the TRIM commands are done immediately when you delete data. The drive gets the free space back immediately. With the 'fstrim.timer' service, the TRIM commands are done once a week. There will be several days before the drive gets the free space back when you delete data. If you write hundreds of GB to this drive every week, using 'discard' would be better for the drive. If you just write a few dozen GB per week, using 'fstrim.timer' is good.
If you happen to already know that your drive can use 'discard' without causing corruption and you didn't like the old 'discard' because it was slow on your drive, then this new 'discard=async' now fixes that performance problem.
The way I did things here personally is that I always enabled 'discard' when I got a new drive. I then checked with btrfs-scrub daily for a while to see if errors show up. All SSD drives I had seemed fine with using 'discard'. I also could never feel performance issues like people reported online. I then kept using 'discard' with the drive and never switched the setup to fstrim.timer.
With a drive that never was tested with 'discard' and that's right now in use for serious work, I would hesitate a little. Personally, I would try 'discard' but I would only start the experiment in a week where I know I wouldn't feel stressed if something terrible happens. I have good backups.
Offline
I can see 'discard' being seriously better than fstrim.timer if you write (and delete) hundreds of GB every week on your 1TB drive. With the fstrim.timer service, the drive only gets the free space back once a week.
(4) With the 'discard' mount option, the TRIM commands are done immediately when you delete data. The drive gets the free space back immediately. With the 'fstrim.timer' service, the TRIM commands are done once a week. There will be several days before the drive gets the free space back when you delete data. If you write hundreds of GB to this drive every week, using 'discard' would be better for the drive. If you just write a few dozen GB per week, using 'fstrim.timer' is good.
If you happen to already know that your drive can use 'discard' without causing corruption and you didn't like the old 'discard' because it was slow on your drive, then this new 'discard=async' now fixes that performance problem.
The way I did things here personally is that I always enabled 'discard' when I got a new drive. I then checked with btrfs-scrub daily for a while to see if errors show up. All SSD drives I had seemed fine with using 'discard'. I also could never feel performance issues like people reported online. I then kept using 'discard' with the drive and never switched the setup to fstrim.timer.
With a drive that never was tested with 'discard' and that's right now in use for serious work, I would hesitate a little. Personally, I would try 'discard' but I would only start the experiment in a week where I know I wouldn't feel stressed if something terrible happens. I have good backups.
Thanks.
Drive is Samsung 980 Pro. It's not under heavy workloads during the week so I'll probably stay with
fstrim.timerI asked because I thought that discard=async is new for btrfs (especially async parameter) is something new for btrfs and maybe better than fstrim.
But...
Offline