I helped out a friend the other day that accidently removed part of /usr
from his system while trying to rearrange his server.  He was going to
move /usr to another partition when he decided not to and accidently
rm -r'd the original.  He caught it before it finished, but thought he
was going to have to reinstall.  Here's how I helped him avoid
reinstalling from stratch.

His system was running Redhat 9, which uses RPM to manage packages.  RPM
keeps a database of all files installed on a system from an RPM package.
Luckily RPM still worked as tested by doing an `rpm -qa` to get a list
of packages installed.

The first task is to get a list of files that are missing from the
system.  Do this using RPM's verify operation.

  rpm -Va --nomd5 | grep ^missing | awk '{print $2}' > /tmp/missingfiles

This will get a list of all files that are supposed to be installed on
the system, but are missing.  The next step is to find out which
packages these belong to and filter the list down to a unique list of
packages.

  cat /tmp/missingfiles | xargs rpm -qf | sort | uniq > /tmp/reinstall

There's your list to go through.  Get these packages off either your CDs
or the net.  You'll want to use `rpm -Uvh --replacepkgs` to install
them.

Needless to say, he was impressed and happy that he didn't have to
reinstall from scratch.  Another happy, part time, Linux user. :)

Nate

_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
http://www.mn-linux.org tclug-list at mn-linux.org
https://mailman.real-time.com/mailman/listinfo/tclug-list