LinuxSA Mailing list archives

Index: [thread] [date] [subject] [author] [stats]
  From: Glen Turner <glen.turner@aarnet.edu.au>
  To  : Linux SA <linuxsa@linuxsa.org.au>
  Date: Thu, 17 Jul 2003 11:40:47 +0930

Re: Argh! Hard Drive Dying?

Ant wrote:
> Try using the "noerror" switch (and maybe sync) with dd.Im not sure if
> it would pad the errors or not to keep the rest of the filesystem
> aligned.

This is almost becoming a FAQ.

Hand-waving procedure is:

  - go and buy a new drive (you're going to have to do
    that anyway).  Perhaps after al this hassle you'll
    buy two and do software partition mirroring.

  - Shove a new drive onto a bus somewhere, pref not
    the same bus as the failing drive.

  - for each non-swap partition that you care about
    (hda1 in our exmaple):

      dd if=/dev/hda1 of=/mnt/newdrive/hda1.img noerror

  - loopback mount the copied partition, check it,
    mount it, and copy the files you care for.

      losetup /dev/loop0 /mnt/newdrive/hda1.img
      fsck -t ext2 -p -y /dev/loop0
      mkdir /mnt/rescue
      mount -t ext2 /dev/loop0 /mnt/rescue

  - copy/tar/whaterver the files you care for.

      cp  /mnt/rescue/home/gdt/precious.txt /mnt/newdrive/precious.txt

  - Salt away your saved files somewhere (unused partition,
    CD, etc)

  - Remove the failing drive

  - Insert the new drive, reinstall.

Some of the rescued files will be corrupted.  You can't expect
miracles.

I'm sure there are syntax, missing steps, etc in the above,
but you get the general drift -- get the drive image onto a
good media, aggresively fsck it, copy off the results, hope
for the best.

-- 
LinuxSA WWW: http://www.linuxsa.org.au/ IRC: #linuxsa on irc.freenode.net
To unsubscribe from the LinuxSA list:
  mail linuxsa-request@linuxsa.org.au with "unsubscribe" as the subject


Index: [thread] [date] [subject] [author] [stats]
Return to the LinuxSA Mailing List Information Page