How to copy files

Status
Not open for further replies.

TME

Cadet
Joined
Jan 29, 2012
Messages
6
Two weeks of experinece with all these freeNAS things, no prior experience with UNIX or Linux at all. Just dive in trying to secure tons of files and wish to share them with my seven computers. Command line scares me. Thanks to all of the information from the forum I managed to get everything set up and ready to transfer files to the new RAIDZ volume. I have about 2TB data to transfer. Obviously have to mount the drives. I have mounted the disk like below:

mkdir /mnt/ntfs
mount -t ntfs/dev/da1 /mnt/ntfs

now I am can not copy or rsync:

rsync -av --progress /ntfs1/* /the_empty_drive

rsync -av --progress /ntfs1/* /the_empty_drive

I tried the mnt, the volume name, the share name and one of the actual disk name(I have 4 1TB drive all under ZFS RAIDZ)
the question is: what should I put in place of the_empty_drive?

Thanks in advance!
 

Brand

Moderator
Joined
May 27, 2011
Messages
142
Since your not trying to sync anything I don't understand why your using rsync instead of cp. You would copy your data to wherever you mounted your volume at.
 

louisk

Patron
Joined
Aug 10, 2011
Messages
441
There is nothing wrong with using rsync. It will display more status information than cp, even with -v.

When you setup the zfs pool, what did you call it? It should be mounted as /mnt/the_empty_drive or what ever you called it.
 

TME

Cadet
Joined
Jan 29, 2012
Messages
6
I called it /mnt/MGP and I tried cp or rsync -av --progress /ntfs/* /MGP,
cp or rsync -av --progress /ntfs/* /mnt,
cp or rsync -av --progress /ntfs/* /mnt/MGP,
always reply : No match.

none worked. I know it must sound stupid but I am not familiar with command line and just have no idea what to put there.
 

louisk

Patron
Joined
Aug 10, 2011
Messages
441
If you called it MGP, it should be visable as /mnt/MGP. You could verify this with 'ls /mnt'

If you don't see it there, I suspect you didn't setup something properly when you created your ZFS volume. I would suggest you start from scratch, read the docs on the freenas site.
 

TME

Cadet
Joined
Jan 29, 2012
Messages
6
Figured Out!

OK, I figured it out. I had to write the full path: here are the lines in case someone else is struggling also:

1. Make ntfs directory
mkdir /mnt/ntfs

2. mount your disk
mount -t ntfs /dev/da1s1(or your device/partition) /mnt/ntfs

3. Copy over
cp -R /mnt/ntfs/* /mnt/Volume_name/folder_name

I did not have /mnt in front of ntfs on #3 and that was the reason not working. Thanks Louis!
 

Brand

Moderator
Joined
May 27, 2011
Messages
142
There is nothing wrong with using rsync. It will display more status information than cp, even with -v.

Good to know thanks. I have only really ever used it for syncing files and not for a single instance of transferring files.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
3. Copy over
cp -R /mnt/ntfs/* /mnt/Volume_name/folder_name

Something you might want to use instead of -R is -a. It implies -R but preserves file attributes:

the specified attributes (default: mode,ownership,timestamps), if possible additional attributes: context, links, xattr, all
 

louisk

Patron
Joined
Aug 10, 2011
Messages
441
Thats one of the reasons I like rsync. I can just use -aPS and preserve everything and get a status output. You could even write a shell alias for cp that uses rsync and you could then "cp" between hosts.
 

TME

Cadet
Joined
Jan 29, 2012
Messages
6
Can you all recommand any book teaches basic command lines? see, I would never know what is the difference between -R and -a.
 

louisk

Patron
Joined
Aug 10, 2011
Messages
441
I've heard that Absolute FreeBSD is good. http://www.amazon.com/dp/1593271514/?tag=ozlp-20
Honestly, I think that between forums, and having a FreeBSD VM you can snapshot and play with, you don't need a book, but some people want a book.

In this case, its all documented in the rsync manpage. Some are better than others, rsync isn't too bad.
 

awjs

Dabbler
Joined
Dec 20, 2011
Messages
16
can someone pls tell me y I got this error... is it because its too long of a name THANKS

cp: /mnt/usb/software/win/Microsoft.Office.2010.SP1.EN.x64/Admin/es-es/access14.opal: Invalid argument
 

awjs

Dabbler
Joined
Dec 20, 2011
Messages
16
Here is what I typed trying to copy data from my usb external HD to my pool on the nas

[root@mynas] /mnt/usb/software# cp -a /mnt/usb/software/* /mnt/small/software/
cp: /mnt/usb/software/win/Bootable USB Windows ( XP Vista Win 7) Maker 2011/OPTION - 2 for XP and Vista/MULTI_CONTENT/VC/VC.COM: Invalid argument
cp: /mnt/usb/software/win/Microsoft.Office.2010.SP1.EN.x64/Admin/es-es/access14.opal: Invalid argument
cp: /mnt/usb/software/win/Microsoft.Office.2010.SP1.EN.x64/Admin/ja-jp/office14.opal: Invalid argument
cp: /mnt/usb/software/win/Microsoft.Office.2010.SP1.EN.x64/Admin/pt-br/visio14.opal: Invalid argument
cp: /mnt/usb/software/win/Microsoft.Office.2010.SP1.EN.x64/Admin/ru-ru/inf14.opal: Invalid argument
cp: /mnt/usb/software/win/Microsoft.Office.2010.SP1.EN.x64/Admin/ru-ru/visio14.opal: Invalid argument
cp: /mnt/usb/software/win/Microsoft.Office.2010.SP1.EN.x64/Admin/de-de/excel14.opal: Invalid argument
cp: /mnt/usb/software/win/Microsoft.Office.2010.SP1.EN.x64/Admin/de-de/access14.opal: Invalid argument
cp: /mnt/usb/software/win/Microsoft.Office.2010.SP1.EN.x64/Admin/fr-fr/office14.opal: Invalid argument
cp: /mnt/usb/software/win/Microsoft.Office.2010.SP1.EN.x64/Admin/fr-fr/access14.opal: Invalid argument
cp: /mnt/usb/software/win/Microsoft.Office.2010.SP1.EN.x64/Excel.en-us/ExcelLR.cab: Invalid argument
cp: /mnt/usb/software/win/Microsoft.Office.2010.SP1.EN.x64/ProPlus.WW/ProPlusWW.msi: Invalid argument
cp: /mnt/usb/software/win/Microsoft.Office.2010.SP1.EN.x64/Publisher.en-us/PubLR.cab: Invalid argument
cp: /mnt/usb/software/win/Microsoft.Office.2010.SP1.EN.x86/Admin/es-es/access14.opal: Invalid argument
cp: /mnt/usb/software/win/Microsoft.Office.2010.SP1.EN.x86/Admin/ja-jp/office14.opal: Invalid argument
cp: /mnt/usb/software/win/Microsoft.Office.2010.SP1.EN.x86/Admin/pt-br/visio14.opal: Invalid argument
cp: /mnt/usb/software/win/Microsoft.Office.2010.SP1.EN.x86/Admin/ru-ru/inf14.opal: Invalid argument
cp: /mnt/usb/software/win/Microsoft.Office.2010.SP1.EN.x86/Admin/ru-ru/visio14.opal: Invalid argument
cp: /mnt/usb/software/win/Microsoft.Office.2010.SP1.EN.x86/Admin/de-de/excel14.opal: Invalid argument
cp: /mnt/usb/software/win/Microsoft.Office.2010.SP1.EN.x86/Admin/de-de/access14.opal: Invalid argument
cp: /mnt/usb/software/win/Microsoft.Office.2010.SP1.EN.x86/Admin/fr-fr/office14.opal: Invalid argument
cp: /mnt/usb/software/win/Microsoft.Office.2010.SP1.EN.x86/Admin/fr-fr/access14.opal: Invalid argument
cp: /mnt/usb/software/win/Microsoft.Office.2010.SP1.EN.x86/Office64.en-us/Office64MUI.msi: Invalid argument
cp: /mnt/usb/software/win/Microsoft.Office.2010.SP1.EN.x86/Updates/clientsharedmuisp1-en-us.msp: Invalid argument

is it ok or did I do something wrong

Thx
 

louisk

Patron
Joined
Aug 10, 2011
Messages
441
If I had to guess, I would say that the path names are probably too long.
Adding up just the paths (no spaces, and not counting the command) I get 250 characters. I would probably try zipping a directory or using tar, then copy it somewhere.
 

awjs

Dabbler
Joined
Dec 20, 2011
Messages
16
If I had to guess, I would say that the path names are probably too long.
Adding up just the paths (no spaces, and not counting the command) I get 250 characters. I would probably try zipping a directory or using tar, then copy it somewhere.

Well I am not sure but I used the command instead and I got no errors so why do we use the -a option, when I type cp /help it doesn't even show -a as an option, I dont know but here is what I used and got no errors please let me know if I will have any problems using just the command I did Thanks

cp -r /mnt/usb/software/win/* /mnt/small/software/win/ enter

All the files are there and no errors
 

xbmcg

Explorer
Joined
Feb 6, 2012
Messages
79
If you are uncomfortable with the command line, why are you not using your Network to copy all those stuff,
you have to create the samba/cifs shares anyway to use your NAS later, so just map your network drive
to your Windows PC and your USB device too, and copy all those data using your explorer with drag & drop.

This is a NAS, you dont need any unix shell to move data around. Any way, NTFS file systems are also not
very "supported" in direct access via freeBSD, I would do it the Windows way...
 
Status
Not open for further replies.
Top