Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Mar 2004 09:50:36 -0800
From:      Marcus Beaman <marcus.beaman@state.or.us>
To:        Daniel Lang <langd-freebsd-hackers@leo.org>
Cc:        hackers@freebsd.org
Subject:   Re: off topic - disk crash
Message-ID:  <20040311095036.397308d5.marcus.beaman@state.or.us>
In-Reply-To: <20040311142128.GG20701@atrbg11.informatik.tu-muenchen.de>
References:  <200403101736.i2AHaqIF029948@www.kukulies.org> <20040311142128.GG20701@atrbg11.informatik.tu-muenchen.de>

next in thread | previous in thread | raw e-mail | index | archive | help
You could also use dd with the bs/count operands to skip the bad blocks,
but this will probably be much more frustrating that the conv operand. 
Another option (that is slower than dd but less stressful on the failing
drive) I've used are the dump/restore utilities.  I have the specific
commands for Solaris, but the process should work for FreeBSD with some
alterations (I can email it to you off list if you would like).  This is
the general procedure I use for the dump/restore utilities: 
	1.  Attach second ide drive to cable/controller, same size or larger
than the failing disk.  This will be your recovery disk. 
	2.  Boot from CD into single user mode (for freebsd check out
www.freesbie.org site and/or use the port). 
	3.  Format, partition, label (make sure it is bootable), and create the
new file system on the recovery disk so it is identical to the old disk.

	4.  Fsck the new and failing disks. 
	5.  Setup and verify your swap partition on the recovery disk. 
	6.  Mount the recovery disk partition. 
	7.  Dump/restore the old disk partition to the new disk partition. 
Repeat 6/7 for each partition.
	8.  Mount the failing disk partitions and compare to the recovery disk
for consistency. 
	9.  Unmount all disk partitions.
	10. Shutdown the system, remove the failing drive/CD, power it back up,
and test.

-Marcus

---------------------------------
Marcus Beaman
Data Network Operations Analyst
DAS/IRMD/ENS NOC
503-378-3627
---------------------------------

<---REPLY--->
>Date: Thu, 11 Mar 2004 15:21:28 +0100
>From: Daniel Lang <langd-freebsd-hackers@leo.org>
>To: "C. Kukulies" <kuku@www.kukulies.org>
>Cc: hackers@freebsd.org
>Subject: Re: off topic - disk crash
>> Hi,
> 
> C. Kukulies wrote on Wed, Mar 10, 2004 at 06:36:52PM +0100:
> [..]
> > The disk boots into FreeBSD but already at power on time the disk
> > does seek retries or some recalibration noise.
> > 
> > The question is what else can I do to recover the data.
> > Put it in the icebox? Turn the computer upside down?
> [..]
> 
> Put it into another box running a working FreeBSD
> and enough disk-space to contain all the contents of
> the damaged disk.
> 
> Check if you can still read the disklabel
> (just do "disklabel ad1s1 (or whatever your device is)).
> 
> If you can read the disklabel, grab the contents of
> each partition with dd, use the 'conv=noerror,sync'
> options to fill unreadable sectors with zeros.
> 
> Turn the resulting partition-image files into devices using
> vnconfig.
> 
> Now you can either:
> 
>  a) fsck the devices and then mount them to grab what is left
>     of the data. This is the more reliable way, but fsck may
> 		render some data inaccessible.
> 		If the superblock is damaged, read fsck and newfs manpages,
> 		as well as the handbook, how to get a backup-copy
> 		of your superblock.
> 
>  b) mount the device read-only and grab what is left of the data.
>     If the filesystem is badly damaged, this could panic your
> 		machine. So don't do it unless you really have to.
> 
> You can make a copy of the partition image-files, and do the
> fsck on one copy. You still have the other one if you want
> to try without fsck.
> 
> If you cannot read the disklabel, you can still use dd to 
> make an image of the whole disk. But you will have to find
> the partition-boundaries for yourself. There is a tool in the
> ports to find filesystem boundaries, IIRC. I don't recall the
> name of this tool, though.
> 
> HTH,
>  Daniel

<---END REPLY--->



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040311095036.397308d5.marcus.beaman>