[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

(sweet recovery!) when rpm --rebuilddb doesn't work! what next?



On Wed, 10 Sep 2003, Michael Fratoni wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Wednesday 10 September 2003 08:49 am, Leonard den Ottolander wrote:
> > Hello Didier,
> >
> > Michael Fratoni wrote:
> > > If  /var/log/rpmpkgs exists and is current (Save it quickly before it
> > > gets rotated by log rotate), and you have available the rpm packages
> > > (On CD, in /var/spoll/up2date, etc.) I have a script that can help.
> > > http://www.tuxfan.homeip.net:8080/hacks/recover_rpm_db.sh
> 
> >  If you are too late to rescue /var/log/rpmpkgs the only solution I see
> > is to install redhat-rpmdb and issue rpm -qf --dbpath
> > /usr/lib/rpmdb/i386- redhat-linux/redhat <file> for a lot of files.
> 
> Just to clarify what happens with /var/logs/rpmpkgs, logrotate isn't the 
> big problem....
> /var/logs/rpmpkgs gets overwritten daily by a cron job. If the cron job 
> has run with no database, the file will probably be empty. However, you 
> should have a copy that is a week out of date. /var/log/rpmpkgs.1 to the 
> rescue, in that case. Not ideal, but better than nothing.
> 

Big thanks Michael! Your script is totally cool!!! I managed to rescue
some /var/logs/rpmkgs.3 file!

Then ran your script with the RH Cds and location of some other RPMS that
my friend downloaded and in less than an hour everything was safely 
rescued. 

Lucky that you wrote such a a script. Out of curiosity, you wrote it just
out of the blue or you wrote it by necessity, i.e Did the disaster happen
to you or any of your clients/friends and thus decided to do something
about it?


Personally I think you should ask RH to include this in their next distro
release. :-) I went on Google and I realized a lot of people make the
mistake of wiping the /var/lib/rpm instead of the __db*! 

I also find out that in SUSE Linux there's a time-stamped backups of the
RPM database in /var/adm/backup/rpmdb and that you can just copy it to
/var/lib/rpm, and everything gets back to normal! Anyway thanks a lot!



regards,

Didier

---
PhD student
 
Singapore Synchrotron Light Source (SSLS)
5 Research Link, 
Singapore 117603

Email: slsbdfc nus edu sg or didierbe sps nus edu sg
Website: http://ssls.nus.edu.sg
www.microtronyx.com (Microtronyx Computer Consulting Group Singapore)





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]