Access is denied while copies files from a remote share hosted on NAS device

kumar kaushal 176 Reputation points

We are running the below command to copy the files from the share on a NAS device and destination being Azure file share . The command is being run from a windows 2012 machine

robocopy "\server1\aapp12 " "\\server45123456\AaPP12 " /SEC /COPYALL /DCOPY:DAT /E /R:1 /W:1 /XO /zb /mt=13 /LOG:AaPP12-ppsd.txt

What we find is that the files on which i have permissions i am apply to copy but on the files on which i don't i just get an access is denied in the procmon logs

If i look at the event properties it says that the desired access required is READ.

Desired Access: Generic Read
Disposition: Open
Options: Sequential Access, Synchronous IO Non-Alert, Non-Directory File, Open Reparse Point, Disallow Exclusive
Attributes: n/a
ShareMode: Read, Delete
AllocationSize: n/a

I am using /zB command in the robocopy so that the backup priviledge comes into play and i am even able to copy files on which i don't have permissions.

The questions that i have is :

1)is that /zb command won't work as the share is remote and the files that we are trying to copy are not local to server ?
2)Is that Robocopy command when run it knows under what credentials it is running and under what account and it makes a copy of that credentials and compair the ACL's on that files when he is trying to access that file ?

3)I also found that when i run the command whoami /priv this is disabled for me . Is that these should be enabled for /zb to make use of backup priviledges ?

SeBackupPrivilege Back up files and directories Disabled
SeRestorePrivilege Restore files and directories Disabled

Azure Files
Azure Files
An Azure service that offers file shares in the cloud.
1,050 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
11,167 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sumarigo-MSFT 41,271 Reputation points Microsoft Employee

    @kumar kaushal Firstly, apologies for the delay in responding here and any inconvenience this issue may have caused.

    Azure File Sync works on Direct Attached Storage (DAS) locations and does not support sync to Network Attached Storage (NAS) locations. This fact makes a migration of your files necessary and this article guides you through the planning and execution of such a migration.

    I would recommended to follow-up this article to migrate NAS data to Azure File Share:

    RoboCopy in the same mode a backup application would use. It allows RoboCopy to move files that the current user does not have permissions to.

    Additional information: You cannot use a mapped drive as the AFS local cache.

    On the Azure File Sync server map the NAS drive and then use robocopy to copy from the NAS to the local virtual disk used as the AFS cache.
    Robocopy <source> <target> /mir /copyall /mt:16 /DCOPY:DAT

    You could set your free space policy on the local drive to be pretty low, say 80%. This way Azure File Sync will tier out the data and free up more space as data is moved over to it. You could then start you migration to Azure File Sync in batches. Be careful that you have enough free space on the Azure File Sync cache and then copy some folders in. Wait for them to tier out and then move the next folder. You could use Robocopy -mir and make multiple passes so you can keep the original location online and minimize downtime. When your migration is over you can resize the local cache drive and update your free space policy to something lower, like 20%.

    If you still find any difficulties. I wish to engage with you offline for a closer look and provide a quick and specialized assistance, please send an email with subject line “Attn:subm” to AzCommunity[at]Microsoft[dot]com referencing this thread and the Azure subscription ID, I will follow-up with you. Once again, apologies for any inconvenience with this issue. Thanks for your patience and co-operation.

    Hope this helps!

    Kindly let us know if the above helps or you need further assistance on this issue.


    Please don’t forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments