[vox-tech] recovering /usr with dpkg

Henry House vox-tech@lists.lugod.org
Sun, 1 Jun 2003 12:47:53 -0700


--k1lZvvs/B4yU6o8G
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Jun 01, 2003 at 12:19:58PM -0700, Nick Donnelly wrote:
> I recently had a drive fail in one of my boxes.  Most of that drive was p=
art
> of a RAID 5 array, so I will be able to recover that partition relatively
> easily.  My question is about recovering the /usr partition on that drive.
> All my other major system directories are on partitions on other drives, =
so
> I still have an intact /var/lib/dpkg/status.  I haven't used dpkg --audit
> previously, so  I am assuming when it discovers a fresh, completely empty
> /usr, it will mark pretty much everything as needing reinstallation  I ha=
ve
> never had a package marked in need of reinstallation before. .  Where wil=
l I
> go from there?  What should my next command be?

Using dpkg --audit will not do what you want---its purpose is to identify
packages that are not fully installed. Missing files from installed packages
will not be found.

I have had situations like yours before. As I recall, I recovered by
reinstalling every package. (I just grabbed the list from dpkg -L, but if
dpkg is broken you could look for filenames in /var/lib/dpkg/info, remove
suffixes, then pipe through sort -u. Either way, proceed by saving the list
of packages to a file, then reinstal using 'cat package-list | xargs apt-get
install --reinstall'.) There is not much point in culling any packages from
the list because every Debian package has at least one item in /usr (even it
it is just the docs*).

* I believe Mike has a post in the archives somewhere about the excellent
  trick of recovering a missing /var/lib/dpkg by exploiting Debian's
  requirement that all packages must have an entry in /usr/share/doc.

--=20
Henry House
The attached file is a digital signature. See <http://romana.hajhouse.org/p=
gp>
for information.  My OpenPGP key: <http://romana.hajhouse.org/hajhouse.asc>.

--k1lZvvs/B4yU6o8G
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+2lhpi3lu92AVGcIRApsFAJ94D3iBkjJPq0wL7oTxmN1coo25CACdHIhf
tCIZtNANDglAphB+2gHLs0E=
=i4Kt
-----END PGP SIGNATURE-----

--k1lZvvs/B4yU6o8G--