6

I'm using Btrfs, for better or worse. It is a plain btrfs partition with no compression or RAID, nor do I have any snapshots; it is a a simple btrfs partition that the OS is reporting with quite a bit of space free, but I am getting out of space errors when running various operations such as updates.

The operating system tools such as df report lots of space free:

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            7.8G     0  7.8G   0% /dev
tmpfs           1.6G   26M  1.6G   2% /run
/dev/sda5       354G  313G   41G  89% /
tmpfs           7.9G  172M  7.7G   3% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           7.9G     0  7.9G   0% /sys/fs/cgroup
/dev/sda5       354G  313G   41G  89% /home
tmpfs           1.6G  4.0K  1.6G   1% /run/user/139
tmpfs           1.6G   20K  1.6G   1% /run/user/1000

I later found the btrfs tool to show information about the btrfs volumes:

$ btrfs fi show
 Label: none  uuid: 76eb29fb-6909-4cc9-9848-f0b5723802b9
    Total devices 1 FS bytes used 285.88GiB
    devid    1 size 353.90GiB used 349.90GiB path /dev/sda5

 Label: none  uuid: 229c7745-144f-4dd0-98c5-476248b308ad
    Total devices 1 FS bytes used 384.00KiB
    devid    1 size 348.77GiB used 1.02GiB path /dev/sda3

/dev/sda5 is 286GB used with as size of 354GB. Then says 350GB used.

/dev/sda5 is mounted as /

How do I get access to the ~60GB that it says are free, but are not?

5
  • Hm, did you actually get some kind of "disk full" error messages? Otherwise this seems like btrfs just has allocated the space from the backing device to the specific filesystem, and you only need to balance if you want to use the space for different file system on the same device.
    – jpa
    Sep 2, 2017 at 20:21
  • The Ubuntu thinks btrfs disk is full but its not question and answer is all over the place is not focused on resolving the problem. For example, it talks about snapshots. The information that solved my problem has been difficult to find. Indeed the answer provided for Ubuntu thinks btrfs disk is full but its not and marked as the answer does not provide an actual solution.
    – David
    Sep 3, 2017 at 9:09
  • @jpa yes I was getting disk full messages.
    – David
    Sep 3, 2017 at 9:19
  • I agree your answer is more useful for most users than those answers. But this does seem to be asking the same thing. If we dupe it to Ubuntu thinks Btrfs disk is full but it's not we can then ask a moderator to merge your answer into that question. It still won't be the accepted one (unless the asker changes their accept). But its upvotes, which I expect to continue, should call attention to its value. That question as been viewed over 16 thousand times and is likely to continue being seen by people who should see your answer. What do you think of this? Sep 3, 2017 at 13:42
  • @EliahKagan, sorry, I think my question is different. It does not ask about nor talk about snapshots, compression or RAID which in my view are significant and substantial differences which add a significant amount of complexity. My question deals with a smaller subset of that question, so on this basis, I do not want my question and answers merged because the context of my question is vastly simpler, and therefore significantly clearer.
    – David
    Sep 3, 2017 at 15:49

1 Answer 1

8

Btrfs has not freed up blocks for reuse. For Btrfs, this is a manual process.

btrfs balance start / is the command to do this process.

  Done, had to relocate 352 out of 352 chunks

It will take a long time to complete, but you can check on the progress of the command in another console window with:

$ btrfs balance status /
Balance on '/' is running
239 out of about 352 chunks balanced (240 considered),  32% left

Once the rebalance operation was completed:

$ btrfs fi show
Label: none  uuid: 76eb29fb-6909-4cc9-9848-f0b5723802b9
    Total devices 1 FS bytes used 287.93GiB
    devid    1 size 353.90GiB used 298.90GiB path /dev/sda5

Label: none  uuid: 229c7745-144f-4dd0-98c5-476248b308ad
    Total devices 1 FS bytes used 384.00KiB
    devid    1 size 348.77GiB used 1.02GiB path /dev/sda3

Not the answer you're looking for? Browse other questions tagged .