Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a 256GB SSD disk on which I converted my ext4 root FS to btrfs. I erased the ext4 backup subvolume, enabled compression and defragmented recursively to enable it on all files.

btrfs fi df / has an output that worries me though:

Data: total=148.00GB, used=106.11GB
System: total=32.00MB, used=16.00KB
Metadata: total=65.00GB, used=2.04GB

If I understand the output correctly, 65GB (1/4 of my disk!) is reserved for meta-data and not available for storing files. If this is correct, it would be a huge waste of my disk space. Am I understanding correctly? Can the metadata-allocated portion of my disk be resized?

share|improve this question

1 Answer 1

up vote 9 down vote accepted

First, make sure your kernel and the BTRFS user-space is up-to-date.

According to the BTRFS FAQ, you cannot resize the metadata block size. You can, however, try to run btrfs balance start <mount point> which will reallocate the data across the entire disk and, as a side effect, possibly free up unallocated space.

If that doesn't work, you may have to backup your data and recreate the filesystem. (Take a look at this for more info.)

share|improve this answer
    
Thanks for the answer. Kernel is 3.11.2, btrfs-tools are v0.20-rc1 so I don't think I'm out of date here. I tried to run a balance but then I hit the following bug: spinics.net/lists/linux-btrfs/msg26977.html and don't feel like compiling a newer kernel just for this. :P What I wonder is whether these 65GB are the metadata block that cannot be resized, or if that term refers to something else. Otherwise I really don't understand how the metadata block got created with that size in the first place. –  Gnurou Oct 4 '13 at 15:21
    
Unfortunately, I am only a user of btrfs and not an expert, so my help is limited. In any case, it's possible there is a flaw in the conversion process from ext4. –  hololeap Oct 5 '13 at 16:05
5  
So, the necessary patch made it into the stable kernel, and I have tried what you suggested. Balancing indeed reduced the amount of reserved area for meta-data down to 3GB, and the claimed space now appears as free space in 'df'. Note that you don't need to rebalance the whole disk, you can do btrfs balance start -m <mount point> to only rebalance the metadata, which is much faster. Thanks for the insightful answer! –  Gnurou Oct 25 '13 at 6:03
    
Glad I could help! –  hololeap Nov 13 '13 at 4:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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