Subject: Re: Recovering files from damaged directory?
To: Mike Cheponis <mac@Wireless.Com>
From: Kevin P. Neal <kpneal@pobox.com>
List: netbsd-help
Date: 06/28/2001 19:56:07
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.

Doh! It'n that how it always goes.
 
> 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/
      'Concerns about "rights" and "ownership" of domains are inappropriate.  
 It is appropriate to be concerned about "responsibilities" and "service" 
 to the community.' -- RFC 1591, page 4: March 1994