On Thu, Jun 30, 2016 at 3:38 PM, Francesco Montesano
I've tried removing some of the oldest snapshots. I cleared some space:
Data,single: Size:38.23GiB, Used:27.35GiB /dev/sdb2 38.23GiB
Metadata,single: Size:1.75GiB, Used:1.09GiB /dev/sdb2 1.75GiB
System,single: Size:32.00MiB, Used:16.00KiB /dev/sdb2 32.00MiB
Then I've tried to run the balance command with -dusage 25 with no success. Then I tried:
sudo btrfs balance start -dusage=50 / ERROR: error during balancing '/': No space left on device There may be more info in syslog - try dmesg | tail
Given your explanation it makes sense, as I guess the balance needs disk space (metadata?) that apparently is not that abundant.
Balance always needs some minimum amount of unallocated space that isn't already used for a block group. And this file system has no unallocated space. It has unused space in allocated block groups, however. But Btrfs will not use unused space for balance, it does a copy on write operation only to a new block group, once that's successful it'll delete the former source. As it does the balance each new block group is pretty much filled 100%, so it should always be true that eventually you end up with unused space = unallocated space. The last block group of course does have some unused space in it. So the problem here is there's still no completely empty block group for any kind of balance to be successful.
In one of your messaged you talked about fragmentation; should I try to run "btrfs fi defragment"?
No I wouldn't worry too much about that. You can check files with 'filefrag' if you want, but some fragmentation is normal and isn't a problem. It's a big problem for VM and database images though. Btrfs has in some sense two kinds of fragmentation: files that have more than one extent; and block groups with pockets of unused space in between extents. 'fi defrag' only does the former, and balance only does the latter. Snapshots indirectly can make block group fragmentation worse: more accurately when snapshots that contain few changes are deleted. An optimization to reduce this type of fragmentation on cow file systems might be to do frequent snapshots, which pins extents preventing their deletion. And instead of deleting them one at a time to delete large numbers of them at once which should free more contiguous extents, rather than piecemeal. But this is just an idea, someone will need to model it and figure out the patterns. But at some point it might be a good optimization for snapper.
I'll wait a day or two to see how btrfs behaves after removing the snapshot. If nothing happens, I'll try this.
It's a safe operation. But I'd still make sure you have backups of important things. -- Chris Murphy -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org