Howard Bampton wrote:
> Todd D. Taft <[email protected]> wrote:
> > Thanks to a reorganization, I have to move about 50 Linux systems from the
> > LDAP server run by one group to the LDAP server run by a different group.
> > In most cases, the UIDs (uidNumber) and GIDs (gidNumber) for a given user or
> > group don't match between the systems.  Since most files are accessed via
> > local filesystems or NFS, I think I will need to renumber the ownership of
> > all of the files on these systems.  Are there any tools/utilities available
> > (or hints from people who have done similar projects) that make this process
> > less painful and go faster?
> 
> If you are doing one user at a time, try something like this (GNU
> find/xargs required):
> 
> find /path/to/fix -user olduid -print0 | xargs -0 chown -h newuid
> 
> Reasonably efficient (and won't churn out processes for each file).
> Walks the filesystem once per user.
> 
> If you are doing all users at once, then you need an ugly find (I
> don't recall the precise syntax) that does something like this:
> find /path/to/fix \( -user olduid -exec chown -h newuid \) -o \( -user
> olduid#2 -exec chown -h newuid#2)
> 
> Walks the filesystem once, beats the heck out of the process table
> (one exec per file).

Nice. As a QA step, test for stray orphaned files:

 find / \( -nouser -o -nogroup \) -exec ls -ld {} \;

(Suggested by "Moe Trin" in alt.os.linux.redhat 
 <[email protected]>)

-- 
Charles

_______________________________________________
Tech mailing list
[email protected]
https://lists.lopsa.org/cgi-bin/mailman/listinfo/tech
This list provided by the League of Professional System Administrators
 http://lopsa.org/

Reply via email to