Robocopy is copying empty files.  Why?  How do I fix it?

Posted on 2014-08-26
Last Modified: 2014-09-07
I ran Robocopy to migrate data from a Drobo NAS device to a Dell Server running Windows Server 2012 R2.  The Server has Direct Attached Storage and a large volume created to share the files.  

I used the following command:
robocopy "T:\" "X:\Media" /E /ZB /R:5 /COPY:DAT /PURGE /X /TEE /LOG:"C:\RobocopyLog.txt"

The destination files all show the file size under size (i.e. 27.9 MB) but under Size on disk they say 0 bytes.  Server 2012 shows very little data on the volume (110mb).  

Remote access of the files on the destination server result in error messages about corrupt files.  

I don't understand showing size accurately, but size on disk showing 0 bytes.  Also, it's taking days to copy the data, so it's not like it's quickly copying 0 bytes.

For whatever it's worth I have dedup set up on the destination Volume.
Question by:Taylor Huckstep
    LVL 19

    Expert Comment

    by:Miguel Angel Perez Muñoz
    Could you check user used to run command has enough privileges? (minimal read only on origin and write on destination).
    LVL 28

    Expert Comment

    Is the robocopy job complete or still in progress ?

    It is quite possible the copy job is not yet complete.

    Author Comment

    by:Taylor Huckstep
    Job completed, and filled the drive with 0 files.  I'm logged in as Administrator.

    I just don't understand how it can copy a file that takes up no space, but reports its original size.  Maybe COPY:DAT copies the file size metadata or something.

    Author Comment

    by:Taylor Huckstep
    This is what I'm seeing.  Complete files that take time to transfer, but have nothing in them:

    Assisted Solution

    by:Taylor Huckstep
    Still not sure why or how it was taking forever to copy files with 0 bytes on disk, but this command ended up properly copying for me:
    robocopy "T:\" "X:\Media" /E /V /ZB /R:5 /W:30 /TEE /LOG:"C:\RobocopyLog.txt"
    LVL 28

    Accepted Solution

    So I am guessing this is what happened:
    Deletes destination files and directories that no longer exist in the source.

    There may have been some aberrant behavior with the purge flag.

    In the future take a quick look at all the flags to verify which you want to use:

    Author Comment

    by:Taylor Huckstep
    Yeah, I had that thought too.  Thanks to all for your comments.

    Author Closing Comment

    by:Taylor Huckstep
    I added my command string to the solution as that fixed the original problem.  I think becraig had it right with the /purge option.

    I was trying to mirror up source and destination, including the removal of nonexistent folders, hence the /purge flag.  If /purge was causing the problem, it wasn't because the string was acting as its supposed to.

    I wanted to do a migration, then resync after a period of time, just the changes, including removal of any deleted folders and data from the source.

    My string I used, only copies from source, it doesn't sync.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Having issues meeting security compliance criteria because of those pesky USB drives? Then I can help you! This article will explain how to disable USB Mass Storage devices in Windows Server 2008 R2.
    Lets start to have a small explanation what is VAAI(vStorage API for Array Integration ) and what are the benefits using it. VAAI is an API framework in VMware that enable some Storage tasks. It first presented in ESXi 4.1, but only after 5.x sup…
    This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
    This Micro Tutorial will teach you how to reformat your flash drive. Sometimes your flash drive may have issues carrying files so this will completely restore it to manufacturing settings. Make sure to backup all files before reformatting. This w…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now