Every time I do a system update, I run out of space on my root partition.
btrfs is hellbent on using only 74GB out of 323GB total available on the partition so I have to then start deleting snapshots to try and complete the update.
There must be something I’m missing so I’m hoping someone has any suggestions.
Here’s some output which might help diagnose this:
# btrfs fi show /
Label: none uuid: fe9cc6a2-a504-4af7-8728-785068ad6dda
Total devices 1 FS bytes used 73.44GiB
devid 1 size 323.00GiB used 75.03GiB path /dev/mapper/cr_root
It sounds similar to this: https://bugzilla.kernel.org/show_bug.cgi?id=74101
But there’s no help there and it appears to span multiple kernel versions (from 3 to, in my case, 5). Might be totally different issues with the same symptom.
After running balance with the suggested musage (and I presume dusage):
# btrfs filesystem usage -T /
Overall:
Device size: 323.00GiB
Device allocated: 75.03GiB
Device unallocated: 247.97GiB
Device missing: 0.00B
Used: 73.94GiB
Free (estimated): 248.94GiB (min: 248.94GiB)
Data ratio: 1.00
Metadata ratio: 1.00
Global reserve: 126.08MiB (used: 0.00B)
Data Metadata System
Id Path single single single Unallocated
-- ------------------- -------- --------- -------- -----------
1 /dev/mapper/cr_root 74.00GiB 1.00GiB 32.00MiB 247.97GiB
-- ------------------- -------- --------- -------- -----------
Total 74.00GiB 1.00GiB 32.00MiB 247.97GiB
Used 73.03GiB 929.42MiB 16.00KiB
In fact, after running balance, I have 0 available space once again.
@arvidjaar, you have a link to the issue? Looks like the latest snapshot installs kernel 5.5.2 so I’ll give that a try. Once I somehow clear enough space that is.
Otherwise it’s a wipe and move to ext4 but I’m not looking forward to the time spent doing that.
erlangen:~ # journalctl -u btrfs-balance.service
-- Logs begin at Fri 2020-02-14 07:59:41 CET, end at Sun 2020-02-16 17:42:02 CET. --
Feb 15 09:34:45 erlangen systemd[1]: Started Balance block groups on a btrfs filesystem.
Feb 15 09:34:45 erlangen btrfs-balance.sh[20518]: Before balance of /
Feb 15 09:34:45 erlangen btrfs-balance.sh[20518]: Data, single: total=13.00GiB, used=12.45GiB
Feb 15 09:34:45 erlangen btrfs-balance.sh[20518]: System, single: total=32.00MiB, used=16.00KiB
Feb 15 09:34:45 erlangen btrfs-balance.sh[20518]: Metadata, single: total=1.00GiB, used=501.11MiB
Feb 15 09:34:45 erlangen btrfs-balance.sh[20518]: GlobalReserve, single: total=35.42MiB, used=0.00B
Feb 15 09:34:45 erlangen btrfs-balance.sh[20518]: Dateisystem Größe Benutzt Verf. Verw% Eingehängt auf
Feb 15 09:34:45 erlangen btrfs-balance.sh[20518]: /dev/sdb5 64G 14G 50G 23% /
Feb 15 09:34:45 erlangen btrfs-balance.sh[20518]: Done, had to relocate 0 out of 15 chunks
Feb 15 09:34:45 erlangen btrfs-balance.sh[20518]: Dumping filters: flags 0x1, state 0x0, force is off
Feb 15 09:34:45 erlangen btrfs-balance.sh[20518]: DATA (flags 0x2): balancing, usage=5
Feb 15 09:34:45 erlangen btrfs-balance.sh[20518]: Done, had to relocate 0 out of 15 chunks
Feb 15 09:34:45 erlangen btrfs-balance.sh[20518]: Dumping filters: flags 0x1, state 0x0, force is off
Feb 15 09:34:45 erlangen btrfs-balance.sh[20518]: DATA (flags 0x2): balancing, usage=10
Feb 15 09:34:45 erlangen btrfs-balance.sh[20518]: Done, had to relocate 0 out of 15 chunks
Feb 15 09:34:45 erlangen btrfs-balance.sh[20518]: Done, had to relocate 0 out of 15 chunks
Feb 15 09:34:45 erlangen btrfs-balance.sh[20518]: Dumping filters: flags 0x6, state 0x0, force is off
Feb 15 09:34:45 erlangen btrfs-balance.sh[20518]: METADATA (flags 0x2): balancing, usage=3
Feb 15 09:34:45 erlangen btrfs-balance.sh[20518]: SYSTEM (flags 0x2): balancing, usage=3
Feb 15 09:34:45 erlangen btrfs-balance.sh[20518]: Done, had to relocate 1 out of 15 chunks
Feb 15 09:34:45 erlangen btrfs-balance.sh[20518]: After balance of /
Feb 15 09:34:45 erlangen btrfs-balance.sh[20518]: Data, single: total=13.00GiB, used=12.45GiB
Feb 15 09:34:45 erlangen btrfs-balance.sh[20518]: System, single: total=32.00MiB, used=16.00KiB
Feb 15 09:34:45 erlangen btrfs-balance.sh[20518]: Metadata, single: total=1.00GiB, used=501.14MiB
Feb 15 09:34:45 erlangen btrfs-balance.sh[20518]: GlobalReserve, single: total=35.44MiB, used=0.00B
Feb 15 09:34:45 erlangen btrfs-balance.sh[20518]: Dateisystem Größe Benutzt Verf. Verw% Eingehängt auf
Feb 15 09:34:45 erlangen btrfs-balance.sh[20518]: /dev/sdb5 64G 14G 50G 23% /
Feb 15 09:34:45 erlangen systemd[1]: btrfs-balance.service: Succeeded.
erlangen:~ #
Feb 16 12:04:30 thinkpad systemd[1]: Started Balance block groups on a btrfs filesystem.
Feb 16 12:04:30 thinkpad btrfs-balance.sh[25953]: Before balance of /
Feb 16 12:04:30 thinkpad btrfs-balance.sh[25953]: Data, single: total=73.00GiB, used=58.86GiB
Feb 16 12:04:30 thinkpad btrfs-balance.sh[25953]: System, single: total=32.00MiB, used=16.00KiB
Feb 16 12:04:30 thinkpad btrfs-balance.sh[25953]: Metadata, single: total=1.00GiB, used=910.11MiB
Feb 16 12:04:30 thinkpad btrfs-balance.sh[25953]: GlobalReserve, single: total=110.73MiB, used=0.00B
Feb 16 12:04:30 thinkpad btrfs-balance.sh[25953]: Filesystem Size Used Avail Use% Mounted on
Feb 16 12:04:30 thinkpad btrfs-balance.sh[25953]: /dev/mapper/cr_root 347G 65G 0 100% /
Feb 16 12:04:30 thinkpad btrfs-balance.sh[25953]: Done, had to relocate 0 out of 75 chunks
Feb 16 12:04:33 thinkpad btrfs-balance.sh[25953]: Dumping filters: flags 0x1, state 0x0, force is off
Feb 16 12:04:33 thinkpad btrfs-balance.sh[25953]: DATA (flags 0x2): balancing, usage=5
Feb 16 12:04:33 thinkpad btrfs-balance.sh[25953]: Done, had to relocate 9 out of 75 chunks
Feb 16 12:04:34 thinkpad btrfs-balance.sh[25953]: Dumping filters: flags 0x1, state 0x0, force is off
Feb 16 12:04:34 thinkpad btrfs-balance.sh[25953]: DATA (flags 0x2): balancing, usage=10
Feb 16 12:04:34 thinkpad btrfs-balance.sh[25953]: Done, had to relocate 1 out of 66 chunks
Feb 16 12:04:34 thinkpad btrfs-balance.sh[25953]: Done, had to relocate 0 out of 65 chunks
Feb 16 12:04:34 thinkpad btrfs-balance.sh[25953]: Dumping filters: flags 0x6, state 0x0, force is off
Feb 16 12:04:34 thinkpad btrfs-balance.sh[25953]: METADATA (flags 0x2): balancing, usage=3
Feb 16 12:04:34 thinkpad btrfs-balance.sh[25953]: SYSTEM (flags 0x2): balancing, usage=3
Feb 16 12:04:34 thinkpad btrfs-balance.sh[25953]: Done, had to relocate 1 out of 65 chunks
Feb 16 12:04:34 thinkpad btrfs-balance.sh[25953]: After balance of /
Feb 16 12:04:34 thinkpad btrfs-balance.sh[25953]: Data, single: total=63.00GiB, used=58.86GiB
Feb 16 12:04:34 thinkpad btrfs-balance.sh[25953]: System, single: total=32.00MiB, used=16.00KiB
Feb 16 12:04:34 thinkpad btrfs-balance.sh[25953]: Metadata, single: total=1.00GiB, used=910.09MiB
Feb 16 12:04:34 thinkpad btrfs-balance.sh[25953]: GlobalReserve, single: total=110.70MiB, used=0.00B
Feb 16 12:04:34 thinkpad btrfs-balance.sh[25953]: Filesystem Size Used Avail Use% Mounted on
Feb 16 12:04:34 thinkpad btrfs-balance.sh[25953]: /dev/mapper/cr_root 347G 65G 0 100% /
Feb 16 12:04:34 thinkpad systemd[1]: btrfs-balance.service: Succeeded.
I deleted some personal files just to make up enough space for the update. The result was it just runs out of space sooner (at 60 gigs instead of 74).
After some more snapshot deletions and collecting a few megabytes along the way, the update finally managed to finish. Now running 5.5.2 and hoping this goes away.
Looks like the newest kernel fixed this. I copied over some large files and those were done without running out of space again. The unallocated space was successfully shrunk as the filesystem worked to accommodate the files.
As you can see there is plenty of space but unallocated and I am running out of space for Data,single (here: already at 86.4%).
Balance did not help, it was even worse after executing.
I was thinking that BTRFS is managing the allocated / unallocated space itself, but I might be wrong.
In different forums I got that this might be a bug. However, maybe it is a feature, and I am simply unable to find the right command to get rid of the unassigned range.
Since I am running the newest Kernel the bug (if so) should be fixed. But why I do have this issue???
I am sorry that I was silent the last days, but I was investigating this further.
It seems that I was mistaken (or an update solved the issue).
However, the allocated space is handled now in the right way, and I am not running any longer into memory issues.
I checked the behavior for different scenarios:
Checked the memory allocation while copying a large file to a location under /
Checked the memory allocation before and after large updates via zypper dup
So, I guess we can set this thread on hold, and I hope there is no need to reopen it in the future.
Many thanks for your help!