Recovering From a Full btrfs Disk
By chimo on (updated on )Jotting down the steps I took (found) to recover from a full (or “metadata full”) btrfs disk.
My btrfs disk for Incus storage is /dev/sdc, mounted at /var/lib/incus/storage-pools/pool1. My Operating System’s disk with available storage is /dev/sda.
# Create a 5GB disk-image on another drive
dd if=/dev/zero of=/mnt/tmpBtrfs.img bs=1G count=5
# Set it up as loop device
losetup -v -f /mnt/tmpBtrfs.img
# Add it to btrfs
btrfs device add /dev/loop1 /var/lib/incus/storage-pools/pool1
# Re-balance
btrfs bal start /var/lib/incus/storage-pools/pool1
# Free disk space.
# In my case, I got rid of some extra container snapshots I had laying around.
# Teardown temporary space
btrfs device delete /dev/loop1 /var/lib/incus/storage-pools/pool1
losetup -d /mnt/tmpBtrfs.img
rm /mnt/tmpBtrfs.img