Accidentally deleted contents of /var/lib/

jludwig wralphie at comcast.net
Wed Mar 16 22:44:49 UTC 2005


On Wednesday 16 March 2005 02:58 pm, Saurabh Barve wrote:
> Hi,
>
> I am running FC2. I accidentally deleted the entire contents of my
> /var/lib/ directory. As a result, rpm -qa shows up nothing. Also, the
> partitions that I was exporting to another machine through nfs now show
> up empty on the other machine.
>
> Can I just copy over the contents of /var/lib/ from another FC2 machine?
> Or do I need to reinstall FC2 on this machine? Or is there a simpler way
> to recreate the contents of /var/lib?
>
> Any help or pointers are appreciated.
>
> Thanks,
> Saurabh.
>From what I understand ;

This is a copy of my /var/lib;

 ls /var/lib/
alternatives  logrotate.status  random-seed   texmf
dhcp          misc              rpm           up2date
games         nfs               scrollkeeper  xdm
htdig         ntp               slocate       xkb
jack          pcmcia            smart

The rpm directory is the most problematic since this has data as to what is 
installed.
>From man rpm;
   Database
       /var/lib/rpm/Basenames
       /var/lib/rpm/Conflictname
       /var/lib/rpm/Dirnames
       /var/lib/rpm/Filemd5s
       /var/lib/rpm/Group
       /var/lib/rpm/Installtid
       /var/lib/rpm/Name
       /var/lib/rpm/Packages
       /var/lib/rpm/Providename
       /var/lib/rpm/Provideversion

These should/could be rebuilt using rpm;
   REBUILD DATABASE OPTIONS
       The general form of an rpm rebuild database command is

       rpm {--initdb|--rebuilddb} [-v] [--dbpath DIRECTORY] [--root DIRECTORY]

       Use --initdb to create a new database, use --rebuilddb to rebuild the 
database indices from the installed package headers.

cron will fif the slocate data base.

The rest of the directories could probably be 'hand built'  (S.A. mkdir dhcp).

This should hopefully start the process.
-- 
John H Ludwig




More information about the fedora-list mailing list