This content has been marked as final.
Show 3 replies
-
1. Re: Understanding btrfs filesystem output
Avi Miller-Oracle Oct 29, 2012 8:09 PM (in response to Dude!)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.00KB
You 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.72MB
You 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 show
Because 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 -h
df will only show you how much it thinks is consumed on the disk, but it very rarely is accurate with btrfs.
Edited by: Avi Miller on Oct 30, 2012 7:09 AM -
2. Re: Understanding btrfs filesystem output
Dude! Oct 30, 2012 8:16 AM (in response to Avi Miller-Oracle)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. -
3. Re: Understanding btrfs filesystem output
Avi Miller-Oracle Oct 30, 2012 9:01 AM (in response to Dude!)1 person found this helpfulDude 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.
Work is being done in the mainline btrfs-progs to make the output of btfs fi df way more verbose. I urge you to use the btrfs-devel mailing list for deep technical questions instead of these forums as there are a lot more knowledgable people on that list. Also, you'll be able to see what's coming. :)
