Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 05 Nov 2012 12:28:41 -0600
From:      Fox F <fox@cyberfoxfire.com>
To:        Steven Hartland <killing@multiplay.co.uk>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: Convert standalone zpool to RAID1 with data in place
Message-ID:  <50980559.3050306@cyberfoxfire.com>
In-Reply-To: <A5FD9F70AF7149908E6945C3D32CE703@multiplay.co.uk>
References:  <50955FB1.2070800@cyberfoxfire.com> <CAOjFWZ4duNemmfSez9P7O1ppyBhLs8Bn-2aUX_E6fVq36F7Z0w@mail.gmail.com> <5097FB86.9050008@cyberfoxfire.com> <A5FD9F70AF7149908E6945C3D32CE703@multiplay.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
On 11/5/2012 11:53 AM, Steven Hartland wrote:
> ----- Original Message ----- From: "Fox F" <fox@cyberfoxfire.com>
>
>> I did forget one point to have clarified.
>>
>> Forget the striping. Let's just assume two disks, 1 and 2.
>>
>> I only have disk1 on hand. So I create a zpool/zfs with it.
>>
>> # zpool create mypool disk1
>> # zfs create mypool/repository
>>
>> Then some data is put on the zfs. Now, I want to convert mypool to a 
>> mirror with disk2, while keeping the data on disk1 intact. Is there a 
>> way to do that?
>
> Yes off hand you want "zpool attach mypool disk1 disk2" more details in
> "man zpool"
>
>    Regards
>    Steve
>
> ================================================
> This e.mail is private and confidential between Multiplay (UK) Ltd. 
> and the person or entity to whom it is addressed. In the event of 
> misdirection, the recipient is prohibited from using, copying, 
> printing or otherwise disseminating it or any information contained in 
> it.
> In the event of misdirection, illegible or incomplete transmission 
> please telephone +44 845 868 1337
> or return the E.mail to postmaster@multiplay.co.uk.
>
Alright, I think I got it!

"zpool attach" adds a new device to an existing one as a mirror, whereas 
"zpool add" adds it as a stripe.

For example,

# zpool create mypool disk1

I now have a single vdev pool.

# zpool add mypool disk2

I now have a striped two-disk pool.

# zpool attach mypool disk1 disk3

Now, I have the following:

mypool
     mirror-0
         disk1
         disk3
     disk2

FINALLY, if I want to add disk4, I would say,

# zpool attach mypool disk2 disk4

which would give

mypool
     mirror-0
         disk1
         disk3
     mirror-1
         disk2
         disk4

Which would give me what I need. So to Freddie, this is exactly what you 
recommended, and fortunately will work for my circumstances. I guess 
what confused me was how attach vs. add work, and the resulting disk 
layout. Now, after some testing on my server, I see how it all works. 
Thanks for the education.






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