Re: recovering /var, especially /var/lib/dpkg

2002-10-22 Thread Karl E. Jorgensen
On Mon, Oct 21, 2002 at 10:48:05PM -0600, Bob Proulx wrote:
[ big snip ]
 
 A package which is installed that sees a configuration file already
 present in /etc _should_ avoid asking you questions and just use that
 configuration file.  However, each package will have varying quality
 there and many will still ask you a zillion questions all over again.
 (Some like am-utils will ask a bunch of questions which you must
 answer, then after asking see the previous configuration file and only
 then give you the opportunity to use the previous file discarding the
 answers you were forced to answer but did not need to.  Sigh.)  In
 general Debian packages are way to chatty and ask way too many
 questions during an install.  You just have to put up with it in many
 cases.  If you plan to reset /etc after doing all of the installs
 again then what you answer probably won't matter since they will get
 overwritten.

 Again, this is what I would do.  YMMV.  Good luck!

If the packages use debconf (unfortunately not all do, but...) then you
can avoid most of the questions by:

# export DEBIAN_PRIORITY=critical

which should ensure that you only get asked critical questions.

If you want to be really nasty, then:

# export DEBIAN_FRONTEND=noninteractive

which should ask you *no* questions (at least not through debconf). 

(man 8 debconf for a more reliable source)

If you are going to merge /etc anyway, the latter might be what you want

HTH
-- 
Karl E. Jørgensen
[EMAIL PROTECTED]
www.karl.jorgensen.com
 Today's fortune:
Math is like love -- a simple idea but it can get complicated.
-- R. Drabek



msg08382/pgp0.pgp
Description: PGP signature


recovering /var, especially /var/lib/dpkg

2002-10-21 Thread Dan Christensen
I had a laptop stolen and shortly afterwards the two hard drives on a
server both failed.  Unfortunately, those drives contained the backups
of my laptop, and I wasn't able to recover my backup of /var.  So on
my new laptop I have restored everything except /var, and the question
is whether it will be possible to recover the essential parts of /var.

Luckily, before running each backup I save the output of dpkg -l in
/root, so I have a list of all installed packages and what version is
installed.

Is it possible to use this information to recreate the data dpkg needs
to operate?  What exactly is needed?

[I realize that I could just reinstall all the packages from scratch.
But that would entail answering lots of debconf questions, and doing a
lot of merging of conffiles since many packages will have been updated
since the laptop was lost.  (It was a while ago and I follow testing.)
So I'm hoping to avoid a reinstall.]

After getting dpkg working, are there any suggestions about how to
restore the other parts of /var?

Thanks for any advice.  Please cc me on replies.

Dan

-- 
Dan Christensen
[EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Re: recovering /var, especially /var/lib/dpkg

2002-10-21 Thread Bob Proulx
Dan Christensen [EMAIL PROTECTED] [2002-10-21 23:23:25 -0400]:
 Luckily, before running each backup I save the output of dpkg -l in
 /root, so I have a list of all installed packages and what version is
 installed.

I would ignore the versions unless you really care about something in
particular and just use the list of versions installed.

 Is it possible to use this information to recreate the data dpkg needs
 to operate?  What exactly is needed?

I would compare the list with a list of what you just installed, diff
them, and install the as yet uninstalled packages.

 [I realize that I could just reinstall all the packages from scratch.
 But that would entail answering lots of debconf questions, and doing a
 lot of merging of conffiles since many packages will have been updated
 since the laptop was lost.  (It was a while ago and I follow testing.)
 So I'm hoping to avoid a reinstall.]
 
 After getting dpkg working, are there any suggestions about how to
 restore the other parts of /var?

Hmm...  You rebuilt the machine from backup and therefore dpkg is not
functional at this time?

 Thanks for any advice.  Please cc me on replies.

Probably what I would do is this.  This is me and you will just have
to take the advice at face value and work with it.

I would install a minimal Debian system from scratch.  This ensures a
working dpkg.  Then I would restore /etc from backup which contains
all of the configuration files and personality of the previous system.
Also restore /usr/local and /home and anything you may have installed
elsewhere such as /opt.

Then I would install all of the packages that I was missing.  After
doing the reinstall I would 'diff -ru /backup/etc /etc' and possibly
reset anything that I incorrectly answered during the interactive
install, possibly by restoring /etc again to correct those files.
Assuming that the backup of those files was good to begin with.  This
might be a good time to do spring cleaning.  Reboot.  The system
should boot and look pretty close to your old system.

A package which is installed that sees a configuration file already
present in /etc _should_ avoid asking you questions and just use that
configuration file.  However, each package will have varying quality
there and many will still ask you a zillion questions all over again.
(Some like am-utils will ask a bunch of questions which you must
answer, then after asking see the previous configuration file and only
then give you the opportunity to use the previous file discarding the
answers you were forced to answer but did not need to.  Sigh.)  In
general Debian packages are way to chatty and ask way too many
questions during an install.  You just have to put up with it in many
cases.  If you plan to reset /etc after doing all of the installs
again then what you answer probably won't matter since they will get
overwritten.

Again, this is what I would do.  YMMV.  Good luck!

Alternatively you could do this just to get a good copy of /var which
matches what is on your system.  Back that up.  Then restore the old
everything else with the new /var onto your system.  If you had a
spare disk so as not to undo your present restore that would seem
feasible.

Bob



msg08329/pgp0.pgp
Description: PGP signature