Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Jan 2011 14:42:33 -0600
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Christer Solskogen <christer.solskogen@gmail.com>
Cc:        "O. Hartmann" <ohartman@mail.zedat.fu-berlin.de>, freebsd-questions@freebsd.org
Subject:   Re: FreeBSD 9/ZFS: Striped Pool (2 disks) migrating to mirror (onto additional disk)
Message-ID:  <20110126204233.GN75125@dan.emsphone.com>
In-Reply-To: <AANLkTimgbVvsFjc-FSdSoKe3cC6uNYNavvL1-WaCRSn4@mail.gmail.com>
References:  <4D3FDE82.4000105@mail.zedat.fu-berlin.de> <AANLkTi=udjU-MKEU%2BAHU2DyyLL3sMVcKbT3WsLGW7YTN@mail.gmail.com> <20110126195800.GM75125@dan.emsphone.com> <AANLkTimgbVvsFjc-FSdSoKe3cC6uNYNavvL1-WaCRSn4@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Jan 26), Christer Solskogen said:
> On Wed, Jan 26, 2011 at 8:58 PM, Dan Nelson <dnelson@allantgroup.com> wrote:
> > In the last episode (Jan 26), Christer Solskogen said:
> >> On Wed, Jan 26, 2011 at 9:42 AM, O. Hartmann wrote:
> >> > My question is: is it possible to migrate the two-disk pool without
> >> > data loss into a mirrored pool by adding the one 2TB-disk?
> >>
> >> No, you cant create a two-way mirror of three disks with ZFS. The only
> >> way of doing what you want by creating a gmirror (or by hardware raid)
> >> of the two 1TB disks.
> >
> > You can, if you partition the 2tb disk into two smaller volumes, each
> > the same size as one of the 1tb disks, then add one of those as a mirror
> > of each original disk.   You'll end up with two mirrored vdevs in the
> > pool.  Performance probably won't be as good as a real mirror, though,
> > since zfs doesn't know that two of its physical disks share a spindle.
> 
> Rememer that he also asked to do this without data loss. As far as I know
> you cant remove devices from a vdev.  If he is willing to accept data loss
> there are a lots of ways of doing it.

ZFS lets you add and detach mirrors on the fly, since you're not changing
the capacity of the pool itself.  Sure, you're going to lose the contents of
the large 2TB drive, but that's sort of assumed.  You can't convert 4TB of
non-mirrored disks into 2TB of mirrored disks without losing 2TB of space. 
Just make sure you have less than 2TB total used data on all volumes, and
copy the data off the 2TB filessytem onto the striped 1+1TB one before
repartitioning and adding the mirrors.

  zpool attach [-f] pool device new_device

    Attaches  new_device  to  an  existing  zpool  device.   The  existing
    device  cannot  be  part  of a raidz configuration. If _device_ is not
    currently part of a  mirrored  configuration,  _device_  automatically
    transforms  into  a  two-way  mirror  of _device_ and _new_device_. If
    _device_ is part of a two-way mirror, attaching _new_device_ creates a
    three-way  mirror,  and  so on. In either case, _new_device_ begins to
    resilver immediately.

(Do not confuse with zpool add, which adds a whole new vdev to the pool. 
vdevs cannot be removed once added)

-- 
	Dan Nelson
	dnelson@allantgroup.com



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