Skip to content

Instantly share code, notes, and snippets.

@suy
Last active July 30, 2018 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suy/3a3fd68d69e542b26c68bcc3b77bc68a to your computer and use it in GitHub Desktop.
Save suy/3a3fd68d69e542b26c68bcc3b77bc68a to your computer and use it in GitHub Desktop.
BTRFS "no space" problem

Initially

# df -h -x tmpfs
Filesystem      Size  Used Avail Use% Mounted on
udev            7.8G     0  7.8G   0% /dev
/dev/sda1       9.4G  6.1G  3.3G  66% /
/dev/sda2       923G  439G  482G  48% /home
# btrfs fi show
Label: none  uuid: 1c8212fb-88ff-4f39-912a-5178a3547e6c
        Total devices 1 FS bytes used 5.94GiB
        devid    1 size 9.31GiB used 9.31GiB path /dev/sda1

Label: none  uuid: 3f6cfd00-39ca-4ac2-9417-c4bce48a2345
        Total devices 1 FS bytes used 438.27GiB
        devid    1 size 922.20GiB used 686.01GiB path /dev/sda2

# btrfs fi df /
Data, single: total=8.81GiB, used=5.60GiB
System, single: total=4.00MiB, used=16.00KiB
Metadata, single: total=512.00MiB, used=353.28MiB
GlobalReserve, single: total=128.00MiB, used=0.00B
# btrfs balance start / -m -v
Dumping filters: flags 0x6, state 0x0, force is off
  METADATA (flags 0x0): balancing
  SYSTEM (flags 0x0): balancing
ERROR: error during balancing '/': No space left on device
There may be more info in syslog - try dmesg | tail

I tried the main recipes on the FAQs to rebalance and gain space for metadata, but I got the Done, had to relocate 0 out of N chunks and ERROR: error during balancing '/foo' - No space left on device.

# btrfs fi df /
Data, single: total=8.67GiB, used=5.78GiB
System, single: total=32.00MiB, used=16.00KiB
Metadata, single: total=620.00MiB, used=355.28MiB
GlobalReserve, single: total=128.00MiB, used=0.00B
@suy
Copy link
Author

suy commented Jul 30, 2018

The last round of drama:

caketastic:/etc/apt/sources.list.d# btrfs balance start / -m -v                                                                                                                                                      
Dumping filters: flags 0x6, state 0x0, force is off
  METADATA (flags 0x0): balancing
  SYSTEM (flags 0x0): balancing
Done, had to relocate 4 out of 18 chunks
caketastic:/etc/apt/sources.list.d# btrfs device usage /                                                                                                                                                             
/dev/loop1, ID: 3
   Device size:             5.00GiB
   Data,single:             1.00GiB
   Metadata,single:       768.00MiB
   System,single:          32.00MiB
   Unallocated:             3.22GiB

/dev/sda1, ID: 1
   Device size:             9.31GiB
   Data,single:             8.71GiB
   Unallocated:           621.00MiB

caketastic:/etc/apt/sources.list.d# btrfs fi df /                                                                                                                                                                    
Data, single: total=9.71GiB, used=4.96GiB
System, single: total=32.00MiB, used=16.00KiB
Metadata, single: total=768.00MiB, used=304.77MiB
GlobalReserve, single: total=112.00MiB, used=0.00B
caketastic:/etc/apt/sources.list.d# btrfs balance start / 
Done, had to relocate 18 out of 18 chunks
caketastic:/etc/apt/sources.list.d# btrfs device usage /                                                                                                                                                             
/dev/loop1, ID: 3
   Device size:             5.00GiB
   Data,single:             2.00GiB
   Metadata,single:       768.00MiB
   System,single:          32.00MiB
   Unallocated:             2.22GiB

/dev/sda1, ID: 1
   Device size:             9.31GiB
   Data,single:             3.00GiB
   Unallocated:             6.31GiB

caketastic:/etc/apt/sources.list.d# btrfs device delete /dev/loop1 /                                                                                                                                                 
caketastic:/etc/apt/sources.list.d# btrfs fi df /                                                                                                                                                                    
Data, single: total=5.81GiB, used=4.96GiB
System, single: total=32.00MiB, used=16.00KiB
Metadata, single: total=768.00MiB, used=303.88MiB
GlobalReserve, single: total=112.00MiB, used=0.00B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment