2

First of all: Yes, I've read the BTRFS Wiki

On a server (Ubuntu 14.04 LTS, Kernel 3.13) I have a (virtual) hard disk with 700GiB of disk space (formatted as BTRFS partition)

$ sudo btrfs fi show
Label: none  uuid: cc4cb0f8-2970-43d1-b8ed-f2f69eadb607
    Total devices 1 FS bytes used 568.54GiB
    devid    1 size 699.00GiB used 576.03GiB path /dev/vda1

My root partition's size is much less than the available space:

$ sudo btrfs fi df /
Data, single: total=566.00GiB, used=559.50GiB
System, single: total=32.00MiB, used=72.00KiB
Metadata, single: total=10.00GiB, used=8.54GiB

So how do I get the unallocated space of the partition (699.00GiB - 576.03GiB, see first output) to be used for the root partition?

I already tried

$ sudo btrfs filesystem resize max /
Resize '/' of 'max'

but even though it seemed to be completed successfully, the output of sudo btrfs fi show (unallocated space) and sudo btrfs fi df / do not change.

Am I misunderstanding the whole concept of free and unallocated space?

[Edit] (as requested in the comments)

$ sudo blockdev --report
RO    RA   SSZ   BSZ   StartSec            Size   Device
rw   256   512  4096          0    751619276800   /dev/vda
rw   256   512  4096       2048    750543241216   /dev/vda1
rw   256   512  4096 1465906816      1073741824   /dev/vda2

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            7.9G   12K  7.9G   1% /dev
/dev/vda1       699G  564G  134G  81% /
/dev/vda1       699G  564G  134G  81% /home
  • 1
    Unalocated space is disk space which is not assigned to any partition, and free space is disk space which is assigned to partition but not yet used. If you don't want to show your df outout at least show us blockdev --report – mrc02_kr Aug 31 '17 at 10:26
  • @mrc02_kr So how do I assign this space to the partition? I added the outputs of df and blockdev --report to the post. (It's not that I don't wanted to post them, just thought df is completely irrelevant here) – muffel Aug 31 '17 at 10:33
1

So you have physical device /dev/vda with size 751619276800 and two partitions with sizes: 750543241216 and 1073741824. There are only 2293760 bytes (2 MB) unallocated.

It's not true that your partition size is much less than available space: your partition has maximum size it can have and you have available space on that partition. If you want to have more partitions you should shrink /dev/vda1 and create another partition but I wouldn't do that.

If you want to resize partitions on existing system you should use LVM.

EDIT:
According to btrfs help:

btrfs filesystem df <path>
    Show space usage information for a mount point
btrfs filesystem show [options] [<path>|<uuid>|<device>|label]
    Show the structure of a filesystem

So as you can see btrfs fi show states that /dev/vda1 have size 699 and 576 is used. If you sum Data, System and Metadata total value that will give you 576.

See this link for reference.

  • thank for your answer. let me please rephrase my question: why does sudo btrfs fi df / show only 566.00GiB data storage available, when the partition size is 699GiB and system and metadata also take less than 9GiB? Where are the ~ 133GiB (699-566)? – muffel Aug 31 '17 at 14:13
  • @muffel I've edited my answer – mrc02_kr Aug 31 '17 at 14:24
  • I have this same issue, shown more clearly using btrfs device usage <path> – andho Dec 15 '18 at 13:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.