Re: [RFC] btrfs fi df output [Was Re: BTRF - Storage Usage]
From: Goffredo Baroncelli <hidden>
Date: 2012-09-28 16:44:00
On 09/28/2012 05:17 AM, Roman Mamedov wrote:
On Thu, 27 Sep 2012 23:02:35 +0200 Goffredo Baroncelli[off-list ref] wrote:quoted
Sorry for the space error: Below a more correct example $ btrfs filesystem disk-free / Summary: Total: 135.00GB Allocated: 10.51GB Unallocated: 124.49GB Free_(Estimated) 86.56GB Average_disk_efficiency: 62 %How do you estimate "Free" here? Sorry I didn't check the source code in git, but from the "Details" below nothing leads me to believe that this FS is doomed to only be able to usefully utilize only ~86GB of the partition, and not more.
The estimation is made on the basis of the real allocated space on the disk and the available space. In the example we know that BTRFS allocate: - 4GB in Single mode (4GB available, 2.16GB used) - 16MB in DUP mode (so 16/2=8MB available, 4kb used) - 4MB in Single mode (4MB available) - 6GB in DUP mode (6/2=3GB available, 429MB used) - 8MB in Single mode (8MB available) So BTRFS allocated on disk 4GB+16MB+4MB+6GB+8MB = ~10GB, but the space availabled (regarding these allocated chunks) is 4GB+8MB+4MB+3GB+8MB = ~7GB. This means that the ration of space physically allocated on the disk and the space available is 7GB/10GB = 0.7 . So on 135GB of disk, only 94GB are available. Yes my previous 0.62 was wrong. The real ratio is 0.7.
Are you ready to answer the flood of questions from people why their disk is only 62% efficient, and how to tune it to 100%? :-)
I don't understand your question: by default BTRFS store all metadata DUP-ed, this means that on the disk the space allocated are 2 times the space required. Because on BTRFS the metadata are a lot, this means that BTRFS is not so efficiency as other file-systems. This is a well know fact. If you want to use all the space with the maximum efficiency, you could format the filesystem with the options "-m single".
Why use underscores instead of spaces?
Simplify the parsing in scripts
quoted
Details: Chunk-type Mode Allocated Used Free ---------- ---- --------- -------- --------- Data Single 4.01GB 2.16GB 1.87GB System DUP 16.00MB 4.00KB 7.99MB System Single 4.00MB 0.00 4.00MB Metadata DUP 6.00GB 429.16MB 2.57GB Metadata Single 8.00MB 0.00 8.00MB