Hi gurus,
I’m relatively new to Linux so please excuse the lack of my knowledge. I switched from Mint to Manjaro KDE about 2 months ago and I decided to use BTRFS because I liked the idea of selectable snapshots from GRUB. Unfortunately, I did not do enough of research and I hit a wall today as my BTRFS partition seemingly ran out of space and Manjaro could not boot up. I managed to recover it after 5 hours of struggling . It has been a good learning experience, but at a very bad time. You can read all about it bellow - maybe it will help someone in the future.
I would like to ask for your opinions on my bellow questions:
- How can I prevent btrfs from running out of space in the future? I is enough just to use cron and periodically perform btrfs balance?
- Why is Manjaro not performing automatic btrfs balancing or other maintenance to automatically free up space? What’s the recommended approach for long term stability?
- Is is possible my filesystem was somehow corrupted due to the bug reported here ?
- Is there any way to convert btrfs into ext4 when Manjaro was installed fresh with btrfs?
My story:
- I have been experiencing high CPU utilization due to ‘kworker events_unbound’ . Based on this forum topic, this is known kernel bug. I suspect it was related to btrfs snapshot creation…
- I upgraded from kernel 5.13.19-2 to 5.15.2-2 and I did not see this issue after reboot. I was happy, but not for long.
- I tried to create a new snapshot in Timeshift , but I noticed that all past snapshots only showed a few bytes in size, which shocked me.
- Few minutes later, most of my apps including plasma-shell crashed and I could not recover from it, so I rebooted.
- System never booted up and I could only use shell after pressing (alt+f2).
- I could not perform almost any operation due to ‘No Disk Space’ or ‘read-only’ errors.
-Journalctl showed the bellow interesting line:
kernel: BTRFS warning (device nvme0n1p3): btrfs_uuid_scan_kthread failed -28
-I seemed to have enough of free disk space:
sudo btrfs fi df
Data, single: total=198.67GiB, used=169.28GiB
System, single: total=4.00MiB, used=48.00KiB
Metadata, single: total=4.01GiB, used=3.71GiB
GlobalReserve, single: total=315.77MiB, used=2.91MiB
sudo btrfs fi usage /
Overall:
Device size: 202.68GiB
Device allocated: 202.68GiB
Device unallocated: 1.00MiB
Device missing: 0.00B
Used: 172.99GiB
Free (estimated): 29.39GiB (min: 29.39GiB)
Free (statfs, df): 0.00B
Data ratio: 1.00
Metadata ratio: 1.00
Global reserve: 315.77MiB (used: 3.83MiB)
Multiple profiles: no
- I was not able to delete or even access snapshots due to ‘No Disk Space’ error .
- I managed to remove several large .iso files but it did not reflect anywhere.
- I followed many articles including this, but nothing worked.
- The only solution that I found to work was adding new USB disk to btrfs
- I was able to access the partition now, but GRUB then failed to load. I assumed this was because both btrfs member disks showed with the same UUID and fstab needed some adjustment.
- The last step to the solution was to run
sudo btrfs balance start /<mount_point>
and then removing the USB disk from btrfs. - At last I managed to boot into Manjaro, but all my snapshots were lost…
- btrfs usage after balancing was completed:
sudo btrfs fi df /
Data, single: total=130.00GiB, used=129.12GiB
System, single: total=32.00MiB, used=16.00KiB
Metadata, single: total=2.00GiB, used=1.18GiB
GlobalReserve, single: total=226.12MiB, used=0.00B
sudo btrfs fi usage /
Overall:
Device size: 202.68GiB
Device allocated: 132.03GiB
Device unallocated: 70.65GiB
Device missing: 0.00B
Used: 130.30GiB
Free (estimated): 71.54GiB (min: 71.54GiB)
Free (statfs, df): 71.53GiB
Data ratio: 1.00
Metadata ratio: 1.00
Global reserve: 226.12MiB (used: 0.00B)
Multiple profiles: no