Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Jun 2006 16:02:32 +1000
From:      Greg Lane <greg.lane@internode.on.net>
To:        questions@freebsd.org
Subject:   kernel panic(?) trying to copy data off failed drive with dd
Message-ID:  <20060612060232.GA12422@router.lane.family>

next in thread | raw e-mail | index | archive | help
** Apologies for this cross-post to questions as well as stable **

G'day everyone,

I have a 250 GB SATA disk with one regular FreeBSD parition 
that is obviously in some distress. 

I can mount the partition, but any attempt to fsck it gives (I think) 
a kernel panic. I say I think because sometimes it hangs forever, 
sometimes it reboots.  One of the panic messages (at one point or 
another, sorry I can't be precise) was in "initiate_write_inodeblock_ufs2".
Errors on the console have been like "FAILURE read_dma timed out" etc. 
When it hangs, the console doesn't always give an error, it just hangs. 

I commented out the drive in fstab so I could boot and started to dd 
the entire disk to an image so that I can try and mount the image, fsck 
it and salvage what I can.  However, when I get to the bad parts of the 
disk the machine hangs.  I copied the first 160 GB or so, then it hung.  
I have since recopied the first part of the disk and am trying to get the 
last part. Recently I have been trying:

dd if=/dev/ad4s1d conv=noerror,sync bs=512 skip=333184000 of=data1-image-p2

I was hoping noerror would skip over the bad parts of the disk, but the 
machine invariably hangs. 

(1) Is there anyway to stop it hanging on bad reads of the disk and just 
    return an error, which noerror can skip over?  I am perfectly willing 
    to patch the kernel or whatever it takes to get this working. While I 
    have a backup, it is a month or so old. I can invest some time now to 
    save having to regenerate the last month's work. (Fortunately this is 
    the less active disk!  I have two other 250GB drives which would have 
    been far worse to lose. They are now backed up to the present day!)

(2) Will dump/restore help me? Will dump skip over the errors 
    any better?  Do I need an fsck'ed file system before I dump?

It seems to my uneducated eye that this is a read error that hangs the 
kernel before it ever gets passed to the user program (dd) so 
dump/restore will work no better.  But I don't really no. 

The machine is running 5.5 pre-release.  I can pull the disk and put it 
in a machine running 6-stable if that will help.  I could also install 
current on some box or another. Whatever will get the data back!! 

Advice please?!?

Cheers,
Greg




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060612060232.GA12422>