Want to recreate array, best way to backup and restore?

Status
Not open for further replies.

palmboy5

Explorer
Joined
May 28, 2012
Messages
60
I currently have a volume made of two RAIDZ1 arrays of four 2TB drives each. I want to change it to a single RAIDZ2 array of eight 2TB drives. The volume is still using less than 5TB so I got three 3TB drives (in RAIDZ1) to back up into in order to recreate the array.

I know I can just do a basic file copy, but is there an easy way to maybe clone the ZFS (including snapshots) onto the array of 3TB drives?

Thanks!
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
That's basically what replication is about. If you want the easiest path, set up a second FreeNAS box with your 3x3TB, replicate your existing stuff over, rebuild the first box, then replicate back.
 

palmboy5

Explorer
Joined
May 28, 2012
Messages
60
I see, I found the replication page but it is only showing one of my five datasets to choose from... http://i.imgur.com/LCA9W.png

Is that normal? EDIT: Nevermind I see that it only shows datasets with periodic snapshots.

I've also already connected the three 3TB drives to the server (they are all on the same system) in order to avoid a gigabit ethernet bottleneck. Would it work to basically set the "Remote hostname" to the server's own IP (or 'localhost') or is that a stupid idea?

EDIT: Would this replication functionality have an issue with the fact that the receiving array is smaller in capacity, but bigger than the amount of actual data?
 

Dan101

Dabbler
Joined
Aug 15, 2012
Messages
22
I'm a newbee but by doing it this way, it seems you are trying to save having to build a 2nd system. Down side of that is that you can't test that your 3X3TBs are working independently. And I assume you plan to rebuild then replicate back.
 

palmboy5

Explorer
Joined
May 28, 2012
Messages
60
I did put the 3TB drives in a second system in order to run WDIDLE3 /s300 on them (they're Western Digitals and like to park their heads after 8 seconds, changed that to 5 minutes). Afterward, I ran FreeNAS on the second system as well and did try doing ZFS Replication but it didn't work too well on the web management. I see that all it does is use zfs send and zfs recv through an SSH tunnel, which I got to work manually... but hey...

http://docs.oracle.com/cd/E19963-01/html/821-1448/gbchx.html

Running those commands is even simpler if they're on the same system - since that just removes the SSH factor. All I need to do is run commands like:
Code:
# zfs send tank2/main@20120831 | zfs recv tank1/main@20120831


Which I'm almost done doing. :)
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
I did put the 3TB drives in a second system in order to run WDIDLE3 /s300 on them (they're Western Digitals and like to park their heads after 8 seconds, changed that to 5 minutes). Afterward, I ran FreeNAS on the second system as well and did try doing ZFS Replication but it didn't work too well on the web management. I see that all it does is use zfs send and zfs recv through an SSH tunnel, which I got to work manually... but hey...

http://docs.oracle.com/cd/E19963-01/html/821-1448/gbchx.html

Running those commands is even simpler if they're on the same system - since that just removes the SSH factor. All I need to do is run commands like:
Code:
# zfs send tank2/main@20120831 | zfs recv tank1/main@20120831


Which I'm almost done doing. :)

Yes, but be very careful, the problem with this sort of operation is that since all your eggs are in one basket, any inadvertent screwup results in unhappiness. That's part of why I referred to the suggestion I made as an easier path.
 

palmboy5

Explorer
Joined
May 28, 2012
Messages
60
You mean if I accidentally destroy the wrong array in order to rebuild? Or that the system suddenly dies? I did what you said except all on one system, so you must be referring to two system vs one system. But whats the real risk?
Best case I have two separate arrays with identical data, worst case I have one array with my data, neither cases are worse than before I got the 3TB drives.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
But whats the real risk? (...) worst case I have one array with my data

You've misidentified the worst case. The worst case is that something unexpected happens:

1) There's a bug in FreeNAS,

2) There's a PEBCAK issue,

3) There's some other random unpredictable event

and you're left with zero arrays with your data. That's why those of us who do this professionally are careful to try to pick the best technologies, then remain paranoid and extra cautious on top of that, not relying on the technology to be foolproof if we can reasonably avoid such reliance.

Two NAS boxes provides more compartmentalization and less opportunity for "oops." You have to remember, especially if you're trying to work through the GUI, that the codepaths you are testing have not undergone what I would consider to be thorough testing. The guys who are writing this stuff are good, but bugs creep in, and you know, if someone who was writing the code to manipulate volumes inadvertently used "volume[0]" rather than "volume[n]" in the code, it could appear to work fine to many people who never had a second volume, yet you, in your situation, when you try to blow away volume[1], well... let's just say I've seen train wrecks of many varieties over the years.

Can you do it on a single box? Sure. It's even likely to work. But think about what happens if something goes wrong. What if FreeNAS won't let you destroy the second volume? Could you be left with a mess? Quite frankly, things like that are less likely to happen if you do the two-NAS route, because the first NAS's configuration is put into its final configuration before you start restoring data to it.
 

Dan101

Dabbler
Joined
Aug 15, 2012
Messages
22
That's really good advice. I've really learnt something here.:cool:
 

palmboy5

Explorer
Joined
May 28, 2012
Messages
60
Understandable, and here's a kicker, I did it on 8.2.0 BETA3 :P

While compartmentalization does reduce risk, all three of your points can still happen. I don't see the difference in likelihood to be big enough to act upon, and I had previously played around a lot with my newer set of 4x2TB creating different arrays on the same system, before finally adding the drives to the original 4x2TB. Bigger risk back then I suppose, but it worked out. Of course as a precaution I had backed up my critical files to my PC before doing anything. If ALL of my data was deemed critical, like an amount I couldn't fit on my PC, I probably would have compartmentalized like you suggested.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
It's your choice, of course. But the question included the words "best way," and generally speaking, my impression is that it provides an additional layer of safety.
 
Status
Not open for further replies.
Top