Reputation: 41
I've run into an interesting problem that I can't seem to resolve. I have a Windows 10 system with an NFS-mounted drive that I've configured using the instructions here. Within File Explorer, I'm able to copy and create files and directories on the mounted Z: drive. However, if I try to use the Copy-Item
command from within PowerShell, I receive the following error:
PS C:\Users\steve\Desktop> Copy-Item -Path "D:\source\2018_07_11\12345\0001.voc" -Destination "Z:\documents\2018\08\28\0001.voc" -Force -verbose VERBOSE: Performing the operation "Copy File" on target "Item: D:\source\ 2018_07_11\12345\0001.voc Destination: Z:\documents\2018\08\28\0001.voc". Copy-Item : Access to the path 'Z:\documents\2018\08\28\0001.voc' is denied. At line:1 char:1 + Copy-Item -Path "D:\source\2018_07_11\12345\0001.voc" -Destination ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : PermissionDenied: (D:\source\2018_07_11\12345\0001.voc:FileInfo) [Copy-Item], UnauthorizedAccessException + FullyQualifiedErrorId : CopyFileInfoItemUnauthorizedAccessError,Microsoft.PowerShell.Commands.CopyItemCommand
Within PowerShell, I'm able to create directories using mkdir
, as well as text documents using New-Item
within the mounted drive. Only the Copy-Item
command seems to throw this error.
Upvotes: 1
Views: 4449
Reputation: 41
So I believe I've found a workaround to this problem. Interestingly, the source file did present part of the issue - because the file was located on a DVD, it had the ReadOnly
attribute set on the file. This was not an issue copying the file from the DVD to a local disk, however it does seem to cause the PermissionDenied
problem when doing the copy from the DVD to the NFS mount directly.
Additionally, after copying the file from the DVD and saving on the local disk, the ReadOnly
flag was still set, and so not allowing the file to be copied to the NFS mount. After removing the ReadOnly
attribute from the file, I was then able to copy it over to the NFS drive. So it appears that I'll need to copy the files off of the DVD to a local directory, remove the ReadOnly
attribute, then copy to the NFS drive.
For completeness: the NFS server is a CentOS 7 system running GlusterFS and exporting out its drives using NFS-Ganesha.
Upvotes: 1
Reputation: 151
(I would have left a comment but my reputation is not high enough)
Error messages seem conflicting. First: "Access to the path 'Z:\documents\2018\08\28\0001.voc' is denied." Then: "PermissionDenied: (D:\source\2018_07_11\12345\0001.voc:FileInfo)"
Are you sure you have sufficient access to the source file? Could you make a test with another source file? have you tried to run Powershell with elevated privileges?
Upvotes: 0