Re: SUG: Automatic RPM database verification and repair

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

 



Tony Nelson wrote:
I have written a script to automatically verify and repair the RPM database
each day, called rpm_verify_db, at
<http://georgeanelson.com/rpm-verifydb.htm>.

The RPM database is vital to the maintenace of Fedora or any Redhat-branch
Linux.  Yum uses it for updates.  Nothing ever checks it for corruption,
until RPM finally complains.  I personally could not upgrade to FC6 because
of silent corruption, so I wrote this package.

RPM's developer, Jeff Johnson, believes that RPM database corruption is so
extremely rare that it is not worth checking for, and he also notes that
the check that I am using is inadequate.  It is, however, the best /check/
available in RPM.  It can fail to detect problems that RPM may report when
doing transactions that update the RPM database.  See the thread at
Redhat's rpm-list, "SUG: Automatic RPM database verification and repair".

RPM may be able to rebuild the database if corruption is found (by RPM, or
by my package, or by running "rpm --verifydb" by hand).  To rebuild the RPM
database, run "rpm --rebuilddb" as root (which is what my package does).
However, --rebuilddb simply rebuilds the database; it does not say whether
there were errors in the old database, so it is not itself a /check/ of the
database.


Thanks for the effort! I will try your package since running
rpm --verifydb just gave me a return of the below pasted error. This is on the development version for reference.

 rpm --verifydb
rpmdb: Page 3: hash page has bad prev_pgno
rpmdb: /var/lib/rpm/Group: DB_VERIFY_BAD: Database verification failed
error: db4 error(-30975) from db->verify: DB_VERIFY_BAD: Database verification failed
[root@cornette-dell-hdb ~]# locate __db
/var/lib/rpm/__db.000
/var/lib/rpm/__db.001
/var/lib/rpm/__db.002
/var/lib/rpm/__db.003
[root@cornette-dell-hdb ~]# rm /var/lib/rpm/__db*
rm: remove regular empty file `/var/lib/rpm/__db.000'? y
rm: remove regular file `/var/lib/rpm/__db.001'? y
rm: remove regular file `/var/lib/rpm/__db.002'? y
rm: remove regular file `/var/lib/rpm/__db.003'? y
[root@cornette-dell-hdb ~]# rpm --rebuilddb
[root@cornette-dell-hdb ~]# rpm --verifydb
[root@cornette-dell-hdb ~]#

Afterwards, it comes back clean.

Jim

--
Prototype designs always work.
		-- Don Vonada


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux