Use of Knoppix for hard drive repair

Replies:

  • None.

Parents:

  • None.

--=-9tquc7zHa/vJjGFH+2/V
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Hello,

Last Saturday I turned on my laptop only to get the
message "Checksum error" on booting. After that, subsequent
boots produced only a blinking cursor, not even the
usual lilo stuff from the MBR.

I popped a Knoppix CD in and was able to boot from it.
Clearly I was having some hard drive issue, although I'm
not sure what caused it. In any case, fsck and fdisk revealed
a bunch of problems. I corrected some of them using
the "-b" option of fsck.ext3. I was happy to have backup
superblocks.

However, I ended up wiping clean the partition that I mount
on "/", either because I did the wrong thing or because the
only way forward was to wipe out the partition table. In any
case, gone was my /boot, /bin, /sbin, and /lib. I did have
a backup of /etc.

I thought about installing Knoppix on my /dev/hda2, but
it was too small.

To repair my system, I did the following (rough notes):

1) Repair all the other partitions. On my system, the
  following directories get their own partitions:
  /var, /usr, /usr/local, /home, /tmp.

2) Boot up in Knoppix.

3) Mount partition for "/" and others named in (1)
  "on top" of that.=20

4) Create missing directories: /bin, /boot, /dev /etc,
  /lib, /proc, /sbin/

5) Copy from Knoppix files in these (knoppix) directories
  to the corresponding locations on the hard drive:
  /bin, /sbin/, /dev, /boot, /lib.

6) I then copied my backed up /etc to the target /etc.

7) Edit the new /etc/lilo.conf and adjust for the kernel
  version from Knoppix.

8) chroot <target>  (in my case, /mnt/hda2). Run lilo.
  Fix things that don't work...

9) Reboot.

Right away I installed a kernel and pcmcia modules to
ensure I had all necessary files. This included editing
/etc/lilo.conf for the new kernel.  I then removed the
knoppix kernel packages used to bootstrap the repair.

I looked at all the files in /bin and /sbin and determined
which packages they were from. Then I forced a reinstall
of those packages with "apt-get --reinstall install <packages>".
I have a bunch of extra files (not belonging to any packages
according to dpkg) in /sbin/ and /bin; I hope they won't
do any harm. I may remove them later.

When logged in as root, my PATH was not complete (missing /sbin,
/usr/sbin). This doesn't surprise me as I lost everything in /root
and didn't do anything special to restore it. I created a .profile
file to modify the PATH.

I used rsync to copy files (including devices) from CD to HD.

I may have forgotten other steps but the basic idea was
to use knoppix to get started, then clean up afterwards.=20

 Ian
--=20
Ian Jacobs ([email protected])   http://www.w3.org/People/Jacobs
Tel:                     +1 718 260-9447

--=-9tquc7zHa/vJjGFH+2/V
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

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

iD8DBQBAThWU3Vu9UJRDGtARArpgAJ4nrFWZ73aeCf5JG6scHmGpqU+nJgCgnd8o
yizfLFIANh0QAOK98Et2n5U=
=bkvp
-----END PGP SIGNATURE-----

--=-9tquc7zHa/vJjGFH+2/V--

HURL: fogo mailing list archives, maintained by Gerald Oskoboiny