Subject: SUCCESS! Re: Recovering files from damaged directory?
To: Kevin P. Neal <kpneal@pobox.com>
From: Mike Cheponis <mac@Wireless.Com>
List: port-i386
Date: 07/03/2001 00:52:35
Thanks to Kevin, I -was- able to recover 100% of my email files.

The procedure is just as he describes.  The trick is the "fsdb" program.
I was able to determine the inode of /usr/Mac/mail and then I could clear
that inode.  (I couldn't actually "delete" it because it wasn't a regular
file.)

When I subsequently "fsck"ed that disk, the zeroed inode was deleted,
lost+found/ was created, and the email files were placed there.

So I didn't loose even one email message after all!

cp -Rp was my friend.  dd did not complete, so I had to use cp to get the
rest of the data.

Now, time to send in that disk back to IBM - it was new in February, built
in Hungary with a 3-year warrantee.

Incidentally, I had the S.M.A.R.T. BIOS option set to "off".  I have since
turned it "on".

There are apparently tools that let you read various disk drive "health"
indicators so you can replace the drive before it goes totally south.

Here are a couple of pages that describe this capability:

http://www.santools.com/smartmon.html

http://www.fileguru.com/disk/2545.html


Do we have a program like that?



Thanks all once again, -Mike


On Thu, 28 Jun 2001, Kevin P. Neal wrote:

> Date: Thu, 28 Jun 2001 19:56:07 -0400
> From: Kevin P. Neal <kpneal@pobox.com>
> To: Mike Cheponis <mac@Wireless.Com>
> Cc: netbsd-help@netbsd.org, port-i386@netbsd.org
> Subject: Re: Recovering files from damaged directory?

> On Thu, Jun 28, 2001 at 04:56:40PM -0700, Mike Cheponis wrote:
> > I am trying to recover my ~/mail directory.  This is where pine has stored
> > its email (and I had a lot of it!).
> >
> > I was able to get off this /dev/wd0e partition everything except that
> > important stuff in my /usr/Mac/mail directory.

> > When I do an "ls" I get:
> >
> > $ ls -l /usr/Mac/mail
> > ls: /usr/Mac/mail: Input/output error

> > I *think* that only the directory /usr/Mac/mail is blown away, but that
> > the files are still there.
> >
> > Is there some way to recover the files (even though the directory entry
> > itself appears to be lost)?

> Can you use fsdb to delete /usr/Mac/mail from /usr/Mac? If you do that
> and then perhaps clear the inode for /usr/Mac/mail then it seems like
> that would leave the files in /usr/Mac/mail disconnected. Then fsck
> "should" pick them up and put them in the lost+found directory.
>
> You may want to dd the drive image to someplace else first, in case
> the drive fails more or fsck wants to reattach files in a block that
> has failed.

> Kevin P. Neal                                http://www.pobox.com/~kpn/