BTRFS Storage Size

I have created a partition 54GB and formatted as BTRFS, but when i query storage it says the size is 15GB - i don’t recall being asked to set it, and the number is not correct. On a different server that uses ZFS, there is no size field. Is this important and does it change anything?

$ lxc storage show default
  size: 15GB

Here is the partition structure

$  lsblk | grep 'sda'
sda      8:0    0   64G  0 disk 
├─sda1   8:1    0  512M  0 part /boot/efi
├─sda2   8:2    0   10G  0 part /
└─sda3   8:3    0 53.5G  0 part /btrfs

Please show the command you used to create the storage pool.

When i was installing Ubuntu server, i clicked on add partition, and set it to BTRFS which it formatted and mounts to /btrfs

Then I ran sudo lxd init

Create a new BTRFS pool? (yes/no) [default=yes]: no
Name of the existing BTRFS pool or dataset: /btrfs

Did I set it up wrong?

$ lxc storage list
| default |             | btrfs  | /btrfs | 10      |

Could you please paste the output of this command?
btrfs filesystem show /btrfs

$ sudo btrfs filesystem show /btrfs
Label: none  uuid: 916f6d6a-c243-477c-b43b-20d12eb15518
	Total devices 1 FS bytes used 3.13GiB
	devid    1 size 53.50GiB used 9.03GiB path /dev/sda3

I have just created a btrfs filesystem with size 100GB but lxc storage show command list the size as 30GB. It is a little bit weird, you can set the size bigger than the btrfs partition size as well.

@stgraber this doesn’t seem quite right, but should we be populating a size property of 30GB if the BTRFS external source partition is >30GB?


My first thoughts are that this is a hang over from the loop-back file BTRFS storage pool setup?

Hmm, yeah, that’s wrong, the size property is meaningless when not using a loop and shouldn’t be applied during creation.

OK thanks will take a look at fixing that.

This will fix it: