I bought a new hard disk and wanted to copy all files in a ntfs partition to another ntfs partition. These files are pdf files and bak files used both by win7 and ubuntu.
Can Rsync be used to sync files in a ntfs partition to another ntfs partition?
Thanks
Yes, you can use
rsync
to copy data between ntfs partitions. Use the -r (or --recursive) option to haversync
go through the entire folder structure below the source folder and recreate the folder structure and files on the destination.For volumes that support linux permissions, we would typically use the
-a
(--archive
) option to create an identical "mirror" copy. The-a
option preserves the time stamp and all other attributes of the source files.On ntfs volumes, that do not support linux permissions, you still can use the
-t
(--times
) option to preserve the time stamp of the files.For using
rsync
on file systems with less accurate or different date stamps, you can decrease the accuracy by whichrsync
compares time stamps in order to decide whether a file has changed or not. This is done with the option-@
or--modify-window
, e.g.-@=2
would consider files where the time stamps differ less than 2 seconds as the same.rsync is originally unix utility to sync source and destination. Now rsync is even ported to windows as well. You may need cygwin or mingw on windows machine for the same. Only condition is that both operating system should see each other's filesystem and ssh should be enabled both side.
rsync -avz -e ssh /cygwin/c/song.mp3 [email protected]:/data
You can install rsync in cygwin on Windows and do the data copy. Just like you are in a *NIX terminal session.
The path naming is a bit different.
For example, if you want to copy all data from partition
E:
toF:
=>rsync -av --progress --stats /cygdrive/e /cygdrive/f
BTW: Not sure if rsync for cygwin is capable of keeping all the NTFS properties/attributes. Most likely yes. But it loese attributes, permissions when copying from NTFS -> *NIX file systems.