From: Chris Mason <chris.mason@oracle.com>
To: Yan Zheng <yanzheng@21cn.com>
Cc: Chris Samuel <chris@csamuel.org>, linux-btrfs@vger.kernel.org
Subject: Re: multiple device usage
Date: Tue, 30 Dec 2008 16:25:08 -0500 [thread overview]
Message-ID: <1230672308.4229.6.camel@think.oraclecorp.com> (raw)
In-Reply-To: <3d0408630812290716i5ac68b27i17fe35891706e449@mail.gmail.com>
On Mon, 2008-12-29 at 23:16 +0800, Yan Zheng wrote:
> 2008/12/29 Chris Samuel <chris@csamuel.org>:
> > Hello Yan,
> >
> > On Mon, 29 Dec 2008 11:33:18 pm Yan Zheng wrote:
> >
> >> 2008/12/29 Chris Samuel <chris@csamuel.org>:
> >>
> >> > The rebalancing code does appear (from a naive read of the code) to be
> >> > able to rebalance over stripes, but I have no idea if the disk format
> >> > currently supports changing that on the fly.
> >>
> >> The rebalancing moves data/metadata to newly created chunks. If there
> >> are two devices, the new chunks will be set up as RAID-1 by default.
> >
> > Very interesting! I didn't realise that - I was presuming that the
> > BTRFS_BLOCK_GROUP_RAID1 ioctl needed to be passed through (as at mkfs time) to
> > change it into a RAID1 array.
> >
>
> See __btrfs_reserve_extent and __btrfs_alloc_chunk. There is a mistake in
> my previous reply. Only metadata chunks are set up as RAID-1 by default
> when there are two devices.
This gets confusing in a hurry, but the idea is to duplicate metadata by
default. So, if you're using the default mount options on a single
drive and add a second drive, it should switch metadata to raid1.
I've always planned on adding an option to btrfs-vol -b to have it
change the data or metadata allocation policies (raidX to raidY,
restripe etc). The kernel side code is all there, we just need
something to wire it up to userland.
data duplication on a single spindle could work, I just haven't hooked
it up because I couldn't think of a really strong reason to do it ;)
-chris
next prev parent reply other threads:[~2008-12-30 21:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-26 23:15 multiple device usage devzero
2008-12-27 2:44 ` Yan Zheng
2008-12-27 14:12 ` Roland
2008-12-28 13:26 ` yanhai zhu
2008-12-29 10:49 ` Stephan von Krawczynski
2008-12-29 12:31 ` Roland
2008-12-29 12:35 ` Yan Zheng
2008-12-30 21:43 ` Chris Mason
2008-12-27 6:45 ` Chris Samuel
2008-12-29 11:32 ` Chris Samuel
2008-12-29 12:33 ` Yan Zheng
2008-12-29 12:52 ` Chris Samuel
2008-12-29 15:16 ` Yan Zheng
2008-12-30 21:25 ` Chris Mason [this message]
2009-01-01 1:02 ` Chris Samuel
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=1230672308.4229.6.camel@think.oraclecorp.com \
--to=chris.mason@oracle.com \
--cc=chris@csamuel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=yanzheng@21cn.com \
/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