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

Re: Fixing Broken System



> Due to an intermittent hard drive error which has since been fixed, my
> root partition has taken significant but not sweeping damage.  Most
> binaries still work, but a few don't, such as df, cat, and mount.  I
> don't know precisely how much was damaged, nor do I know an easy method
> of determining this.

I had the same problem, on a Mac Cube shipped via UPS ground.
I'd get lots of errors.

> That said, is there any way of forcing apt to reinstall all installed
> packages or something?  From what I can tell, upgrade and dist-upgrade
> only reinstall changed packages.  Or perhaps I can install the potato
> base and use my existing apt database to tell it what packages to
> install?  What is the recommended way of recovering such a broken
> system?

-- STEP ZERO --

Make a backup: /root /home /etc /usr/local /boot /lib/modules

-- STEP ONE --

First you need to force the disk to allocate replacement sectors.
Use e2fsck, dd, cat, or the badblocks program to read your whole disk.
Do this without X running, so you can write down all the bad spots.
Then use "dd" to write something, like this:

dd if=/dev/zero of=/dev/hda bs=4k count=1 seek=34234234

Be sure to not make a mistake! Whole disk or partition?
Ext2 blocks or 512-byte blocks? Bad spots are likely to
cover 10 to 1000 kB each.

-- STEP TWO --

Run "sync", wait a few seconds, then hit the power switch.
(seriously, to force a fsck pass at boot)
Reboot.
Repeat until fsck is happy.

-- STEP THREE --

/bin/rm -rf /mklost+found/*
apt-get install --reinstall apt gawk mawk dpkg-awk apt-utils
apt-get install --reinstall `dpkg --get-selections | awk '/install$/ {print $1}'`


-- 
To UNSUBSCRIBE, email to debian-powerpc-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: