SOLVED Need help to Copy files from NTFS drives to ZFS drives using CLI commands?

Status
Not open for further replies.

new2freenas

Dabbler
Joined
Feb 22, 2013
Messages
11
Hello all,

First things first: I’m a newbie to both Linux and Unix/FreeBSD…so my knowledge, exposure and experience to both of those OS’s are at the infancy stages. Please be gentle, where and if possible.

Okay, with that out of the way…here’s the thing:

Using the web GUI (on a Windows machine) I’ve been trying (for the past few days) to copy files over from my NTFS formatted drives to the ZFS formatted drives…but I keep having network issues/losses (when trying to copy even just 2 or 3 folders at a time).

I thought maybe this issue wouldn’t arise if I use the CLI instead, but since I’m a newbie in this area, I have no idea how to do this, and therefore I reach out for help. I’ve done some searches, but what I’ve found doesn’t seem to help me much (because it’s a bit more advanced, and doesn’t contain a scenario such as mine).

So, using the following picture (of my Disks, as setup in FreeNAS GUI) , I’ll try to explain my scenario below the picture:

v3hhn7.jpg


1. The first 3 entries are for disks which are physically installed “inside” the case. The last entry is a 500 GB pocket USB drive, which is connected via a USB cable.

2. The first and last entries (where Status shows as “UNKNOWN”) are both NTFS drives, whereas the 2 middle entries are for ZFS drives (Status=”HEALTHY”).

3. The disk that’s listed first (NTFS, with Volume Name=”ada3s1”) contains a few movies which I would like to (temporarily) copy to the disk that’s listed third (ZFS, with Volume Name=”ZoneMinderVol”).

4. The disk that’s listed last (NTFS, with Volume Name=”aData500”) contains music (MP3’s) and Pictures (JPG’s) which I would like to copy to the disk that’s listed second (ZFS, with Volume Name=”MusicPicturesVol”)

So, how would I do that i.e. commands to use, and the sequence of commands?

Bear in mind…that what I wanna do is to use the CLI (of the FreeNAS machine) to copy the files over.

I appreciate any and all help in getting me to closure.

Thanks guys :)
 

warri

Guru
Joined
Jun 6, 2011
Messages
1,193
I'd use rsync to copy over the files:
Code:
mkdir /mnt/ZoneMinderVol/aData500
rsync -av /mnt/aData500/ /mnt/ZoneMinderVol/aData500/

First you create a new folder on ZoneMinderVol, which will later contain all files from aData500.
Then use rsync to copy all files, parameter a is for archive mode (recursive, keep timestamps, etc.) and v is for verbose (will show you output on the CLI while running).

Use parameter n to perform a dry-run:
Code:
rsync -avn /mnt/aData500/ /mnt/ZoneMinderVol/aData500/

This will just output the files to the console without making any changes to the file systems and you can double check that it is actually going to do what you want.

Same command with different paths for the other case.
 

new2freenas

Dabbler
Joined
Feb 22, 2013
Messages
11
Thank you Sir!

That was very helpful and timely indeed...and worked almost perfectly. And...did I mention about the "very easy to understand" instructions?

The one slight problem/question is: when I run the command as a "dry-run" why is the "received bytes" much less than the "sent bytes"?

My results/numbers were:

o Sent 171828 bytes
o Received 15676 bytes

Thanks again for your help - much appreciated :)
 

warri

Guru
Joined
Jun 6, 2011
Messages
1,193
Also you did a pretty good job in stating your problem and delivering all necessary bits of information ;)

Alright, regarding the sent and received bytes I hope I'm getting the explanation right:
rsync is using a local and remote location for its synchronization process, which in your case both are local folders.
The Sent and Received values will list the amount of data transferred in each direction - which is composed of actual file sizes and message sizes (hash sums, acknowledgment messages, etc. - I'm not not sure exactly). In a dry run, no actual data gets transferred - it will basically just do the message exchange which accounts for the small amount of bytes you see there.
When transferring actual files, the size will roughly match up with the file sizes (+ some message overhead).
 

new2freenas

Dabbler
Joined
Feb 22, 2013
Messages
11
Oh Ok...Got it!

And, once again, perfectly clear explanation.

I will now try running the command normally (not as a dry-run) and will see what I get (in terms of sent and received bytes).

Later
 

vmtruong

Cadet
Joined
Jun 3, 2013
Messages
2
I installed Nas4free successfully but i don't know how to copy my data from NTFS drive to Nas4free Server. I will try your guide.. Thanks
 

gpsguy

Active Member
Joined
Jan 22, 2012
Messages
4,472
Please visit the NAS4Free forum for support. FreeNAS is not the same as NAS4Free.

I installed Nas4free successfully but i don't know how to copy my data from NTFS drive to Nas4free Server. I will try your guide.. Thanks
 

jeremi

Dabbler
Joined
Dec 25, 2013
Messages
14
dose dis work wit usb conected hdd directly on the nas box ore even usb keys
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
It should... please don't necro 6 month old threads. Thanks.
 
Status
Not open for further replies.
Top