From: Duncan <1i5t5.duncan@cox.net>
To: linux-btrfs@vger.kernel.org
Subject: Re: kernel BUG at /linux/fs/btrfs/extent-tree.c:1833!
Date: Sun, 11 Oct 2015 11:28:36 +0000 (UTC) [thread overview]
Message-ID: <pan$79537$59fa2bae$d82578cd$79406a63@cox.net> (raw)
In-Reply-To: CAEtw4r2HMrJciX4tgC9d9qSVucCJng-tyJxWPFX7h-5oqePV_w@mail.gmail.com
Peter Becker posted on Sat, 10 Oct 2015 21:48:31 +0200 as excerpted:
> btrfs balance start -m /media/RAID
>
> complete with out any error but the resulte of device usage is confusing
> me.
> Metadata on sdb and sdc are 2 GiB, but on sdd (the new added device)
> is 4 GiB. And the 2. one that's confusing me, is that sdd has a "System"
> entry but sdb and sdc dosn't
>
> floyd@nas ~ $ sudo btrfs dev us /media/RAID/
> /dev/sdb, ID: 1
> Device size: 2.73TiB
> Data,RAID1: 2.11TiB
> Metadata,RAID1: 2.00GiB
> System,RAID1: 32.00MiB
> Unallocated: 628.49GiB
>
> /dev/sdc, ID: 2
> Device size: 2.73TiB
> Data,RAID1: 2.11TiB
> Metadata,RAID1: 2.00GiB
> Unallocated: 628.52GiB
>
> /dev/sdd, ID: 3
> Device size: 2.73TiB
> Data,RAID1: 792.00GiB
> Metadata,RAID1: 4.00GiB
> System,RAID1: 32.00MiB
> Unallocated: 1.95TiB
FWIW, there's also btrfs fi usage, which prints a somewhat different
layout of pretty much the same statistics. It may be useful to compare
output styles and choose the one you prefer. I prefer fi usage to dev
usage in most cases, but YMMV.
The key thing to remember about btrfs raid1 on more than two devices is
that it's exactly two copies, not N copies, where N is the number of
devices. In a three-device raid1, by definition, for each chunk that
will mean one copy each on two devices, with the third device not getting
a copy of that particular chunk, since btrfs raid1 is exactly two copies,
no more, no less.
So system is raid1, and sdb and sdd each have a copy of the (apparently
just one) system chunk, one copy each for two copies total, leaving no
system chunk to be placed on sdc, which is why it has none.
And, given the stats, there are 4 GiB of raid1 metadata chunks comprising
two copies of 2 GiB worth of metadata. Half that metadata has a copy
each on sdb and sdd, while the other half has a copy each on sdc and sdd.
IOW, sdd has a copy of all metadata, but sdb and sdc only have a copy of
half the metadata each.
Since the chunk allocator creates new chunks on the device with the most
available space, subject to the restriction that for raid1, there's two
copies and both copies cannot be on the same device, because sdd was
recently added and thus the one most empty, when you ran the metadata
balance, it created one copy of the raid1 two copies on the new device as
it had the most free space, and then had to select one of the other two
devices for the other copy. Since the other two devices were basically
evenly filled, it alternated, selecting one and then the other, so each
one got the second copy of half of the metadata, while the new device
with the most free space got the first copy of all metadata as it was
rewritten by the balance.
--
Duncan - List replies preferred. No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master." Richard Stallman
next prev parent reply other threads:[~2015-10-11 11:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-09 7:41 kernel BUG at /linux/fs/btrfs/extent-tree.c:1833! Peter Becker
2015-10-09 13:52 ` Henk Slager
[not found] ` <BLU436-SMTP5651E81A1B27D60895E652A9340@phx.gbl>
2015-10-10 19:23 ` Peter Becker
2015-10-10 19:48 ` Peter Becker
2015-10-11 11:10 ` Peter Becker
2015-10-11 11:16 ` Peter Becker
2015-10-11 20:49 ` Peter Becker
[not found] ` <15058e034a0.2785.faeb54a6cf393cf366ff7c8c6259040e@lesimple.fr>
2015-10-11 21:54 ` Stéphane Lesimple
2015-10-11 11:28 ` Duncan [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-10-11 21:04 Peter Becker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='pan$79537$59fa2bae$d82578cd$79406a63@cox.net' \
--to=1i5t5.duncan@cox.net \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).