Mirror to RaidZ2

Status
Not open for further replies.

Avocation

Cadet
Joined
Dec 19, 2014
Messages
9
Hi All,
I have an existing FREENAS box with 1x500GB and 1x1TB running in a RAID1 MIRROR.

I have an additional 3x1TB drives to go into the box.

I would like to setup a RAIDZ2 arrangement but need to utilise the existing 1x1TB drive in the utilised MIRROR to get the Z2 parity.

What options/steps would you take to achieve this?

My intention currently is to try and copy everything off to an external drive, break the mirror to pinch the 1Tb drive back, build the RAIDZ2 pool with the 4x1TB drives and then copy everything back into the NAS. The complexity of having data in a PLEX jail and the copying out, then creating the new jail in the new pool and copying back sounds time consuming though....

All help gratefully received.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Your basic idea sounds good. I'd suggest refining it, though, by using ZFS replication from the old (degraded) pool to your new pool, and then renaming the new pool to the old pool's name. Replication will duplicate all your datasets, jails, and properties on the new pool, and once you've renamed the new pool to the old pool's name the jails should just work. Here's an outline of the process:

  1. Back up the data
  2. Break the mirror
  3. Wipe the used 1 TB disk
  4. Create newpool from the GUI using your four 1 TB disks in RAIDZ2
  5. Replicate the data from oldpool to newpool (https://forums.freenas.org/index.php?threads/how-to-copy-one-pool-into-another.16653/#post-120073)
  6. Detach oldpool from the GUI, and remove the disk
  7. Detach newpool from the GUI
  8. From the CLI, zpool import newpool oldpool -- This is the step that renames the new pool to the old pool's name
  9. From the CLI, zpool export oldpool
  10. From the GUI, auto-import the new pool.
 

Avocation

Cadet
Joined
Dec 19, 2014
Messages
9
Many thanks danb35, didn't know you could do that and it'll save me a lot of effort.
 

Avocation

Cadet
Joined
Dec 19, 2014
Messages
9
How would you go about making a backup of the data in the MIRROR to an external USB drive? (mine is called da1)

Is there a CLI command that will take the whole lot over, or some option in the GUI at all?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
There are a number of ways to do it. Probably the simplest, once the USB drive is formatted and mounted, would be 'cp -a /mnt/oldpool/ /mnt/usb/' If you want some indication of what's going on, change the option flag to -av.

Or, if you've created a ZFS pool on the USB disk, you could use replication there too. I think cp would be faster, but replication would preserve the datasets and everything, in case you needed to restore from there.

I think some kind of GUI file manager would be good to have, but the FreeNAS devs don't seem to like that idea enough to prioritize it.
 

Avocation

Cadet
Joined
Dec 19, 2014
Messages
9
Hmmm!

Tried to copy to the USB HDD which has 600GB free but it says it's full.

It's an NTFS file system which means I can't write to it....?

Can i re-partition the free space and format into a file system FREENAS will write to?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Yes, you should be able to partition the disk and format a partition that FreeNAS will write to. What version of FreeNAS are you running? In 9.2.1, there's r/w support for UFS, FAT, and ext2. Not sure if this is different under 9.3. FAT doesn't support files larger than 2 GB, though, which may be a limitation for you.
 

Avocation

Cadet
Joined
Dec 19, 2014
Messages
9
Your basic idea sounds good. I'd suggest refining it, though, by using ZFS replication from the old (degraded) pool to your new pool, and then renaming the new pool to the old pool's name. Replication will duplicate all your datasets, jails, and properties on the new pool, and once you've renamed the new pool to the old pool's name the jails should just work. Here's an outline of the process:

  1. Back up the data
  2. Break the mirror
  3. Wipe the used 1 TB disk
  4. Create newpool from the GUI using your four 1 TB disks in RAIDZ2
  5. Replicate the data from oldpool to newpool (https://forums.freenas.org/index.php?threads/how-to-copy-one-pool-into-another.16653/#post-120073)
  6. Detach oldpool from the GUI, and remove the disk
  7. Detach newpool from the GUI
  8. From the CLI, zpool import newpool oldpool -- This is the step that renames the new pool to the old pool's name
  9. From the CLI, zpool export oldpool
  10. From the GUI, auto-import the new pool.

Hi Danb35,
At step 6 above - do you also select 'Delete all shares related to this volume?' or do you keep these as we'll be renaming the newpool to this old pool's name?
 

Avocation

Cadet
Joined
Dec 19, 2014
Messages
9
Thanks danb35, without your help it would have taken me days to figure this out.

All migrated and now have close to 2Tb of RAIDZ2 storage which is a big improvement on my 500Gb of RAID1. Good for a little while again.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Great! Glad to know it worked well for you. I'll be making a similar migration shortly--I just installed 6 x 4 TB WD Reds in my server. Once they finish testing, I plan to set up RAIDZ2 on them, migrate data from my existing pool, and then add the old disks back to the pool as a second RAIDZ2 vdev. Hopefully that'll give me enough space for a little while...
 
Status
Not open for further replies.
Top