I am trying to sync a directory from my Dietpi install to a mounted NFS network drive on TrueNAS. When running dietpi-sync, I receive the error rsync: [receiver] chown “/mnt/nfs_client/dietpi-sync/truenas_dietpi/(INSERT FILE NAME HERE)” failed: Invalid argument (22). At the end of the sync, I receive the error mv: failed to preserve ownership for ‘/mnt/nfs_client/dietpi-sync/.dietpi-sync.log’: Invalid argument.
Things I’ve tried:
Created user with same name and uid on both machines and chmod the Dietpi directory I want to sync so that the user I created has full access
Stripped all ACLs from destination TrueNAS dataset
Neither of these changes worked. I am new to Linux permissions. Can you please tell me why this error is occurring and how I can fix it?
Everything seems to be assigned to user nobody and group nogroup. Probably something that comes from NFS of the NAS. It is best to look in your NAS to see if there are settings for NFS that can generate something like this.
By checking the box “NFSv3 ownership model for NFSv4” in my TrueNAS server and restarting the service, all of the directories (except for .dietpi-sync.log) came under the ownership of truenas_dietpi
truenas_diepi is a user that I set up on both machines, so this is good. Unfortunately, I ran dietpi-sync again and still get the Invalid argument (22) for multiple chown lines.
I also found the user management link you posted in a different thread very helpful. This is what I wanted to learn. Thank you again.
I have used Truenas with NFS for years and had this error several times, it was always something on the Truenas side of things. You would need to double check how you create and export your volumes that you are trying to share.
Tried a few more things, tested after each bullet point, still getting “[receiver] chown… Operation not permitted (1)” errors:
Deleted NFS share and recreated (both via GUI).
Deleted SMB share for same dataset after reading @Joulinar’s suggested link (though that one did have a different error)
Copied the entire directory I’m trying to sync over to the target (so that it would only have to sync the files, not create them). The copy worked. Syncing did not.
Set the ACL permissions for the target dataset in TrueNAS to everyone@ Full Control (was Modify)
Looking at the rsync documentation, there’s a way to tell it not to set ownership on the server (related post). Is there a way to set or pass this parameter on dietpi-sync? The dietpi-sync documentation was vague.
How did you copy them? cp -a with -a flag is needed to preserve all ownership and modes.
Usually indeed there does not need to exist a corresponding user/group on the server side, as the UID/GID is what is transferred, and what can be assigned without an actual user inheriting it. However, no idea what NFS share/settings TrueNAS applies. Which owner/group/mode do those failing files have on the client/DietPi side? The filename suffix is temporary, I guess, hence it is pi/unpoller/.unpoller.conf etc.
And are the files actually transferred, just owner/group/mode different, or are those files not transferred at all?
Interesting. Using the -a flag generates the “[receiver] chown… Operation not permitted (1)” error. I can successfully execute a copy command if I do not use that flag. What does that mean and how do I fix the issue?