-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Problem Description
When the System Rollback feature detects low unallocated btrfs space (below 15%), it displays a notification warning users about potential file corruption and paused snapshot maintenance. However, the notification only suggests:
- Removing files from /home
- Purging software packages
- Moving databases/VMs/logs
- Using Rollback Dashboard
These suggestions address used space, but the actual problem is often fragmented btrfs chunk allocation - where plenty of free space exists within allocated chunks, but little unallocated space remains for new chunks.
Real-World Example
$ df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/nvme0n1p6 86G 36G 46G 44% /
$ sudo btrfs filesystem usage /
Device size: 85.43GiB
Device unallocated: 6.41GiB (~7.5%)
Free (estimated): 45.92GiB
The user sees 46GB free (56%), but kfocus correctly warns about only 7% unallocated. The fix is simply:
sudo btrfs balance start -dusage=50 /This reclaims unused space from partially-filled chunks back to the unallocated pool.
Suggested Improvements
-
Add "Run Balance" button to the kdialog notification that executes the balance command (with pkexec for privileges)
-
Update notification text to explain the difference between "free space" and "unallocated space" and mention that balance can help
-
Consider proactive balancing in
_maintainBtrfsFn()- automatically run a light balance (e.g.,-dusage=30) when unallocated drops below 20%, before it becomes critical
Affected Files
/usr/lib/kfocus/bin/kfocus-rollback-backend-_lowDiskWithHomeMsgand_lowDiskWithoutHomeMsgmessage templates/usr/bin/kfocus-focusrx-dbus-dispatch- kdialog launcher (would need new button handler)/usr/lib/kfocus/bin/kfocus-focusrx-system-_maintainBtrfsFn()for proactive balancing
Why This Matters
This is a common btrfs behavior that confuses users. The kfocus team already did the right thing by monitoring unallocated space (most distros don't), but the current remediation suggestions don't address the root cause. Users delete files unnecessarily when a simple balance would fix the issue.