[NTLUG:Discuss] Restore owners

Greg Edwards greg at nas-inet.com
Sat Mar 8 13:29:57 CST 2008


Robert Citek wrote:
> On Fri, Mar 7, 2008 at 9:42 AM, Greg Edwards <gedwards at netbsa.org> wrote:
>> If anyone has root access and a RHEL 5.0 or 5.1 install and can send me an
>> ls -lAR | grep -v "root root" listing from /usr/lib I'd be grateful.
> 
> Another solution might be to install RHEL5 on a spare box or in a VM.
> Then run this script as root to get the permissions:
> 
> $ find /usr/lib ! -uid 0 -a ! -gid 0 | xargs stat -c "%n %u %g" > owners.txt
> 
> Copy the owners.txt file to the old box and run this script:
> 
> $ cat owners.txt| while read name uid gid ; do
>   chown ${uid}:${gid} $name
> done
> 
> Good luck and let us know how things go.
> 
> Regards,
> - Robert

This is an option, but not a current option.  We'll be setting up the 
production server in a couple weeks and I'll be able to do that then. 
But at the moment I don't have any available resources to install a 2nd 
instance on.

OBTW, for future reference, the use of uid and gid for something like 
this is rather dangerous.  Not all installs will have the same numeric 
user and group id mappings.  Adding different packages will install 
different users and the order may not be the same from one machine to 
the next.  Using the names insures that the correct numbers get assigned 
to the files.

-- 
Greg Edwards



More information about the Discuss mailing list