Copying files to new pool

gearhead

Contributor
Joined
Mar 6, 2013
Messages
137
I just bought two new drives to create a mirrored pool. I want to copy all files from existing pool to new one and subsequently retire the old drives. Is there a better way to achieve my objective than using the command cp -R -p * /mnt/tank2 (my old pool is /mnt/tank1).
 

Starpulkka

Contributor
Joined
Apr 9, 2013
Messages
179
rsync
im currently learning it for ssh transfers for encryption threat.
or do you need transfer snapshots the zfs send? edit: oh zfs replication better than just send snapshots
edit:2 lol replication in freenas gui is actually same as zfs send in console :)
 
Last edited:

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
ZFS snapshots will be WAAAAY faster and better. Snapshots are handled at the block level, so there's no possibility of there being a permission problem that denies access to actually copy the files to the destination. Additionally you keep all the file properties and such. rsync and cp have virtually every disadvantage.
 

gearhead

Contributor
Joined
Mar 6, 2013
Messages
137
Few years ago when I initially ask this question I did not use ZFS snapshot of my dataset to clone my dataset. I use the cp command. Now I have two brand new larger drives to the box. This time I am want to learn how to clone my data set to the new drives. so I created a new dataset on new drives. Then I went back to the dataset that I want to clone (it is called DataFiles). I clicked on create snapshot. A windows pops open giving two options. one option is recursive snapshot. What does it do? I didn't find any explanation in the manual? TIA
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
A windows pops open giving two options. one option is recursive snapshot. What does it do?
A recursive snapshot includes any child datasets of the dataset your taking a snapshot of. If your pool is tank, you have a dataset at tank/data1 and another at tank/data1/data2, a recursive snapshot of tank/data1 would also include tank/data1/data2.
 

gearhead

Contributor
Joined
Mar 6, 2013
Messages
137
I was able to successfully clone my dataset using snapshot it went very fast. However, the new dataset is compressed. Is there any performance hit with compressed datasets? are there any disadvantages with compressed datasets? TIA
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
are there any disadvantages with compressed datasets?
Not unless you're using woefully inadequate hardware. On any halfway-modern CPU, compression/decompression will happen much faster than the data can be read from disk anyway.
 

gearhead

Contributor
Joined
Mar 6, 2013
Messages
137
The senility is catching up with me. I can't remember how I cloned the snapshot to a new volume!! Any hints?
 
Top