On Mon, Feb 23, 2009, Bart Schaefer wrote:
Over the weekend my workstation (still on CentOS 3) started showing SMART errors, so we shut it down and moved everything onto a new drive. On reboot, the RPM database reports as corrupted and "rpm --rebuilddb" segmentation faults.
Is there any reasonable way to recover from this, short of a complete reinstall? The machine is otherwise up though it's quite likely some files have been lost.
You may be able to get things going again with the bdb recover script, /usr/lib/rpm/rpmdb_recover. I think this should be a berkeley DB recovery routine that is specific to the version being used by rpm. I have recovered the OpenPKG rpm database using this technique using the standard bdb db_recover program.
If I am not mistaken, the appropriate command would be:
/usr/lib/rpm/rpmdb_recover -h /var/lib/rpm
Bill