Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 Nov 2012 20:23:43 -0700
From:      Freddie Cash <fjwcash@gmail.com>
To:        Fox F <fox@cyberfoxfire.com>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: Convert standalone zpool to RAID1 with data in place
Message-ID:  <CAOjFWZ4duNemmfSez9P7O1ppyBhLs8Bn-2aUX_E6fVq36F7Z0w@mail.gmail.com>
In-Reply-To: <50955FB1.2070800@cyberfoxfire.com>
References:  <50955FB1.2070800@cyberfoxfire.com>

next in thread | previous in thread | raw e-mail | index | archive | help
You don't. At least, not in that order. Or, at least not with the
ZFS-native tools.

You can create a pool with 2 separate single-disk vdevs, and data will be
striped across them. Similar to RAID0, there will be no redundancy to the
pool.
    zpool create poolname disk1 disk2

Later, you can convert the single-disk vdevs to mirrors, thus turning the
pool into a RAID10:
    zpool attach poolname disk1 disk3
    zpool attach poolname disk2 disk4

Or, you can create a pool with a single mirror vdev:
    zpool create poolname mirror disk1 disk2

Later, you can add another mirror vdev to the pool, and data will be
striped across the two vdevs, similar to a RAID10:
    zpool add poolname mirror disk3 disk4

If you are truly hell bent on doing things in the other order (mirror on
top of two stripesets), then you have to use gstripe(8) to create the
stripesets, and then add those to the pool. The following is from memory,
so it may not be perfectly correct:
    gstripe label stripe1 disk1 disk2
    gstripe label stripe2 disk3 disk4
    zpool create poolname mirror stripe/stripe1 stripe/stripe2

On Nov 3, 2012 11:17 AM, "Fox F" <fox@cyberfoxfire.com> wrote:
>
> Hello,
>
> My intention is to have a zpool with two drives (1TB and 2TB) striped. I
suppose I'd create it as such:
>
> zpool create zp_test disk1 disk2
>
> I would then create a zfs filesystem on that zpool and add data to it.
>
> Then, I would want to mirror this data on another identical striped vdev.
>
> The question is, what is the order of operations for creating the second
striped vdev and adding it as a mirror to the first one, and how do I do
that in such a way that the data on disk1/2 gets mirrored to the new
addition?
>
> I hope I am making sense.
>
> -F
> _______________________________________________
> freebsd-fs@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-fs
> To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOjFWZ4duNemmfSez9P7O1ppyBhLs8Bn-2aUX_E6fVq36F7Z0w>