SOLVED Robocopy error 5 access is denied

Status
Not open for further replies.

arkoMax

Dabbler
Joined
Jul 13, 2017
Messages
16
Hello,
I am trying to update directory/file timestamps using robocopy from my PC (Win7) but get an error "ERROR 5 (0x00000005) Time-Stamping Destination Directory... Access is denied".

The command I am using is:
robocopy source destination /e /COPY:DT /DCOPY:T /TIMFIX /FFT

The dataset owner, and user logged on to the PC, are the same. The dataset is mapped as a drive through an SMB share, and I have no problem copying/deleting content on the share. The security properties under win explorer show full access. This seems to be similar to the problem @Cosmo_Kramer was having here, but I have no idea what that fix does or how to implement it.

The output of getfacl of the share (getfacl /mnt/VOL1/media) is:
Code:
			owner@:rwxpDdaARWcCos:fd-----:allow																					
			group@:rwxpDdaARWcCos:fd-----:allow																					 
		 everyone@:r-x---a-R-c---:fd-----:allow  

Any assistance would be really appreciated.
 

arkoMax

Dabbler
Joined
Jul 13, 2017
Messages
16
Take a look at this. or this.
Thanks, I looked at those pages, but to be honest I don't quite understand them. I am technical, but only in the windows world ... I have no unix/linux experience and don't really want to go punching commands into the CLI only presuming what will happen.

Any chance you could give me a bit more direct instructions?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Why do you need /TIMFIX? Are you trying to robocopy a directory or an entire user profile?

One thing to bear in mind though is that by default FreeNAS has the samba parameter nfs4:mode = special set. When you viewed your permissions from the CLI, you had
Code:
owner@:rwxpDdaARWcCos:fd-----:allow																					
			group@:rwxpDdaARWcCos:fd-----:allow																					 
		 everyone@:r-x---a-R-c---:fd-----:allow 


These are special access control entries that are in the NFSv4 spec for compatibility with traditional posix mode bits (permissions). They behave differently than what you'd typically experience in windows. The closest approximation is "CREATOR OWNER" and "CREATOR OWNER-GROUP", which is (to simplify things) how they appear when nfs4:mode = simple.

I think the best way to work around this is to set a new inheriting ACE at the root of your share for the group that you're using to robocopy files. You can do this through File Explorer. (You can do the user, but I prefer to manage permissions through groups.)
 

Artion

Patron
Joined
Feb 12, 2016
Messages
331
Well, I tried to reproduce your error with no success. Could you post the dataset and share settings? Also the SMB service settings?

Mines are: (I'm using FN 11-U2 and Windows 7 Pro x86)

upload_2017-8-16_16-5-42.png


upload_2017-8-16_16-6-31.png


upload_2017-8-16_16-7-49.png


upload_2017-8-16_16-8-54.png


upload_2017-8-16_16-10-51.png
 

arkoMax

Dabbler
Joined
Jul 13, 2017
Messages
16
Thanks for your inputs guys, please find responses below.

A bit of background: the files/folders in question are my media (moves.. tv shows). I am migrating all content onto the FreeNAS. I had performed a copy of the content using win explorer. This has resulted in the folder modified/created times to set to the time of the copy. I need these to be the same times as the source. Kodi uses these times for its sorting (recently added etc). I had successfully used the robocopy command in the past to fix/match timestamps when copying content between external harddrives.

Why do you need /TIMFIX? Are you trying to robocopy a directory or an entire user profile?
As stated in the robocopy options, the /TIMFIX parameter "fixes file times on all files" ... ie copies over the filetimes from the source to the destination directory of already copied content. The command that has always worked for me when needing to preserve timestamps is:
robocopy source destination /e /copyall /timfix /dcopy:t

Could you post the dataset and share settings? Also the SMB service settings?
Please see imgur album with all screenshots

I think the best way to work around this is to set a new inheriting ACE at the root of your share for the group that you're using to robocopy files. You can do this through File Explorer. (You can do the user, but I prefer to manage permissions through groups.)
Not sure what this means ... isnt this already set for my logged in user (as can be seen from the last image in the above album)? .. ie I already have "full control"
 

arkoMax

Dabbler
Joined
Jul 13, 2017
Messages
16
I have managed to fix this issue and no longer get an error and access denied with robocopy.
In case someone else runs into this problem - I removed the "auxiliary parameters" I had set in the SMB settings (I had followed this post to add those parameters, but it obviously created an issue).
 

Artion

Patron
Joined
Feb 12, 2016
Messages
331
Happy to hear it. Can you please mark this thread as Solved? You can find how here and here.
 
Status
Not open for further replies.
Top