BTRFS-management on Fedora Atomic

Fedora Atomic desktops use BTFS and probably use its benefits

  • deduplicating OSTree snapshots (probably very important)
  • compressing storage to increase SSD lifespan

but they also do a lot of complicated linking, and everything outside /var is read-only.

This means that btrfs balance, btrfs scrub and more actions simply dont work in these partitions.

  1. What maintenance for BTRFS is recommended, and does it work for subvolumes only?
  2. What subvolumes to use, as most are just links?
  3. Is it impossible to do these actions on the system partition? Maybe adding a minimal “rescue system” into a separate partition, mounting read/write and doing like that?
  4. Is it dangerous to run these maintenance tasks on the immutable system partitions?

I think this is quite a big blind spot. Also, as Fedora uses BTRFS on all (?) variants, why are actions like balance and scrub not automated, as I heard they are important for keeping up performance?


TL;DR: There are so many sym-/ hardlinks and BTRFS subvolumes that I am confused.

But as the actions are about the filesystem and not the volumes, this shouldnt matter.

Secondly I wonder how an immutable Filesystem can still be changed via BTRFS.

What works:

sudo btrfs scrub start /

Seems to work but errors out after a while:

 sudo btrfs balance start / --full-balance
1 Like

Are they failing because the filesystem is immutable?

Many of the maintenance-related commands run on the entire filesystem even you target a specific subvolume/mountpoint.

Yes running balance on the entire filesystem errors out.

No, many commands are also possible for just a subvolume. But as most are links (symlinks or hardlinks?) For example in /ostree/deploy/... I wonder what is the correct subvolume to run the commands on.

As it relates to filesystem maintenance, what can you do to just a subvolume?

True, many things may only be available for the whole filesystem.

So again, is immutable Fedora on BTRFS an issue over time? If you cannot defragment, balance etc, will the partitions get messed up over time?

I just installed kinoite to see what was going on and it was possible to run those operations for me.

Since they run on the whole filesystem, you can just choose a target mountpoint that is rw.

1 Like

Please report what you tried and the errors you got because this should work just fine on Atomic Desktops.

1 Like

For me, it depends which mountpoint you try to run it on. You need to pick one that is r/w.

$ sudo btrfs balance start /sysroot --full-balance
ERROR: error during balancing '/sysroot': Read-only file system
There may be more info in syslog - try dmesg | tail

$ sudo btrfs balance start / --full-balance
Done, had to relocate 11 out of 11 chunks

Yes same here. It works and looks logical (even though /sysroot is “the real system root” whatever this means here)