Re: Numerical owners

Denis Corbin <[email protected]> Thu, 26 Oct 2006 18:38:59 +0200
Newsgroups gmane.comp.sysutils.backup.dar.general
Message-ID <[email protected]>
Manuel López-Ibáñez wrote:
 > Hi,

Hello,

 >
 > sorry if this is a silly question but: how am I supposed to restore the
 > actual names? Should I remember all of them?

By restoring the /etc/passwd /etc/shadow files if they ae stored there, 
by restoring the /var/yp directory if you are using NIS. In each file's 
inode is saved a numerical owneship and group, dar saves them and 
restores them not considering their naming representation.

 >
 > And what happens if a UID in the backup conflicts with an existing UID ?

There is no conflict with numerical UID, a file will be restored with 
the UID it had at backup time.

 > Let' say UID=75 in the archive is user svn while in the archive UID=75
 > was user rsync, how I handle this?

it is not in the scope of dar and it will not be for several reasons. 
UID always exist, their corresponding names may not. Consider the 
restoration of a full system from a boot floppy which does not have the 
same /etc/passwd as the one of your original system, you could have for 
example the user 'bin' under UID 1 on your original system and user 
'bin' under UID 2 on the boot system used to restore, while you could 
have UID 2 mapped to some user 'foo' in you original system, user that 
does not exist in the boot system used to restore.

Dar would restore all 'bin' file's user under UID 2 (while it was under 
UID 1 in the original system) and as user 'foo' does not exist for the 
temporary system used the files owned by foo would be restored with UID 
2 which is the one of 'bin' currently. Thus this would not be a proper 
restoration.

Moreover you would restore /etc/password then at reboot time of the 
original filesystem the files with UID 2 would become those of 'foo' 
then all files owned by 'bin' would now be owned by 'foo'.

For many of theses type of problem, dar restores files with the exact 
UID/GID not making any name correspondance. Dar's archive do only 
contain the UID and GID of files, not the original name of files.

last point, if you are not the root user, dar will not be able to set 
the UID/GID, thus you may transfer files within a dar archive between 
two systems where your user account do not share the same UID, while dar 
is not run under the user root this will not cause any problem.

Now, if you need to remap some user, this can easily be done with the 
find command for example:

  find / -uid <old uid> -exec chown <new user> {} \;

just use the appropriate order to not have the merging of files from two 
  users.

 >
 > Thanks for your answers,

Regards,

 >
 > Manuel.
 >
 > PS: please, CC me, I am not in the list.
 >
 >
 >
 >
 >>Numerical owners
 >>From: Wiebe Cazemier <halfgaar@gm...> - 2006-03-26 14:39
 >>
 >> Denis,
 >>
 >> I have a request for a non-feature :). Please, never implement mapping
 >> UIDs and GIDs to names. Rdiff-backup didn't use to do it, but it does
 >> now. The author implemented an option to preserve numerical ids on my
 >> request, but it's not default behaviour. Tar, rsync and rdiff-backup all
 >> three map to names by default, but fall back to UID's when no name is
 >> found.
 >>
 >> But because it's very likely you'll be restoring a dar backup from a
 >> livecd, which has different UIDs-to-names matches than the system you
 >> backed up, it's very easy to mess up your entire system when
 >> restoring/making a backup. If the "bin" user for example has a different
 >> UID on the livecd, the files will have the wrong owner once you boot
 >> into your restored system.
 >>
 >> In my opinion, the backup should be as low-level as possible by default,
 >> to avoid making a mistake by forgetting an option. As far as I know, dar
 >> is the only backup program which is robust enough in that manner, and
 >> thefore the best program to use for system backups. The irony is, that
 >> it's not that well-known a backup tool als rdiff-backup, rsync and tar.
 >> So, a lot of people will have incorrect backups, or accidently make a
 >> mistake and forget the --numerical option upon restoration.
 >>
 >
 >
 >
 > 		
 > ______________________________________________
 > LLama Gratis a cualquier PC del Mundo.
 > Llamadas a fijos y móviles desde 1 céntimo por minuto.
 > http://es.voice.yahoo.com
 >
 >
 > -------------------------------------------------------------------------
 > Using Tomcat but need to do more? Need to support web services, security?
 > Get stuff done quickly with pre-integrated technology to make your 
job easier
 > Download IBM WebSphere Application Server v.1.0.1 based on Apache 
Geronimo
 > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Dar-discussions mailing list
Dar-discussions-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/dar-discussions
signature.asc (application/pgp-signature, 252 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFQOSupC5CI8gYGlIRAlNZAKCLZHSONPa1+uv6vZtj/bEc8IGfswCgv6k1
jnXl+cOuviGe1GyZzQVqj1g=
=Odap
-----END PGP SIGNATURE-----