How do I convert RAIDZ1 to RAIDZ2 via a temporary drive?

Status
Not open for further replies.

JprSA

Cadet
Joined
Dec 18, 2014
Messages
9
I posted this question to ServerFault and was met with deafening silence. If this is something that is regularly asked and I just haven't been able to find the answer then I apologise but oh boy have I looked!. The question in its entirety is:

How do I copy a zpool to a temp drive while ensuring it is a complete enough copy to push back onto a new zpool. Also how do I push it back if it's not simply the reverse of the original copy.

I set up a new server a few months ago and set it as RAIDZ1. I'm re-thinking that decision and would like to grab an extra drive and move to RAIDZ2. Before everyone replies that this isn't possible with ZFS I'd like to point out that I know it's not directly possible. I've been searching docs for days but there doesn't seem to be a set of instructions for how to do this manually. I believe I'll need to:

  1. Move the entire pool onto a drive big enough to hold the used space
  2. tear down the existing pool.
  3. build a new pool using the extra drive in raidz2
  4. Move the data back into the pool.
Doesn't seem too tricky but I'm not famliar enough with ZFS or FreeBSD to trust that I successfully achieved step 1. I'm not entirely sure about step 4 either but that can be retried, while messing up the first step would not be fun. My reading suggests that rsync is the way to go to effectively clone a drive but I want to be sure that what I copy is exactly the same as the source, including system/hidden files, symlinks, jails, etc, etc. The OS is running off mirrored flash drives which won't be changing and ideally they wouldn't even notice anything had changed at next boot (e.g. all jails start up as before). Does copying/cloning the pool/drives also move partition information? Will FreeNAS recreate these or will I need to manipulate them manually.

I'm running FreeNAS 9.3 and have 3x3TB HDD in a single raidz pool. I would like to end up with 4x3TB in raidz2. The current pool is using 1.3TB of space and I have an external 2TB drive for temp storage. It's not mission critical if data is lost.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
I'd recursively replicate the whole pool onto the temporary drive. Then do the same in the reverse direction.

I'd also definitely burn-in the temp drive before going ahead with this, to make sure it's working properly.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
The zfs send and zfs receive commands are probably your best bet. If you use rsync you'll be able to copy the data but that won't preserve the structure of the datasets.
 
Status
Not open for further replies.
Top