Jump to content



Photo
Answered Go to the full post

  • Please log in to reply
16 replies to this topic

#1 riahc3

riahc3

    Neowin's most indecisive member

  • Tech Issues Solved: 11
  • Joined: 09-April 03
  • Location: Spain
  • OS: Windows 7
  • Phone: HTC Desire Z

Posted 16 April 2014 - 18:32

In my curious ways :p Im wondering how to make a exact copy of all files and folders from one drive to another.

Ive found (S:/ is Source and D:/ is Destination)

robocopy S:/ D:/ /MIR

But there are sys files it doesn't copy over.

How can I make a "dd" out of robocopy?

Best Answer sc302 , 16 April 2014 - 19:39

system files won't copy over even with the copy command.  Mir = /e + /purge

/E :: copy subdirectories, including Empty ones.

/PURGE :: delete dest files/dirs that no longer exist in source.
/MIR :: MIRror a directory tree (equivalent to /E plus /PURGE).

 

robocopy /?

will give you all of the commands.

 

I would do this

robocopy s: d: /E /MT:20 /V /ETA /LOG:c:\users\userid\desktop\robocopy.txt

 

This way it will do a multithreaded copy (copying 20 files at a time vs 1 at a time), and give you a log of what it misses or errors on, if you want to purge the files that are no longer on the source then by all means do the MIR.  After you have found the files with the system attribute in the log you can create a batch file rather quickly to remove the system attribute on those files and run the copy again.  Note that if a file is in use you cannot copy it in this method, usually system files are in use like the explorer.exe.  Keep in mind that hidden files/folders also will not be copied.

Go to the full post



#2 Radium

Radium

    Neowinian

  • Joined: 08-April 04

Posted 16 April 2014 - 18:35

In my curious ways :p Im wondering how to make a exact copy of all files and folders from one drive to another.

Ive found (S:/ is Source and D:/ is Destination)

robocopy S:/ D:/ /MIR

But there are sys files it doesn't copy over.

How can I make a "dd" out of robocopy?

 

 

Have you tried XCOPY that ships with all versions of Windows?



#3 Top Qat

Top Qat

    Neowinian

  • Tech Issues Solved: 8
  • Joined: 09-July 04
  • Location: London, UK
  • OS: Windows 8.1u1 and Server 2012 R2u1
  • Phone: Samsung Galaxy S 3

Posted 16 April 2014 - 18:39

Maybe it's not copying files marked as hidden or system. Try adding /IA:HRSA

 

What do you mean by 'dd'?



#4 OP riahc3

riahc3

    Neowin's most indecisive member

  • Tech Issues Solved: 11
  • Joined: 09-April 03
  • Location: Spain
  • OS: Windows 7
  • Phone: HTC Desire Z

Posted 16 April 2014 - 18:45

Have you tried XCOPY that ships with all versions of Windows?

Whats the difference between it and robocopy?

#5 Top Qat

Top Qat

    Neowinian

  • Tech Issues Solved: 8
  • Joined: 09-July 04
  • Location: London, UK
  • OS: Windows 8.1u1 and Server 2012 R2u1
  • Phone: Samsung Galaxy S 3

Posted 16 April 2014 - 18:58

Are you trying to make an exact copy? You need to clone disk-disk if that's what you need.



#6 Radium

Radium

    Neowinian

  • Joined: 08-April 04

Posted 16 April 2014 - 19:04

Whats the difference between it and robocopy?

XCOPY is a core EXE of the OS and it can copy anything that you're allowed to read. All you need to do is run the command prompt as administrator.

 

Using XCOPY and then manually reconstruct a boot environment is better than to rely on some random 3rd part app.

XCOPY is good for anything that you want to copy.



#7 sc302

sc302

    Neowinian Senior

  • Tech Issues Solved: 31
  • Joined: 12-July 05
  • Location: NJ, USA

Posted 16 April 2014 - 19:39   Best Answer

system files won't copy over even with the copy command.  Mir = /e + /purge

/E :: copy subdirectories, including Empty ones.

/PURGE :: delete dest files/dirs that no longer exist in source.
/MIR :: MIRror a directory tree (equivalent to /E plus /PURGE).

 

robocopy /?

will give you all of the commands.

 

I would do this

robocopy s: d: /E /MT:20 /V /ETA /LOG:c:\users\userid\desktop\robocopy.txt

 

This way it will do a multithreaded copy (copying 20 files at a time vs 1 at a time), and give you a log of what it misses or errors on, if you want to purge the files that are no longer on the source then by all means do the MIR.  After you have found the files with the system attribute in the log you can create a batch file rather quickly to remove the system attribute on those files and run the copy again.  Note that if a file is in use you cannot copy it in this method, usually system files are in use like the explorer.exe.  Keep in mind that hidden files/folders also will not be copied.



#8 Jason Stillion

Jason Stillion

    Neowinian

  • Tech Issues Solved: 1
  • Joined: 04-April 12
  • Location: United States

Posted 16 April 2014 - 19:49

xcopy /v /e /h /r (Source) (Target)

 

xcopy /v /e /h /r c:\*.* d:\*.*  - for example would copy the entire c drive to a d drive.

 

/v - verification

/e - folder's including empty one's

/h - hidden / system files

/r - read only files

 

More Information on switches

http://technet.micro...y/cc771254.aspx



#9 +BudMan

BudMan

    Neowinian Senior

  • Tech Issues Solved: 100
  • Joined: 04-July 02
  • Location: Schaumburg, IL
  • OS: Win7, Vista, 2k3, 2k8, XP, Linux, FreeBSD, OSX, etc. etc.

Posted 16 April 2014 - 20:30

What system files are you trying to copy? Are you trying to copy a OS drive/dir or data dir? What exactly are you trying to accomplish, robocopy is great for doing a mirror of data structure - but not sure I would use it as a means of trying to copy over or backup a OS directory structure like windows or program files, etc.

#10 OP riahc3

riahc3

    Neowin's most indecisive member

  • Tech Issues Solved: 11
  • Joined: 09-April 03
  • Location: Spain
  • OS: Windows 7
  • Phone: HTC Desire Z

Posted 16 April 2014 - 22:46

system files won't copy over even with the copy command.  Mir = /e + /purge
/E :: copy subdirectories, including Empty ones.
/PURGE :: delete dest files/dirs that no longer exist in source.
/MIR :: MIRror a directory tree (equivalent to /E plus /PURGE).
 
robocopy /?
will give you all of the commands.
 
I would do this
robocopy s: d: /E /MT:20 /V /ETA /LOG:c:\users\userid\desktop\robocopy.txt
 
This way it will do a multithreaded copy (copying 20 files at a time vs 1 at a time), and give you a log of what it misses or errors on, if you want to purge the files that are no longer on the source then by all means do the MIR.  After you have found the files with the system attribute in the log you can create a batch file rather quickly to remove the system attribute on those files and run the copy again.  Note that if a file is in use you cannot copy it in this method, usually system files are in use like the explorer.exe.  Keep in mind that hidden files/folders also will not be copied.

Sadly I went ahead and did it with mir but missed the multithreaded switch.

#11 OP riahc3

riahc3

    Neowin's most indecisive member

  • Tech Issues Solved: 11
  • Joined: 09-April 03
  • Location: Spain
  • OS: Windows 7
  • Phone: HTC Desire Z

Posted 21 April 2014 - 10:52

system files won't copy over even with the copy command.  Mir = /e + /purge
/E :: copy subdirectories, including Empty ones.
/PURGE :: delete dest files/dirs that no longer exist in source.
/MIR :: MIRror a directory tree (equivalent to /E plus /PURGE).
 
robocopy /?
will give you all of the commands.
 
I would do this
robocopy s: d: /E /MT:20 /V /ETA /LOG:c:\users\userid\desktop\robocopy.txt
 
This way it will do a multithreaded copy (copying 20 files at a time vs 1 at a time), and give you a log of what it misses or errors on, if you want to purge the files that are no longer on the source then by all means do the MIR.  After you have found the files with the system attribute in the log you can create a batch file rather quickly to remove the system attribute on those files and run the copy again.  Note that if a file is in use you cannot copy it in this method, usually system files are in use like the explorer.exe.  Keep in mind that hidden files/folders also will not be copied.

BTW, this gives no visual output; Just says:

"Log File : C:\robocopy.txt"

% and times would be nice IMO.

#12 +BudMan

BudMan

    Neowinian Senior

  • Tech Issues Solved: 100
  • Joined: 04-July 02
  • Location: Schaumburg, IL
  • OS: Win7, Vista, 2k3, 2k8, XP, Linux, FreeBSD, OSX, etc. etc.

Posted 21 April 2014 - 12:53

What do you think /ETA is? But your putting it in the log, if you want log and console use

 

/TEE :: output to console window, as well as the log file.

 

I personally would not put /ETA in the log - its makes it hard to read..  lots of this

 

 0%  
  3%  
 25%  
 28%  
 35%  
 42%  
 50%  
 53%  
 57%  
 64%  
 71%  
 75%  
 89%  
 92%  
100%  
100%

 

But if you want log and console /TEE is what you want - just add it at the end of the command



#13 sc302

sc302

    Neowinian Senior

  • Tech Issues Solved: 31
  • Joined: 12-July 05
  • Location: NJ, USA

Posted 21 April 2014 - 13:04

Open the log file as it is copying. You will have to close and open to refresh.

#14 sc302

sc302

    Neowinian Senior

  • Tech Issues Solved: 31
  • Joined: 12-July 05
  • Location: NJ, USA

Posted 21 April 2014 - 13:18

Another option is richcopy. Downloadable from technet. It is rather old but it was the gui answer to robocopy.

#15 +BudMan

BudMan

    Neowinian Senior

  • Tech Issues Solved: 100
  • Joined: 04-July 02
  • Location: Schaumburg, IL
  • OS: Win7, Vista, 2k3, 2k8, XP, Linux, FreeBSD, OSX, etc. etc.

Posted 21 April 2014 - 19:39

Open the log file as it is copying. You will have to close and open to refresh.

Or just use tail, here is windows version

http://tailforwin32.sourceforge.net/