How can I copy files between drives?

Status
Not open for further replies.

Shiroi Kage

Explorer
Joined
Dec 19, 2013
Messages
62
Hello,

I have a couple of terabytes I want to move from one drive to another. Obviously, using Windows is not exactly optimal so I was wondering how I can do it from within FreeNAS. It would work just as well if I could clone one drive onto another.
 

JakeHiltz

Dabbler
Joined
Dec 14, 2013
Messages
37
Using Windows to do what? Where are the disks? If they inside FreeNAS just use rsync or even a simple cp command
 

Shiroi Kage

Explorer
Joined
Dec 19, 2013
Messages
62
Using Windows to do what? Where are the disks? If they inside FreeNAS just use rsync or even a simple cp command
Sorry, that was a bit weird of me to say. The drives are in the FreeNAS box.
As for resync, I'm not sure how to use it. Do I just name the destination as the path I want the thing to be copied to? How do I know that it's copying things? I also have no idea what cp is (hence posting in the noob section :P)
 

JakeHiltz

Dabbler
Joined
Dec 14, 2013
Messages
37
rsync is easy to use and would be the best option but can be a little bit more difficult . If you have the time you should look at the rsync (man) page. FreeNAS has a good doc here as-well : http://doc.freenas.org/index.php/Rsync_Tasks

If you want to copy the files without any reading cp command is pretty simple. If you have the FreeNAS box enabled to use SSH ( services + enable SSH) you can do it that way by logging into FreeNAS and typing "cd /mnt" ( without quotations) then type "ls" and it will give you a list of your volumes. Then type "cp -R volumetocopy volumetocopyto " .

If you are using SSH via terminal or putty you cannot interrupt this command , if you do it will stop and you will have incomplete transfers. This means leaving the terminal open until the job is finished . It should copy quite fast depending on speed of the drives / configuration .
 

JakeHiltz

Dabbler
Joined
Dec 14, 2013
Messages
37
You can also do this by opening the web GUI and opening the "Shell" type the command listed above and do not exit the web GUI while it is copying or it will terminate.
 

JakeHiltz

Dabbler
Joined
Dec 14, 2013
Messages
37
Do you have a ZFS pool or are you using UFS? Are you copying these files as a backup?
 

Shiroi Kage

Explorer
Joined
Dec 19, 2013
Messages
62
So I decided to use "cp -a <source> <destination>" from within the GUI's shell and got it to work (still copying since early this morning) I did this because I still could not get the resync to work. Is there a way to monitor progress on the copying process or do I have to keep refreshing the network drives to see when the destination drive is as full as the source drive?

Do you have a ZFS pool or are you using UFS? Are you copying these files as a backup?
I have a bunch of ZFS drives, and I think I added an old, clunky drive to the box by mistake and now it has data in it so I needed to take the data out of it (it used to be in a pre-assembled PC with a terrible PSU that almost killed the drive. Managed to salvage it but kept having unstable read/write speeds and produced the odd sound here and there)
 

warri

Guru
Joined
Jun 6, 2011
Messages
1,193
I don't think cp can give you a progress, you'll just have to wait it out.
 

Michael Wulff Nielsen

Contributor
Joined
Oct 3, 2013
Messages
182
If you had used cp -v .... It would have told you the progress. But as it is just let it finish :)
 

JakeHiltz

Dabbler
Joined
Dec 14, 2013
Messages
37
Yes copy -v ( verbose ) will give you what you need. Also from the shell you can compare the drive size used by typeing "df -h /whatever" -h is for human readable . If you want to view the byte size type just "df /whatever"

You should really learn how to use rsync , it is infinitely better
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
You should really learn how to use rsync , it is infinitely better
Hmm, "better", for example it this case (full copy) it will be much slower than cp (see this thread: http://forums.freenas.org/threads/new-freenas-machine-copying-entire-library.16415/#post-84332).
Also, for incremental updates between two ZFS fileystems you should learn incremental ZFS replication (zfs send -I | zfs receive). It only sends the blocks that changed without the rsync's checksumming overhead.
 

JakeHiltz

Dabbler
Joined
Dec 14, 2013
Messages
37
@Dusan I should have not used the word "better" in this case . It really depends on the situation . If this transfer was for any reason interrupted its possible you will have an incomplete/corrupt file... this is not the case with rsync.

When copying large files I do use cp. Its easy , fast and does the job .
 

asce

Cadet
Joined
Sep 18, 2017
Messages
5
Hi everyone i would like to know how to read or copy the previous files of mine on my freenas 9.3 to the newly installed freenas 9.3 because my old freenas 9.3 is crashed and i need to recover my files on that freenas.. but when i installed a new file server i cannot view or read the files from that freenas.. i only see the disk on view disk.. please help me.. Thank you in advance
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Holy thread necro, this post is almost 6 years old!

Start a new thread with your issue.
 
Status
Not open for further replies.
Top