Welcome @mil
Heh.
Yeah! But seeing that with my own eyes was awesome!
And sharing the experience
I agree, this is exactly what we were told all these years so I do not see how btrfs will need defraging on ssds.
Additionally in the manual it says:
autodefrag, noautodefrag
(since: 3.0, default: off)
which is even more strange, so if the default is off, why does the installer defaults to enabling it on ssds.
Ah man. I was blissfully unaware of all this. I have to admit I donât really monitor my stats unless something is obviously upâŚmaybe thatâs something I should do more often?
I have no idea whether the impact of this for me was as catastrophic as the Reddit poster implies it can be, but I had a look at my SSD with smartctl. For some reason I couldnât get the Total Bytes Written value (TBW), so I had to convert the âTotal LBAs Writtenâ value via a calculator.
Commands I needed to get data for the calculation:
sudo smartctl -A /dev/sdX --all | grep "Sector Size"
sudo smartctl -A /dev/sdX --all | grep "Total_LBAs_Written"
Looks like Iâm at at 60.65 TB. Had this drive for aroundâŚI donât knowâŚ5 years? Donât know if thatâs good or bad. My SSDâs warranty covers 150TB for this model (250GB) so it looks like it should be alright for a while yet.
Calamares, the installer we use doesnât have the option to specify HDD-only options so there isnât currently a way to say enable that option on HDDs but not SSDs. That functionality has been built and should be available in a future release.
Thanks that is good to know. The reason I was questioning the âwisdomâ of the installer is just in case âit knows something more than I doâ and I shouldnât argue with its decisions. Obviously that is not that case, so I am fine with removing autodefrag from the fstab config
Well, to get a more concrete baseline, Iâm now running 5.16 again, but without the autodefrag option, and it seems a lot better than running LTS with the autodefrag enabled.
If defrag for SSD is âcontroversialâ, I personally suggest users that are using SSD to remove that option completely, or to set the noautodefrag option instead. But Iâm no specialist, this is just my observation.
Maybe Arch News?
I never digged into how this works and who maintains it.
On my newest drive - SanDisk SDSSDH3 2T00 - smartctl
uses the label "Total_Writes_GiB` instead of âTotal_LBAs_Writtenâ.
There is something wrong with my smartclâŚ
Total_LBAs_Written 0x0032 100 100 000 Old_age Always - 50378
Error 52032 occurred at disk power-on lifetime: 38473 hours (1603 days + 1 hours)
This is not possible, 4,3 years and only that LBAs_Written?
My SanDisk SDSSDH3512G, which is at least 3 years old now, is sitting at 16419. Itâs been my main OS drive - Linux and Windows/Linux - since I bought it. Now my data drive (20 months old) is at 62993; to be expected, certainly.
uow, so my drive will probably die due to lifespan than to writing cyclesâŚ
SSD technology has come a long way in a relatively short period of time.
Btrfs was rewritted for this kernel series ,
there is still patches coming for btrfs
see https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.16.3
and find Btrfs âŚ
Fixes for this hit 5.16.5-rc; they are coming.
I can reproduce this issue with option autodefrag
, but not with options autodefrag,ssd
.
In my case, multiple Gigabytes were silently written per minute, so this is definitely a very serious issue.
Removing autodefrag
solved it, but adding ssd
seems to do it as well for me.
Iâm using a SATA SSD.
Is someone absolutely sure that autodefrag,ssd
caused the issue for them?
I confirmed the issue by looking at smart data changes.
btrfs autodetects ssd
even if you donât set it explicitly.
It says so, but does it?
Then @damian101 confirm itâs not an illusion, please.
When testing btrfs options, check active flags with
mount | grep btrfs
The ssd
mount option is indeed set automatically, so my assumption that it fixes the issue makes no sense. @dalto
For some reason I canât reproduce the issue anymore, but it definitely was there. Multiple gigabytes were written to my SSD per minute, while the system monitor showed no such write activity for any process.
Before I rebooted with autodefrag enabled I had not used defrag on my SSD ever, maybe that plays a role. Perhaps defragmentation has to be triggered for the issue to appear. That would be my guess. The ssd
mount option making a difference was very likely just a false assumption on my part.