replacing old RaidZ1 with a RaidZ2

Status
Not open for further replies.

TazgodX

Dabbler
Joined
Aug 1, 2012
Messages
21
Ok little backstory:
I started with 7 1TB drives in raidZ1. drives started failing, so i want to replace them with 2TBs. I decided i would rather have 8 2TB drives in raidZ2.
After waiting for shipments and messing with settings and BIOS and all the otehr BS i finally got FreeNAS to work and recognize all 15 drives. Now I would like to remove the 1TB drives after this is done and move them to another machine for a while so at the end I don't want them in the system.
current volume is mounted in /mnt/tank

So what I'm thinking I need to do is:
Create new Volume - RaidZ2 with new 8 drives mounted at /mnt/tank1
rsync from mnt/tank to /mnt/tank1 (sudo rsync -rltDvu /mnt/tank /mnt/tank1)
Detach tank, unplug drives
reboot
zfs set mountpoint=/mnt/tank tank1

Am i correct? am i missing anything? is there anything i should change to make it easier?

-Thanks for any help
 

bollar

Patron
Joined
Oct 28, 2012
Messages
411
Fundamentally it seems like you have a good plan. I would consider two things that will make this easier to do from within FreeNAS:

- I'd detach both pools using Storage: Active Volumes: Detach Volume. Make sure that you don't erase the disks (don't check the erase checkbox). This has the advantage of cleaning up the FreeNAS db and ensuring all data has been written to the zpools.

After your reboot, just do an auto import volume from that same screen and in a few seconds the zpool will be ready.

I'd also consider using zfs replication to copy the data, but since you're on the same system and you seem to be familiar with rsync, I think you can stick with your current plan.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
You could very easily do an rsync. If you want it to go faster you could do either a cp or mv from one to the other. rsync does need some CPU power for large copies of data, so you may change your mind when you see how slow it goes. I was only getting about 25MB/sec on an i7-920-2.66Ghz. Your steps pretty much are right on. I'd do a shutdown and then unplug the drives instead of a reboot. I just don't trust hot swap on FreeBSD from personal experience.

I highly recommend when you create the new zpool you check that pesky "4096 byte sector size" even if you don't have 4k sector drives. It's one of those things you might wish you had checked later on and you can't change it after the fact. There doesn't appear to be any downside to using it on a 512byte sector size drive, but there are benefits to using it on 4k sector drives.
 

TazgodX

Dabbler
Joined
Aug 1, 2012
Messages
21
Thanks noobsauce80,
I'd do a shutdown and then unplug the drives instead of a reboot.
I did mean i would shutdown and remove drives and boot back up.

as for the rsync, I was thinking about cp/mv/rsync options and just thought rsync would be the best. I don't need the speed as i don't need this box up right now. its already been down for almost a month, so no big hurry. I'll also be checking that 4k box now, wasn't 20 minutes ago.

Thanks bollar, Ill use your idea of detaching both volumes before the restart
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
I would just rename tank1 to tank. That makes more sense to me rather than just changing the mount point, i.e. it would annoy me.
 

TazgodX

Dabbler
Joined
Aug 1, 2012
Messages
21
I couldn't find a way to change the name to tank. Didn't look to hard to be honest. Can you share how to do that?
 

bollar

Patron
Joined
Oct 28, 2012
Messages
411
I couldn't find a way to change the name to tank. Didn't look to hard to be honest. Can you share how to do that?

I'm smiling. "Tank" needs to be replaced with the name of your zpool. It's a shortcut that Oracle uses frequently in their documentation.

From the command line, zpool import tank1 tank should work if done after an export.
 

TazgodX

Dabbler
Joined
Aug 1, 2012
Messages
21
thanks!
I actually decided to look it up. found this:

From the GUI
Export volume

Now from console/command line, assuming original pool was called tank.

zpool import tank NEW-NAME

you get an error saying the mountpoint doesn't exist, ignore it.
do a zpool status -v and verify your pool has been renamed
now do 'zpool export' again

Go back to the GUI

Storage -> Volumes -> Auto Import Volume
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
I personally would recommend rsync over cp/mv because if a copy/move fails, you end up with part of your files in one place, and part in another and no idea where it failed or if it copied a partial piece of a file etc..

The rsync command I would use is: rsync -av --partial --progress source-disk/ destination-disk/
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
I'm smiling. "Tank" needs to be replaced with the name of your zpool.
:confused: The OP used tank & tank1 in the first post.


The rsync command I would use is: rsync -av --partial --progress source-disk/ destination-disk/
+1


Now from console/command line, assuming original pool was called tank.

zpool import tank NEW-NAME
This part would replace the zfs set mountpoint in the above procedure. Easy enough to find once you looked for it, no?
 

TazgodX

Dabbler
Joined
Aug 1, 2012
Messages
21
Thanks everyone for the input. I have successfully swapped out my raidz1 for a raidz2!

Now for one last quick question. my raidz2 is 8 2TB drives. doing the math i should have 12TB unformatted storage, formatted with zfs i would assume a disk size of 11-12 TB. But it shows 10.1TBs. is this acceptable? or should I be looking into where that last TB went?

-thanks again!
 

bollar

Patron
Joined
Oct 28, 2012
Messages
411
10.1TiB (how disks are measured) is 11.1 TB, so considering overhead, it looks right.
 

dwoodard3950

Dabbler
Joined
Dec 16, 2012
Messages
18
I'd like to jump in here and ask more about your suggestion. I am trying to do something similar to tasgodx. I have a 4-drive pool and I want to change the ZFS type. To do this, I was going to use zfs send/receive to move to a temporary pool made of up a collection of usb drives. One I successfully send it to these drives, I was going to detach and erase the existing pool. After this step, it seemed I would be able to create a new pool of the desired type and then use zfs send/reeive to pull from the temporary pool. However, I'm confused at how the snapshots are used when doing this with the zfs send/receive. I have done the following;
This is what I started with;
tank/jail@manual-20121219 29.6M
tank/jail@now 651K
tank/jail@01 0

zfs send tank/jail@01 | zfs receive -Fd tnew

but there not exactly the same as shown below
tank/jail 512M 146G 481M /mnt/tank/jail
tnew/jail 473M 462G 473M /mnt/tnew/jail

My question is now, if I detach the original "tank" and erase drives, will I get what I'm expecting? Also, I did set the readonly option on the source pool.
 
Status
Not open for further replies.
Top