SETUP
I run two NAS boxes and RSYNC from one to the other.
The server, the source of the RSYNC, runs on an old FreeNAS system and the RSYNC client runs on a NAS4FREE system. The full system details are given below:
SERVER:
Version 0.7.1 Shere (revision 5127)
Built on Sun Apr 11 00:21:36 JST 2010
OS Version FreeBSD 7.2-RELEASE-p7 (revision 199506)
Platform i386-embedded on Intel(R) Pentium(R) 4 CPU 2.40GHz
CLIENT:
Version 9.1.0.1 - Sandstorm (revision 573)
Built date Sun Dec 16 14:58:29 JST 2012
Platform OS FreeBSD 9.1-RELEASE (reldate 901000)
Platform x86-embedded on Intel(R) Celeron(R) M processor 1400MHz
System Quanta 09B8 Bios: F.08 09/15/2004
THE PROBLEM
I have setup the same users and groups on both servers so that they are, after the RSYNC has done it's work, a mirror of each other.
The problem is that that UID associated with the same user is different on each NAS server. So, for example, the user FRED on the FreeNAS RSYNC server has a UID of 1002. When any objects owned by FRED are copied to the Nas4Free RSYNC client, they are owned by user BOB who has the UID of 1002. This is despite the fact that the user FRED IS defined on the receiving client system. It's just that FRED's UID on the client is not the same as it is on the RSYNC source/server !
The client RSYNC Advanced Options look like this:
Recursive YES
Times YES
Compress YES
Archive YES
Delete After.
Quiet NO
Preserve permissions YES
Preserve extended attributes YES
Reverse direction NO
RESOLUTION
I cannot change the UIDs from the Nas4Free GUI. Is there a command line function to do this ? Ideally I would like to upgrade my FreeNAS server to Nas4Free and any links would be gratefully received. The format of the backup configuration XML is slightly different but can be easily tweaked I think !? Whatever, the case, this doesn't seem to me to be about mismatching NAS server implementations more to do with RSYNC !?
Any help to get this resolved would be gratefully received...
This is the old XigmaNAS forum in read only mode,
it will taken offline by the end of march 2021!
I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!
it will taken offline by the end of march 2021!
I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!
Rsync incorrectly applying ownership by UID
-
sukiami
- NewUser

- Posts: 1
- Joined: 26 Jan 2013 21:23
- Status: Offline
-
al562
- Advanced User

- Posts: 210
- Joined: 12 Dec 2012 08:02
- Location: New Jersey, U.S.A.
- Contact:
- Status: Offline
Re: Rsync incorrectly applying ownership by UID
Hi Sukiami,
Thanks you for posting good system information.
I think you can fix this in a couple of different ways:
Please post here again if you have further questions.
Regards,
Al
Thanks you for posting good system information.
I think you can fix this in a couple of different ways:
- When you create a new user you can enter the user number of your choice. So if you deleted the current users and created them again with matching UID's it should work. I think this may be the easiest choice for you.
- You can use Auxiliary Parameters on the client to force the files to be created with the appropriate ownership/permissions. See rsync man for the appropriate switches.
Please post here again if you have further questions.
Regards,
Al
-
Reeshar
- NewUser

- Posts: 1
- Joined: 29 Mar 2015 13:29
- Status: Offline
Re: Rsync incorrectly applying ownership by UID
I did the first of these two options - thanks! - when I encountered problems with a non-matching UID being replicated from my other NAS. I deleted the old user and added the user back again with a UID that matched that on the other NAS.
Worth mentioning that you can update the UID for existing files/directories which might have remnants of the old UID by changing to the relevant directory and then running a find/chown command as root eg:
changes all instances of an orphaned UID 1028 to the current UID for joe.
If you do this from the root of the NAS file system in "/mnt" then it will make the change across the whole of the rsync'ed file system.
Finally, it's worth mentioning that rsync does its best to match up users between two systems but... it is case-sensitive! So if you have user Joe on your source system and have created a user joe on your destination system, rsync won't associate Joe with joe. You have to match the spelling and case of source and destination users exactly.
Richard
Worth mentioning that you can update the UID for existing files/directories which might have remnants of the old UID by changing to the relevant directory and then running a find/chown command as root eg:
Code: Select all
find . -user 1028 -exec chown joe {} \;
If you do this from the root of the NAS file system in "/mnt" then it will make the change across the whole of the rsync'ed file system.
Finally, it's worth mentioning that rsync does its best to match up users between two systems but... it is case-sensitive! So if you have user Joe on your source system and have created a user joe on your destination system, rsync won't associate Joe with joe. You have to match the spelling and case of source and destination users exactly.
Richard