[clug] syncing via a USB memory stick

Alex Satrapa grail at goldweb.com.au
Wed Nov 24 00:03:08 GMT 2004


> I put an ext2 filesystem on the memory stick, and rsync'ed the relevant
> directories from my home machine.  Now, I can rsync onto my work 
> machine,
> but I have a different uid so I can't rsync back from my work machine 
> to
> the memory stick - I don't have the root password so rsync fails to
> chown/chmod, and I don't want to make all my files ugo+wr.

I worked around this problem by using vfat on the memory card, and 
mounting it using the uid and gid options, into a directory that was 
mode 700 to myself. This way, "visitors" to the machine can't see the 
card when it's mounted (they can tell that it is mounted, but only you 
and root can see what's on it).

The catch is that you can't set specific permissions (such as changing 
your SSH directory to be 700, with all the files inside being 600). SSH 
will complain if you try to load your keys from the USB drive, but when 
you rsync from there to your desktop the permissions are supposed to be 
left intact on the destination, unless you use --perms, --owner and/or 
--group.

You'll get a swathe of errors as rsync reports its chmod attempts 
failed, but the data will be transferred correctly.

One option which occurs to me is to use user mode linux, with your home 
machine's idea of name/uid mappings, and use a network rsync operation 
- this will preserve permissions based on user and group names unless 
you use the --numeric-ids option. However, I have no idea how UML 
works, so this may not even be possible (does UML allow different UIDs 
to be specified in its own /etc/passwd files?)

HTH
Alex



More information about the linux mailing list