4 DISKS RAIDZ2 to 6 DISKS RAIDZ2

Status
Not open for further replies.

Asimov1973

Dabbler
Joined
Nov 23, 2013
Messages
49
Hello,
I actually have a 4 disk RAIDZ2 pool (4.08Tb on 5.08Tb available)

I wold like to:
1) backup all the pool (composed by various dataset with different permissions ) to cloud or external hdd
2) destroy the 4 disks RAIDZ2 pool
3) create a 6 disks RAIDZ2 pool
4) restore my backup composed by various datasets back to my new and amazing 6disk pool

Could somebody indicate the easiest way to do that? I'm willing to borrow a 4TB external Hard drive or wait 20 days to backup on cloud. I don't have capped internet because I live in Luxembourg where everybody do what he wants without legal consequences and my upload speed is 50Mbps.

I'm not willing to :
1) buy another $1500 NAS and use replication
2) renounce to my idea
3) buy another 4 disks and stripe and/or create a raid60
4) I already fight with my wife for buy 2 extra disks and that's all that I'm allowed to buy for the next 6 months (and no....I cannot buy anymore food either)


Thanks!
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
You can always create a pool on the 4 TB drive and replicate to it, no need of an second server ;)

Because I don't see how you can keep the dataset structure and permissions without using ZFS replication... so because of 2) you'll be obliged to use replication.
 

Asimov1973

Dabbler
Joined
Nov 23, 2013
Messages
49
So basically:

1) I connect a 4 TB drive to my NAS Mainboard
2) I enter in the NAS GUI creating a pool (let's call it POOL2 on this 4 TB drive)
3) I replicate my 4DISK RAIDZ2 pool (let's call it POOL1) on POOL2
4) I detach the 4TB drive
5) I add 2 more disks to my NAS
6) I destroy my 4DISK RAIDZ2 POOL and I create a new 6DISK RAIDZ2 POOL
7) because I only have 6 sata ports on my NAS mainboard I cannot connect directly my 4TB drive to the NAS
8) I connect my 4TB DISK to a PC in the same LAN where my NAS is
9) what now?
 

Asimov1973

Dabbler
Joined
Nov 23, 2013
Messages
49
wait ....could I reconnect the 4Tb drive to a free USB port on my NAS using a SATA to USB adapter and restore my backup?
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
You can't mount a pool with the drive over the LAN but USB should work. However ZFS over USB isn't that reliable so just use it to transfer the data and that's all. If anyone has a better idea he's welcome ;)

I recommend you to do another "normal" backup (just a copy, not using replication) just in case (but you should already have a backup elsewhere, so...).

Also, don't put the 4 TB drive on the edge of a desk (it's often where the external drives are, just before they end up on the ground...) because if it falls before you've copied the data back you'll don't like the result... :)
 
Last edited:

Asimov1973

Dabbler
Joined
Nov 23, 2013
Messages
49
Thanks for the help!
 

mjws00

Guru
Joined
Jul 25, 2014
Messages
798
Yumm. 4TB over likely USB 2.0. Unless you have a rare board.

If you wanted a little hacky speed. Borrow that drive. Plug it in to the sata port. Create the backup pool. Replicate to it. TEST. Pull that drive. Build your new 6 drive Z2 pool in the GUI. Shut down and swap out any drive for your backup drive. The new pool will be degraded but still one drive redundant.. and since it is new who cares. Replicate the Backup pool to the new pool. Shutdown. Plug in the missing pool drive and restart. Your sixth drive will resilver happily. Everything done at max speeds with no sitting around to monitor.

Sorry no time to type commands. But if I'm moving 4TB nothing but full drive speed is adequate, imho. Also, I am impatient. ;)
 
Last edited:

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
Very good idea ;)
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
Two more options:
  1. Purchase a PCIe eSATA adapter and a drive dock to house the backup drive. Do zfs send | zfs receive replication and restoration over eSATA instead of USB.
  2. zfs send your snapshot over gigabit LAN to any available storage destination, e.g. a Linux box running an SSH server. When you zfs send a snapshot, you're just generating a *nix data stream, so the destination doesn't have to be a ZFS filesystem. Then you can later zfs receive the snapshot from the same location.
Whatever approach you choose, be sure to practice first. My preference would be to replicate to a ZFS mirror or otherwise have two copies, since you've gone to a lot of trouble to keep your data safe on a RAIDZ2 pool and it would be a shame to lose it to a single drive failure.

Note that 4.08TB of pool data isn't going to fit on a 4TB hard drive.
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
So in theory you can simply pipe the output of zfs send to netcat and at the other end pipe it to a file to write it where you want? interesting :)
 

Starpulkka

Contributor
Joined
Apr 9, 2013
Messages
179
For esata, i would not dare to recommend it. I almost lost all 3+3TiB data by using esata dockinstation.
Or just member ALWAYS shutdown machine before you physically mount/dismount that esata hdd.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
For esata, i would not dare to recommend it. I almost lost all 3+3TiB data by using esata dockinstation.
Or just member ALWAYS shutdown machine before you physically mount/dismount that esata hdd.
I've done this successfully several times, using an eSATA adapter with a well-supported chipset, a pass-through drive dock (no port multiplier), and scrubbing the resulting mirror before proceeding. My dock has individual power buttons for each drive and I did not find it necessary to shut the machine down before powering off the drives. Do make sure the pool is detached before powering anything off, regardless of the setup.
 

Starpulkka

Contributor
Joined
Apr 9, 2013
Messages
179
I've done this successfully several times, using an eSATA adapter with a well-supported chipset,
Good for you. I have done this on my amd machines 1000´s times with no broblem. Then i once build 2000€ intel server and boom, in 2min i got 3 hdd with same serials and smart data and mbr. Im never ever going to trust those esata chip whats in inside of intel chipset motherboard.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
So in theory you can simply pipe the output of zfs send to netcat and at the other end pipe it to a file to write it where you want? interesting :)
I haven't used netcat with zfs send, but I have piped its output to a file. Any way you could save that data stream (maybe to an NFS-mounted directory?) would work--zfs send > somewhere, then zfs recv < somewhere.
 

Asimov1973

Dabbler
Joined
Nov 23, 2013
Messages
49
Hello, I decided to purchase an 8TB sata disk for the backup, but I'm struggling with the commands.

What I've done until now is to simulate the backup on a VM before to damage my FREENAS.

so I setup a VM with 4 disks, I created a raidz2 called RAIDZ2 and inside it I created few dataset.
I added then another virtual disk creating a new volume calling it BACKUP and I gave the following commands from the shell

su
rsync -v -a -z /mnt/RAIDZ2/ /mnt/BACKUP/

now if I type cd/mnt/BACKUP and then ls I see that the dataset from RAIDZ2 were copied, but if I use the GUI and I go in storage --> volumes I don't see the new datasets in the BACKUP volume....why?
 

Asimov1973

Dabbler
Joined
Nov 23, 2013
Messages
49
OK I found (Maybe) the solution:

assuming the two pools are mounted (imported) into your machine, and the pool you want to copy to is empty: If it's not empty, I suggest you detach and erase that pool and restart from scratch.

First, go into the GUI into the Storage screen, and select the pool you want to copy from.
Click at the bottom of the screen: "Create Snapshot" , make sure "Recursive Snapshot" is checked. Use the default snapshot name, or create your own: but whichever you do, write it down.

Now, open a shell to the box, either ssh to it, or use the console (don't use the web GUI Shell)
I assume the first pool is named pool1 (the one you want to copy from) and the second pool is named pool2 (the one you want to copy to)

Type:
zfs send -Rv pool1@snapshot_name | zfs receive -Fdu pool2

replace "snapshot_name" with the name of the snapshot you've just done.

Now go and do something else, it make take a while


It seems to have worked fine in my VM test machine, although I noticed that the datasets size in KB in the BACKUP are more little than in the original datasets in RAIDZ2....

P.S. when I will create the snapshot before the ZFS send...how much space will this snapshot need? I have 4 TB of data and 1TB free....
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Yes, this is the solution. Snapshots don't take any space at all until the underlying dataset changes--when it does, they take the space of that change. If you take a snapshot of a dataset, then change 100 MB of data in that dataset, the snapshot will take about 100 MB.

The reason rsync didn't do what you want is because rsync doesn't know anything about ZFS, and therefore about datasets. It copied your data just fine, but created directories rather than datasets.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Yes, this is the solution. Snapshots don't take any space at all until the underlying dataset changes--when it does, they take the space of that change. If you take a snapshot of a dataset, then change 100 MB of data in that dataset, the snapshot will take about 100 MB.

The reason rsync didn't do what you want is because rsync doesn't know anything about ZFS, and therefore about datasets. It copied your data just fine, but created directories rather than datasets.
Well, they do require a little bit of metadata, but it's negligible.
 

Asimov1973

Dabbler
Joined
Nov 23, 2013
Messages
49
Hello, I used the zfs send -Rv pool1@snapshot_name | zfs receive -Fdu pool2 to copy my pool to 1 disk 8TB.
The copy process went smooth (I copied 4.15TB in 7h30m...) the problem is that if I browse the BACKUP pool I find that many
datasets have permissions empty....and doesn't matter how much I try to change they revert always to blank!
here a screenshot:
 

Attachments

  • empty_permission_on_replicated_vol.JPG
    empty_permission_on_replicated_vol.JPG
    201.1 KB · Views: 263

Asimov1973

Dabbler
Joined
Nov 23, 2013
Messages
49
There is a way to copy permissions too with the zfs send and zfs receive? I would like to see the BACKUP exactly as the original volume before destroying it for adding disks...do you guys experienced that already?
 
Status
Not open for further replies.
Top