packages list

Place to discuss Fedora and/or Red Hat

packages list

Postby Stryker » Tue Jun 08, 2004 7:39 pm

Anyone know of a way of regenerating the list of installed packages for redhat? /var/lib/rpm got deleted and no rpm doesnt query any packages and i get a million dependencies that i have installed when trying to install an rpm. Any suggestions?
Stryker
scripter
scripter
 
Posts: 98
Joined: Thu Jan 23, 2003 8:50 pm

Postby Void Main » Tue Jun 08, 2004 8:03 pm

How does /var/lib/rpm get deleted? I think it might be just as easy to reinstall as it would be to rebuild the database. It's not impossible but I don't know of any "easy" way to do it. A "rough" idea of what you will be in for:

http://hermes.afaa.asso.fr/users/pascal ... -rebuilddb

Of course restoring from a system backup would be the easiest way to recover it. :) Good luck, and if you do find a good way to do it I would be more than happy to make a tip about it. In my 10 years of using RPM I don't think I've *ever* had to rebuild an RPM database from scratch. I do remember coming close once on an upgrade several years ago and getting very nervous but I was able to recover the database.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Stryker » Tue Jun 08, 2004 8:37 pm

i think i got it, i just stuck in the cds 1 by one and did:

cd /mnt/cdrom1/RedHat/RPMs
rpm -ivh --nodeps --justdb *.rpm

and its all back.
Stryker
scripter
scripter
 
Posts: 98
Joined: Thu Jan 23, 2003 8:50 pm

Postby Void Main » Tue Jun 08, 2004 9:25 pm

Cool! It didn't install packages in the database that you really didn't have installed did it? Also, most of my packages have been updated via apt so the versions would all be wrong.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Stryker » Tue Jun 08, 2004 9:33 pm

well I just installed it like 3 days ago, and I did a full install so its fine. I tried installing apt before and rpm froze so someone told me to clear out /var/lib/rpm to fix it so i did and it turns out i was only supposed to delete certain files. Oh well though. It works now so i'm happy.
Stryker
scripter
scripter
 
Posts: 98
Joined: Thu Jan 23, 2003 8:50 pm

Postby Void Main » Tue Jun 08, 2004 10:13 pm

User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Stryker » Wed Jun 09, 2004 12:16 am

those files

i like fixing problems though, if my computer was error free all the time id go crazy
Stryker
scripter
scripter
 
Posts: 98
Joined: Thu Jan 23, 2003 8:50 pm

Postby ZiaTioN » Wed Jun 09, 2004 4:38 pm

Void Main wrote:How does /var/lib/rpm get deleted? I think it might be just as easy to reinstall as it would be to rebuild the database. It's not impossible but I don't know of any "easy" way to do it. A "rough" idea of what you will be in for:

http://hermes.afaa.asso.fr/users/pascal ... -rebuilddb

Of course restoring from a system backup would be the easiest way to recover it. :) Good luck, and if you do find a good way to do it I would be more than happy to make a tip about it. In my 10 years of using RPM I don't think I've *ever* had to rebuild an RPM database from scratch. I do remember coming close once on an upgrade several years ago and getting very nervous but I was able to recover the database.


How would you create a "system backup" aside from ghosting your drive? A backup that would be an exact image of your current working system or just a backup of key files or directories?

Do you create system backups (nightly or weekly, etc.) and if so what method do you use/recommend?
ZiaTioN
administrator
administrator
 
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm

Postby Void Main » Wed Jun 09, 2004 5:38 pm

There are hundreds/thousands of ways you can do system backups. I assume you are interested in a backup method for home and not for a corporate setting and I also assume that you don't have a backup tape drive/library. If this is the case then you probably want to be selective in what you backup. Just having a second copy of your important stuff somewhere is better than nothing.

You could write a script to tar/gzip your important stuff and schedule it however often you want via cron and have it copy the resulting backup file to another machine, or to a CDRW/DVDRW, or to another drive on the same machine if you have to, or maybe even to your digital video camera. You could make it a little more elaborate to do incremental backups of your important stuff nightly and a full backup of your important stuff weekly (I do this on a couple of my home machines).

You could also use "rsync" from a cron job to keep your important stuff synced to a location on another machine (or even on the same machine). For me I like to have "/home" and "/etc" as the most important things to back up. If I am running MySQL or PostgreSQL I also do a database dump to a location under "/home" so the databases will also be backed up. You might also want to back up "/var/lib". ;)

At work we have these large robotic tape libraries and we do full/incremental backups with of all of our servers to these libraries over the network using Veritas Netbackup and we keep all of our important stuff on the servers. I also have a DLT library for some personal servers that I use an open source/free backup solution called "Amanda" that works very similar to the commercial Veritas software:

http://www.amanda.org/

I don't personally care for "image" backups although you can do those as well using the tool you mention or for a client server image backup solution you can use the utility called "partimage" (comes with Red Hat, KNOPPIX and I'm sure other distros):

http://www.partimage.org/
http://www.partimage.org/screenshots.en.html

It is menu driven, just select a partition and create an image either locally or to a server.

If my firewire was working in FC2 on my main home desktop I could back my system up to my Sony digital video camera like I did with RH9 and FC1:

http://dvbackup.sourceforge.net/

The camera makes a nice 8mm tape backup drive. :)
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby ZiaTioN » Thu Jun 10, 2004 9:41 am

You are correct in assuming I want to create home backup and not interested in a corporate solution. You are also right in assuming I do not have, nor am I interested in having, a tape drive. :)

I currently have a server acting as a network file server for the rest of my machines equipped with 100 gigs of HDD space and another 200 gigs on the way. I will probably write a Perl or shell script to backup to this server mounted on my Linux box. I have read quiet a few articles (on line) that recommend to back up specific directories and /home and /etc are always 2 of them but the others differ.

What (if any) more directories would you or anyone else feel neccessary to include in this backup? Reading the original posters issue got me thinking that "hey I do not have decent backups either!". Would the rpm data base be included in the /etc backup?

Edit:
By the way what is a decent cp command syntax to use. I have messed around with a few and get errors on all of them

Here is the current try:

cp -abuf --reply=yes


This complains about not being able to create symbolic or hard links and also complains about not being able to replace certain directories with non directories (not sure what this second one is about).

I just want to make an exact copy preserving permissions and such and also preserving all links.
ZiaTioN
administrator
administrator
 
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm

Postby Void Main » Thu Jun 10, 2004 3:49 pm

If you are using "cp" to do a backup (I wouldn't) then usually you would just use "cp -a source dest". The RPM database resides in /var/lib/rpm. What you need to back up depends a lot on how you use your system and how you want to be able to restore parts/all of your backups. Most people are only going to want to make sure they have their user data backed up and their coniguration data. This would mean "/home" and "/etc". If you lose your entire system, also having a backup of your RPM database really isn't going to do you any good anyway since you are going to have to reinstall the OS and it will get rebuilt during the reinstall. You want to back up things that you can't get back if you lose a drive.

If you do a complete backup you would not have to reinstall but could just stick a new drive in and restore the complete backup to the drive and reinstall your boot loader to the MBR and away you go. A complete backup takes up a lot more space and time obviously so you might only want to do a partial backup of just the absolute important stuff that you can't get back in a disaster. You should also periodically evaluate your backups to make sure A) they are still running and B) you haven't started putting data outside of the directories that are being backed up. Installing Red Hat takes me about 15 minutes so I personally have no reason to back up the entire system. Restoring configuration and user data might only take another 30 minutes and you are back up to "roughly" where you were before the disaster. Of course I can't ever remember having a disaster where I completely lost a system and had to restore fully.

There is a nice thing about doing thoughtful backups. I think Murphy has something to do with this but if you have good backups usually you never have disasters. If you do not have good backups you will surely have a disaster that bites you in the butt sooner or later. I have been using Linux for like 12 years now and as I said, can't remember having a disaster where I've lost something important. The worst that has happened to me is I have had a few drive failures over the years, but none where I have lost total access to the drive and not be able to get my important data from it or from a backup. All drive failures came on slowly and gave me time to pick a day to migrate off of the bad drive and replace it with a good drive. I have also had plenty of drive failures on servers but 99% of the servers I build have RAID controllers in them and if a drive fails you can just hot swap them and the OS never knows that a drive had failed. RAID is another option but doesn't negate the need for good backups.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA


Return to Fedora/Red Hat

Who is online

Users browsing this forum: No registered users and 1 guest

cron