Dude wrote:Correct, it only shows what is allocated and used.
It seems to me that btrfs fi df does not show the the total and available size disk space. What does the output actually mean? What is total, used and DUP?
[root@vm004 ~]# btrfs filesystem df /You have 4.01GB of data space allocated and have used 2.67GB of it.
Data: total=4.01GB, used=2.67GB
System, DUP: total=8.00MB, used=4.00KBYou are running with your system data in DUP mode (duplicated data on a single device). Btrfs has allocated 8MB of total duplicated system data and used 4kb of it so far. It has also allocated 4MB of unduplicated system data, but has not used any.
System: total=4.00MB, used=0.00
Metadata, DUP: total=1.00GB, used=141.72MBYou are running with your metadata in DUP mode (duplicated metadata on a single device). Btrfs has allocated 1GB for metadata so far and has used 141.72MB of it. Note that these are the single totals. You would then double this for the actual on-disk consumption. It has also allocated 8MB of unduplicated metadata, but has not used any.
Metadata: total=8.00MB, used=0.00
What does the following tell us. I guess 2.67GB + 142 MB = 2.81 GB?You can't really add them up. It tells you it's uses 141MB of metadata, but it's actually consumed 280MB on disk, because it duplicates all metadata.
[root@vm004 ~]# btrfs fi showBecause it's allocated 6GB. 4GB in unduplicated data and 2GB of duplicated metadata.
Label: 'root' uuid: e88be872-eb9b-482f-bac2-7bde7235d946
Total devices 1 FS bytes used 2.81GB
devid 1 size 15.84GB used 6.04GB path /dev/sda3
[root@vm004 ~]# df -hdf will only show you how much it thinks is consumed on the disk, but it very rarely is accurate with btrfs.
Dude wrote:Correct. It is (almost) impossible to predict how much actual data you'll be able to store on a btrfs volume, as it allocates chucks of data and metadata and then consumes them as necessary. And, as more activity occurs on the filesystem, e.g. snapshots or sub volumes or COW, more metadata is required, thus requiring more allocations.
Thanks for the reply. I was further testing how much data I can create with the dd command until the disk runs full. It stopped after 11.7 GB. Looking at the previous output, I wonder how to calculate that number. Considering how COW works, I think it is not possible to actually predict when a disk runs full - and perhaps that's why available disk space is not shown with the btrfs utility.