[Dirvish] Question about UIDs and GIDs
joe_linux at westnet.com.au
Wed Aug 15 04:58:23 UTC 2012
Thanks for the welcome.
At 12:25 PM 15/08/2012, you wrote:
>hurray! a question I can help with!
Don't be too eager Wes, I probably have lots more questions coming as
I become less ignorant of what dirvish does and how best to use it.
For example, I am likely to soon ask about expiring backups,
archiving backups to DVD/Blu-ray and deleting the hard disc versions etc.
>firstly, welcome Joe.
>as you've noticed, the numerical UID and GID is preserved during
>backup. If the restore is done in the same fashion as the backup,
>the numerical UID and GID will also be preserved during restore.
>It's up to the machine the file is being accessed from (as opposed
>to the machine the file is being stored on) to determine what names
>those numbers correspond to.
>this is a common problem with any backup software. unfortunately,
>often a restore is needed after a total crash of a machine, thus
>having the name/ID matchup either disappear (you DO backup your
>passwd file, right?) or become out of sync or otherwise fubar. If
>you're backing up the entire system, this should not be an issue. If
>you're only backing up user data, this may well be a problem.
Hmmm ... I'm not sure that we are backing up the passwd file. I am
almost certain we don't, on any of the machines. The dirvish backups
just backup the /home directory tree as far as I can see, and there
are no other backups done that I am aware of. Sounds like a no there
for passwd which I will fix asap (and I guess group as well).
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?
>people doing restores often have to go through the process of
>chown/chmod after restoring. when I restore many users' data (ok, I
>only actually did this once) I ran a loop in bash to chown the files
>to the name of the directory under /home. in my case, the
>directories had the same names as the users. I don't recall the
>exact incantation, and I'm sure I tried several times before I got
>it right. something along the lines of:
>for a in ls;do chown -R $a:$a $a;done
>so for the following contents of /home:
>central joe vince wes
>we should see a loop 4 times of this:
>chown -R central:central central
>chown -R joe:joe joe
>chown -R vince:vince vince
>chown -R wes:wes wes
>obviously, this gets more complicated if you're restoring more than
>just user data, or if your users' primary groups are not their own
>groups (and they are different; if they're the same, just specify
>that instead of the variable).
>hopefully some of this makes sense. please feel free to respond back
>with any further questions you may have :)
The above sort of makes sense but will take a little more digestion
on my part. I found something very similar on a website when I was
googling earlier so you have reinforced what I read earlier. At the
moment, on all but one machine, it is just user data, all of which is
stored in the various/home locations and those are my primary concern for now
I have been doing a test restore of a backup run yesterday, back onto
the original machine (into a temp directory as I thought this would
be best to not endanger any of the existing user files; it is my main
working machine - good or bad idea?) and the owners and groups appear
to have been changed for the restored files. For example, the whole
/home/central directory tree which used to be owned by user central,
group central is now showing on the restored files to be owned by
user joe, group joe. Has my doing the restore to a different location
affected the ownership?
I guess that means that I would have to run the loop to change them back?
I also just realised that I haven't used the exact same command to
restore as was used to do the original backup. Should I have done
this with effectively the source and destination swapped around? Is
that what you meant earlier when you said "if the restore is done in
the same fashion as the backup"?
Thanks in advance again.
>On Tue, Aug 14, 2012 at 8:21 PM, Joe Aquilina
><<mailto:joe_linux at westnet.com.au>joe_linux at westnet.com.au> wrote:
>I am relatively new to Linux and even more so to Dirvish. I have
>inherited the admin of a system where some of our machines are backed
>up nightly via dirvish to a central server. The current system has
>been in place for some years and I am just beginning to learn about
>how it all works. We haven't yet had to restore anything yet which is
>good because I am not yet sure of exactly how to do that.
>Experimenting with that on another computer as I type here...
>My question relates to UIDs and GIDs of user accounts on the systems
>being backed up. On these systems, there a number of users, some of
>which are duplicated across the various machines, usually with
>different UIDs and/or GIDs on the various machines. These are also
>different to the IDs used on the corresponding accounts on the backup server.
>When I look at the backups on the server after they complete, the
>directories &files have the UIDs and GIDS for the accounts as they
>exist on the backup server. These correspond to the numeric IDS from
>the machines that have been backed up.
>For example, there may be an account called joe, in group joe on a
>machine to be backed up with a UID of 1002 and a GID of 1003. When
>the backup completes, and I check it, everything has an owner for
>example of central and a group of vince. These correspond to accounts
>on the backup server of central with a UID of 1002 and a GID of 1003.
>Hope this makes sense.
>Does this matter? Is there going to be a problem if I restore the
>files back to the original machine? Will the UID & GID revert back to
>joe when the restore is done? Do I need to change anything on the
>system(s) for future backup runs to avoid this?
>Do you need any more information (e.g. contents of master.conf,
>default.conf, rsync command for the backup or anything else) to be
>able to assist with this query?
>I am hoping I am worrying about nothing but I don't fully understand
>dirvish yet so am a bit apprehensive about changing anything (and
>shudder at the thought of possibly having to change all the UIDs and
>GIDS on the various machines and then changing all the files!) I have
>other dirvish questions but will follow up with those if I can't work
>out an answer for myself. Thanks in advance.
More information about the Dirvish