Michael
2015-May-18 18:52 UTC
rsync - Management of UIDs and GIDs when reserved on a Remote system
Hi Wayne et al, I've been using Linux for a little over a year now. I'm making improvements to the English phrasing used by luckyBackup which uses rsync. English is my first language and I'm doing this so that I can, then, more accurately make translations for the Spanish language. I would like to know how rsync would manage the situation where the UID and GID(s), of a file being copied to a Remote system, have been reserved on the Remote system. Does rsync search for and allocate the next available IDs? If so, how would a Restore operation function? Can rsync create a log, during a Backup, to record the newly allocated IDs, on the Remote system, so that they can be mapped back to the Source system? Thanks, Michael.
Simon Hobson
2015-May-18 19:53 UTC
rsync - Management of UIDs and GIDs when reserved on a Remote system
Michael <cuscotravelservices at gmail.com> wrote:> I would like to know how rsync would manage the situation where the UID and > GID(s), of a file being copied to a Remote system, have been reserved on the > Remote system. Does rsync search for and allocate the next available IDs?AFAIK, if you don't specify the "numeric-ids" option, then it will match by user/group name - ie it'll do a numeric to name conversion at the source, lookup the name at the destination, get the numeric value for the destination, and convert. So if user fred is UID 1000 on the source and 1010 on the destination, files owned by 1000 on the source will end up as UID 1010 on the destination. If there sin't a matching name then AFAIK it'll do no conversion - you may end up with files owned by either a different user or no user at all. With the above, if user fred doesn't exist on the destination, then files will end up owned by UID 1010. What is fun is copying files on a filesystem from a different system (mounting the virtual disks for a VM on the host) and copying them elsewhere while forgetting the numeric-ids option. You end up with some "interesting" file ownerships !
Kevin Korb
2015-May-18 19:54 UTC
rsync - Management of UIDs and GIDs when reserved on a Remote system
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Rsync has 4 options for this... 1) Write all files as the owner and group that rsync is running as. This is the default and the only possibility when not running as root since only root can create files as a different UID. 2) Copy the user name and group name. This is what you get when you are running as root and use --owner --group or --archive. This means if the 2 systems have the same user name but with different UIDs rsync will translate so that the files come out with the same user name and group name on both systems if possible. If the user name or group name doesn't exist on the target system then the file/dir is created with whatever UID or GID number regardless of whether it is in use by another user or not. 3) --numeric-ids copies both as the number. This is what you normally want for backups. This way you have the exact UID and GID stored on the backups regardless of what those numbers mean to the backup system. Just remember to use --numeric-ids when you restore. This is especially important if you have to restore from a live environment that has completely different UIDs and GIDs than your normal system. That environment would have no idea how to translate names from option #2 during a restore. 4) --fake-super. This writes files like option #1 but also stores what the owner and group name or numeric IDs should be in a user xattr. The same info about --numeric-ids applies. Root access not needed except during restore. On 05/18/2015 02:52 PM, Michael wrote:> Hi Wayne et al, > > I've been using Linux for a little over a year now. > > I'm making improvements to the English phrasing used by luckyBackup > which uses rsync. English is my first language and I'm doing this > so that I can, then, more accurately make translations for the > Spanish language. > > I would like to know how rsync would manage the situation where the > UID and GID(s), of a file being copied to a Remote system, have > been reserved on the Remote system. Does rsync search for and > allocate the next available IDs? > > If so, how would a Restore operation function? Can rsync create a > log, during a Backup, to record the newly allocated IDs, on the > Remote system, so that they can be mapped back to the Source > system? > > Thanks, Michael. >- -- ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~ Kevin Korb Phone: (407) 252-6853 Systems Administrator Internet: FutureQuest, Inc. Kevin at FutureQuest.net (work) Orlando, Florida kmk at sanitarium.net (personal) Web page: http://www.sanitarium.net/ PGP public key available on web site. ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~ -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlVaQ30ACgkQVKC1jlbQAQc58wCcDoGUwb6kotWfPYIL0UTeFhyV BWsAoNPE2ghqQX4xqE8wDlWilYPsShLe =nZpc -----END PGP SIGNATURE-----
Michael
2015-May-19 01:16 UTC
rsync - Management of UIDs and GIDs when reserved on a Remote system
Kevin Korb <kmk <at> sanitarium.net> writes:> > 3) --numeric-ids copies both as the number. This is what you normally > want for backups. This way you have the exact UID and GID stored on > the backups regardless of what those numbers mean to the backup > system. Just remember to use --numeric-ids when you restore. This is > especially important if you have to restore from a live environment > that has completely different UIDs and GIDs than your normal system. > That environment would have no idea how to translate names from option > #2 during a restore.Hi Kevin, Regarding the option --numeric-ids, how would rsync manage the situation where the UID and GID(s), of a file being copied to a Remote system, have been reserved on the Remote system. Does rsync search for and allocate the next available IDs? Thanks, Michael.
Possibly Parallel Threads
- rsync - Management of UIDs and GIDs when reserved on a Remote system
- rsync - Management of UIDs and GIDs when reserved on a Remote system
- rsync - Management of UIDs and GIDs when reserved on a Remote system
- rsync - Management of UIDs and GIDs when reserved on a Remote system
- --link-dest not working on remote server (running daemon)