[Dirvish] Question about UIDs and GIDs

Paul Slootman paul at debian.org
Thu Aug 16 13:06:43 UTC 2012


On Thu 16 Aug 2012, Joe Aquilina wrote:
> 
> There doesn't appear to have been any thought given to consistent 
> name <-> id mappings when these machines were originally setup, and 
> sadly not when I rebuilt a couple of replacement machines recently. 
> There are not too many accounts so it may not be all that difficult 
> to remap all the name to the same IDs across all the machines. 
> Haven't convinced the boss of this yet; he seems to think "something 
> is going to go wrong"

One thing you may need to reckon with is e.g. on Debian systems, certain
"system" users are created when the package needing that user is
installed. E.g. on my workstation at work:

Debian-exim:102
statd:103
ntp:105
sshd:108

At home:

Debian-exim:101
statd:102
ntp:108
sshd:103

So synchronising after installation is a real pain.
However, restoring to the same system is no problem with --numeric-ids.

rsync between these systems _without_ --numeric-ids will also do the
Right Thing, as files in /var/lib/ntp/ or whatever need to stay owned by
ntp...

It boils down to what sort of transfer you're doing.


> > > It seems to me that a backup of the whole of the /etc tree is
> > > probably a good idea? If so, I can just create another vault for 
> > that can't I?
> >
> >Yes, backing up /etc is a good idea, and several other places as well.
> >Probably best to google for linux backup to find some ideas for what
> >backup strategy to use. And yes, you can just set up another vault. You
> >will come across a few gnarly details that you can fix up as you go along.
> 
> Other areas I am guessing probably include /usr and /var - which 
> others I should include?

For Debian systems, as far as the system software is concerned I backup
/etc and a list of the packages installed. More should not be necessary
to restore the system software.  Just be sure to restore /etc/passwd and
/etc/group first, before installing _any_ extra packages beyond the base
system, and then install the extra packages, and then restore the /etc
backup with --numeric-ids :-)

In addition to the system software, /home and wherever you store
application data should be backed up. For databases I have a script
that writes a dump in
/var/backup/{mysql,postgresql}/$databasename/$YYYYMMDD.dump.gz
and keeps just a few copies there. And then of course backup
/var/backup/ as well off-system.


Paul


More information about the Dirvish mailing list