Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a directory copying method for NTFS that can copy a directory 100% accurately, every time, with every single file, sub-directory, permission, attribute, and symbolic link / junction intact without skipping a single file? I'm open to any suggestions, including command line, boot disc tools, partial disc imaging (as long as you can restore to a disc with data on it and not wipe it), raw copying, or anything else that might solve this.

I run into this problem far too often. I need to copy a tree of directories to another location but am foiled every time by some file that refuses to copy for one reason or another (access denied, file in use, or the best one, no reason given, it just refuses to copy.) Many methods don't copy NTFS permissions. Along with that, all the file copying tools are woefully inadequate when it comes to symbolic links and junctions. I want to copy the symbolic link itself, not the contents of the referenced location.

Copying certain directories in Windows is almost always a recipe for failure. Even tools like FreeFileSync that use shadow copying fail. Because of that, I prefer command line or boot disc solutions. (I boot to command line using Windows install disc.) Acronis True Image file backup/restore doesn't copy symbolic links or junctions and seems to skip several files as well (and runs incredibly slow from the boot CD.) Even Xcopy and Robocopy fail to copy 100% of the files, and neither can copy junctions, hardlinks, or directory symbolic links.

For example, I am currently trying to copy a Windows 8 system's C:\Users and C:\ProgramData to drive D. Regardless of the options used, booting to the command line, Robocopy still fails to copy several files, just skipping them without any reason given. Xcopy doesn't seem to get them all either. And because Windows uses a number of directory junctions in these folders, you're forced to rebuild them manually one by one.

share|improve this question
    
imagex (from WAIK, the Windows Automated Installation Kit) might address your needs, but the license terms are fairly restrictive. –  Harry Johnston Nov 4 '12 at 20:43
    
Come to think of it, have you tried Windows Backup? –  Harry Johnston Nov 5 '12 at 22:59
    
@Harry Johnston: Re: imagex. That looks interesting. I'm going to have to dig deeper to figure out if that can be used on an individual folder and also extract the image to a drive without wiping the contents. Re: Windows Backup. I had not, but I looked at it and it doesn't seem to allow one to backup a specific folder. It also has a notice that system files will not be backed up, which are exactly the type of files I want to back up. The image option would back up the data along with everything else on the drive, but I'd have to be able to extract a folder from it and keep it all in tact... –  Guavaman Nov 6 '12 at 1:34
    
Although I don't recall ever trying it, the command-line reference for imagex says it can both capture and apply to a directory rather than an entire volume. It will however delete any existing contents in the target directory. You must create the target directory first. You're probably right about Windows Backup now that I think about it, I was thinking of the older versions (pre-XP) which were more flexible. –  Harry Johnston Nov 6 '12 at 2:03

1 Answer 1

Robocopy might be able to copy those after all:

http://technet.microsoft.com/en-us/library/cc733145(v=ws.10).aspx

/sl Copies the symbolic link instead of the target.

share|improve this answer
2  
I mentioned I've tried to use Robocopy in my question without success. I have used it with many, many permutations of options, the most common being /copyall /e /xj and sometimes /b. #1, it still skips a handful of files. #2, it does not copy symbolic links or junctions and they have to be manually recreated. If you leave out /xj, it will follow the junctions and copy that data. That is not a true mirror copy of a directory. –  Guavaman Nov 2 '12 at 8:12
    
could the /sl switch be the answer? not sure about it. –  TheUser1024 Nov 2 '12 at 8:16
    
I just did a test with /copyall /e /sl and it followed the junction and copied junction as a directory and copied the target dir's contents as well. Did the same for a symlinkD. :( Thanks for helping though! –  Guavaman Nov 2 '12 at 8:20
    
I just tested and /SL does work for SYMLINK (files) only. Does not work for junctions, directory symlinks, or hard links. –  Guavaman Nov 2 '12 at 8:29
    
@Guavaman: Windows supports symlinks now? I was under the impression only hardlinks were implemented. –  Alix Axel Nov 2 '12 at 18:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.