change UID+GID on target system?

Kevin Korb kmk at sanitarium.net
Mon Jun 18 08:20:56 MDT 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The problem is that you have different UIDs on different systems but
are trying to use the same file system.  The files within the file
system have the ownerships stored only by the numeric UIDs not the
user names.  If you then take that file system and connect it to
another system that has a different user<>UID mapping it will not be
correct (this even applies to NFS).

The solution is to use the same user<>UID mappings on all systems or
in the case of a removable drive to use a file system that does not
store ownerships so that the mount options can specify a file system
wide owner.

On 06/18/12 08:36, Uwe Brauer wrote:
> 
> Hello
> 
> I googled about my problem and found some hints but not a complete
> solution.
> 
> Situation: On laptop 1, I am user oub (uid=1000) and in the sudo
> list. I connect an USB drive (jfs file system), its get
> automatically mounted with the correct uid. I copy files with rsync
> from laptop 1 to the USB. ( rsync -auvz --progress /home/oub/files
> /media/usb )
> 
> However: On laptop 2, I am user oub (uid=1002) and in the sudo
> list. Now when I connect the USB (jfs file system) its get
> automatically mounted however as uid=1000 which is another user on
> Laptop2. There is a patch for mount which allows to set the UID
> and GID of the usb drive, but this patch is not standard. 
> https://lwn.net/Articles/497106/
> 
> So the only solution I see is to use chmod -R (and chgrp -R) on the
> target system and then run rsync to copy from the USB to Laptop2.
> 
> And later to the inverse operation.
> 
> Is there any possibility that rsync, running with sudo, changes the
> files it copies to the UID +GIDof the target system?
> 
> 
> Thanks and regards
> 
> Uwe Brauer
> 

- -- 
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
	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.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/fOUgACgkQVKC1jlbQAQesBACcDCNHGtHa8cYLMW7d6VmOdSPO
qTEAnjUWe6S1jYgKEmJkgW8l8n2R9/Ur
=raRm
-----END PGP SIGNATURE-----


More information about the rsync mailing list