My installation is a few months old, maybe 4 months.
Decided to run the first defrag yesterday, but before I checked the disk usage, it was about 21GB.
After the defrag, noticed that the space used increased to 26GB.
Since the info above is specifically saying about “break” links, I decided to test my system and everything was working perfectly.
In my opinion, which could be premature and with little knowledge about the technical stuff, is that these links that “break” are only for the snapshots, but they still work, they just consume more space after the defrag.
Decided then to erase my snapshots and my system is now using 16GB of space…
See, I’m taking snapshots from /, which allows me to recover my system, to boot into snapshots and etc.
So, assuming that every user also takes snapshots from / so they can be able to perform the tasks above, and the fragmented data is located in / which contains the system, how not to defrag / ?
The autodefrag was the default in the previous EnOS installation (calamares)
However there was a regression with that option in kernel as per image below.
Since then I decided not to use it anymore…
Also, keep in mind that if you monitor the disk usage by typing: iotop -a, you will see that btrfs is writing to the disk more often with the autodefrag option.
Yes. I know the topic. As far as I know it has been fixed long ago.
I haven’t noticed a noticeable difference on my machine when I’ve looked into it with iotop.
I don’t run torrents on btrfs file system, it may be one reason why usage is not rising.
But I noticed several gigabytes of writing with the iostat program (before and after) the defrag command.
A bit off-topic but related to btrfs and mounting.
I use to mount the root of a btrfs partition into a directory in order to being able to browse all the contained subvolumes like you would with “regular” directories. I use the following line:
sudo mount -t btrfs /dev/nvme0n1p2 /btrfs
I wonder if (some of) the mount options for mounting subvolumes should be applied here as well. Or any others?
If you use the same options on all your subvolumes, you should use those options there as well. It may or may not make much difference depending on how you use that mountpoint.
Many of the btrfs options actually apply to all subvolumes of the same filesystem. For example, if you look at findmnt /btrfs you will probably see that compression and some other options are being applied to it even though you didn’t specify them explicitly.
If you want to explicitly mount the root you should probably use subvolid=5. What you are currently doing is mounting the default subvolume which is currently set to /. If you ever changed the default subvolume, what you have mounted there would change too.
Well, honestly I am not that techie, but I will just make a suggestion (taking the title of the topic). I hope BTRFS developers would consider.
The unfamous problem of BTRFS and Baloo always indexing snapshots. There are a few bugs filed with Baloo.
My question/suggestion is:
Why not let BTRFS give the user the option that BTRFS takes snapshots of only the file system not ‘/home’ to avoid that problem.
I am not that techie and I do not know if there is a way to avoid reindexing each snapshot of “/home”
This is the only thing preventing me from using BTRFS though I would love to. (some of my posts when I was on EOS a few months ago shows the hell of Baloo indexing all the time)
Sorry if I interrupted. I am just posting this because I love the concept of BTRFS and snapshots, while I love Baloo as I have lots of papers, research… books), but I can’t have them both!
Honestly I can’t tell if such issue should be filed as a bug with Baloo or with BTRFS, or both should cooperate to overcome this!
I tried system on BTRFS and “/home” on EXT4 but it didn’t work OK with me.
This is already entire controllable in btrfs. You decide which subvolumes you want to snapshot. That being said, snapshots of /home are, to me, the most valuable and important snapshots.
I don’t even vaguely understand why this is an issue. Baloo has an easy UI which allows you to decide what you do and don’t want to index. Why can’t you simply exclude the snapshots?
Neither. They both already support this.
This seems like a setup or a design issue to me. I have hundreds of snapshots of /home and none of them are getting indexed. I don’t even have them excluded by baloo.