You are not logged in.

#1 2014-06-08 18:41:14

Nolhian
Member
Registered: 2011-08-21
Posts: 25

[Solved] BTRFS strange behaviour

Hello,

I made some tests with btrfs by installing Arch in a VM. I made a raid 1 with 2 whole disks and created root and home subvolumes. Here it is after rebooting after the install :

6tW2YzB.png

Then I made a failed disk simulation by formatting the first disk, mounting the second disk in degraded mode, adding the first disk again, deleting the missing disks and balancing the data. It worked and after rebooting here is the result :

fscTTUI.png

You can see a few differences. First, why is there a Data, System and Metadata single in the first image ? I created the raid with :

mkfs.btrfs -f -L ARCH -m raid1 -d raid1 /dev/sda /dev/sdb
mount /dev/sda /mnt
cd /mnt
btrfs subvolume create root
btrfs subvolume create home

Next, it shouldn't be important because I imagine that the allocation would grow automatically when the used space is near the allocation limit but why did the Metadata allocated space shrink from 1 GiB to 256MB ?

Thanks ! smile

Last edited by Nolhian (2014-06-09 20:25:28)

Offline

#2 2014-06-08 18:58:13

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] BTRFS strange behaviour

The tidbits of 'Single' are apparently a bug.  You can get rid of them with a balance.

# btrfs balance start -dconvert=raid1,soft -mconvert=raid1,soft /path/to/btrfs 

The System and Metadata sections are both handled by the -m.  But sometimes the System chunk will not balance.  If this happens, you can use:

# btrfs balance start -sconvert=raid1,soft -f /path/to/btrfs 

This will do only the System portion and will force it.  Like pacman, use the force with extreme caution.

In the examples above, the soft simply tells it to balance only the portions that are not already in the desired profile that is specified by convert.

I'm not sure why the Metadata shrank the way it did.  But there is no reason why you would need to have 1GiB of Metadata chunks for 45MiB of Metadata.  It is supposed to allocate chunks 256MiB at a time.  So really I just have no idea why it would have given it a full GiB to begin with there. 

But when you added a new disk, you balanced the filesystem.  So basically it saw that there was such a tiny amount of Metadata, and acted accordingly.

Offline

#3 2014-06-09 13:38:59

Nolhian
Member
Registered: 2011-08-21
Posts: 25

Re: [Solved] BTRFS strange behaviour

Pretty annoying bug, hopefully they will fix it soon, thanks for the commands to make it right wink

Yes that's really strange, especially ( I didn't know that ) if like you said it's supposed to allocate chunks of 256MiB at a time, don't know where the 1GiB came from. It should have allocated only 256MiB from the start.

Thanks for clearing everything up !

Offline

#4 2014-06-09 15:07:12

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] BTRFS strange behaviour

No problem.  If you are satisfied with the answer I gave, please mark the thread as [Solved].

Offline

Board footer

Powered by FluxBB