Moving many large files to different data set.

Status
Not open for further replies.

Joey S

Dabbler
Joined
Nov 29, 2015
Messages
16
I just set up my freenas box. I played around with volumes and data sets and thought I had everything squared away so I copied about 1tb worth of data over to the nas. Well, now I am realizing I should have separate data sets for different types of data. I created a new data set and tried to move the files from one folder to another folder within the data set using OS X finder and it crashed. So I did some searching on the forum and found a post recommending I use the command line within freenas to move the data and that didn't work for me. I must have gotten the syntax wrong because it gave me a bunch of errors. This is the code I tried to follow:
Code:
zfs send -Rv JoeysNAS@copy | zfs receive -F JoeysNAS/JoeysFiles


I am bit confused on the whole volume/data set thing because I thought the top level was the volume and the next level was a data set. I tried to create a second data set on the same level as my first data set, but it would only let me create a data set "under" my original one. See the attached photo.
storage.jpg


So to sum up, my main questions is: How can I move 1TB worth of data from one folder/data set to another without having to copy the files again?

Hardware:
ASRock C2750D4I
16GB Crucial DDR3 ECC Ram
3x 4TB Seagate NAS HDDs
 

Fei

Explorer
Joined
Jan 13, 2014
Messages
80
Hi

can you check your snapshot has your data?
if yes, you can follow command as below:
Code:
zfs send JoeysNAS@copy | zfs recv -F JoeysNAS/JoeysFiles
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Certainly you can use zfs replication to transfer the data, but in this case I think mv is the much simpler solution. Be aware, though, that since datasets are considered separate filesystems, mv will copy the data, apply the same ownership/permissions to the copy as the original, and then remove the original--it isn't the near-instantaneous mv that it would be if the source and destination were on the same filesystem.
 

Fei

Explorer
Joined
Jan 13, 2014
Messages
80
Certainly you can use zfs replication to transfer the data, but in this case I think mv is the much simpler solution. Be aware, though, that since datasets are considered separate filesystems, mv will copy the data, apply the same ownership/permissions to the copy as the original, and then remove the original--it isn't the near-instantaneous mv that it would be if the source and destination were on the same filesystem.
Hi danb35

If he has much file(ex:10 million file), use mv will cost much resource(ex:memory) and performance very slow,right?
 

Joey S

Dabbler
Joined
Nov 29, 2015
Messages
16
Hi

can you check your snapshot has your data?
if yes, you can follow command as below:
Code:
zfs send JoeysNAS@copy | zfs recv -F JoeysNAS/JoeysFiles
Hi. thanks for your reply. I checked the snapshots tab in storage and found only two snapshots. both of them were from the jails dataset. So I think the answer to your question is no, my snapshot does not have my data.

For now, I used mv and that seemed to work. It did take hours to complete though:(. I would like to know for future reference if your method would have worked? It sounds like I would have needed a snapshot of the data?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
The method @Fei suggested certainly would have worked. Since you don't have a snapshot currently, you'd just need to create one first at the Storage screen. Then do the ZFS send, and once you're sure the data has made it over properly, delete the original files and the snapshot. I doubt it would take any less time though.
 
Status
Not open for further replies.
Top