Subject: Recovering files from damaged directory?
To: , <netbsd-i386@netbsd.org>
From: Mike Cheponis <mac@Wireless.Com>
List: netbsd-help
Date: 06/28/2001 16:56:40
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

And, for that "ls", on a different terminal, the tail -f /var/log/messages is:


Jun 28 16:47:14 S /netbsd: wd0e: uncorrectable data error reading fsbn 36063056 of 36063056-36063071 (wd0 bn 39432800; cn 39119 tn 13 sn 29), retrying
Jun 28 16:47:43 S /netbsd: wd0e: uncorrectable data error reading fsbn 36063056 of 36063056-36063071 (wd0 bn 39432800; cn 39119 tn 13 sn 29), retrying
Jun 28 16:47:43 S /netbsd: wd0e: uncorrectable data error reading fsbn 36063056 of 36063056-36063071 (wd0 bn 39432800; cn 39119 tn 13 sn 29), retrying
Jun 28 16:47:43 S /netbsd: wd0e: uncorrectable data error reading fsbn 36063056 of 36063056-36063071 (wd0 bn 39432800; cn 39119 tn 13 sn 29), retrying
Jun 28 16:47:43 S /netbsd: wd0e: uncorrectable data error reading fsbn 36063060 of 36063056-36063071 (wd0 bn 39432804; cn 39119 tn 13 sn 33), retrying
Jun 28 16:47:43 S /netbsd: wd0e: uncorrectable data error reading fsbn 36063060 of 36063056-36063071 (wd0 bn 39432804; cn 39119 tn 13 sn 33)


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)?

Thanks!   -Mike


p.s. Below is complete fsck output, with intermixed tail -f /var/log/messages

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# fsck /dev/rwd0e
** /dev/rwd0e
** Last Mounted on /usr
** Phase 1 - Check Blocks and Sizes


Jun 28 16:17:38 S /netbsd: wd0e: uncorrectable data error reading fsbn 35772621 (wd0 bn 39142365; cn 38831 tn 11 sn 24), retrying
Jun 28 16:18:07 S last message repeated 4 times
Jun 28 16:18:07 S /netbsd: wd0e: uncorrectable data error reading fsbn 35772621 (wd0 bn 39142365; cn 38831 tn 11 sn 24)
Jun 28 16:20:00 S /netbsd: wd0e: uncorrectable data error reading fsbn 35772608 of 35772608-35772719 (wd0 bn 39142352; cn 38831 tn 11 sn 11), retrying
Jun 28 16:20:29 S /netbsd: wd0e: uncorrectable data error reading fsbn 35772608 of 35772608-35772719 (wd0 bn 39142352; cn 38831 tn 11 sn 11), retrying
Jun 28 16:20:29 S /netbsd: wd0e: uncorrectable data error reading fsbn 35772608 of 35772608-35772719 (wd0 bn 39142352; cn 38831 tn 11 sn 11), retrying
Jun 28 16:20:29 S /netbsd: wd0e: uncorrectable data error reading fsbn 35772608 of 35772608-35772719 (wd0 bn 39142352; cn 38831 tn 11 sn 11), retrying
Jun 28 16:20:29 S /netbsd: wd0e: uncorrectable data error reading fsbn 35772621 of 35772608-35772719 (wd0 bn 39142365; cn 38831 tn 11 sn 24), retrying
Jun 28 16:20:29 S /netbsd: wd0e: uncorrectable data error reading fsbn 35772621 of 35772608-35772719 (wd0 bn 39142365; cn 38831 tn 11 sn 24)

CANNOT READ: BLK 35772608
CONTINUE? [yn] y


Jun 28 16:22:04 S /netbsd: wd0e: uncorrectable data error reading fsbn 35772621 (wd0 bn 39142365; cn 38831 tn 11 sn 24), retrying
Jun 28 16:23:06 S /netbsd: wd0e: uncorrectable data error reading fsbn 35772621 (wd0 bn 39142365; cn 38831 tn 11 sn 24), retrying
Jun 28 16:23:06 S last message repeated 3 times
Jun 28 16:23:06 S /netbsd: wd0e: uncorrectable data error reading fsbn 35772621 (wd0 bn 39142365; cn 38831 tn 11 sn 24)
Jun 28 16:23:06 S /netbsd: wd0e: uncorrectable data error reading fsbn 35772622 (wd0 bn 39142366; cn 38831 tn 11 sn 25), retrying
Jun 28 16:23:06 S last message repeated 4 times
Jun 28 16:23:06 S /netbsd: wd0e: uncorrectable data error reading fsbn 35772622 (wd0 bn 39142366; cn 38831 tn 11 sn 25)
Jun 28 16:23:13 S /netbsd: wd0e: uncorrectable data error reading fsbn 36063056 of 36063040-36063151 (wd0 bn 39432800; cn 39119 tn 13 sn 29), retrying
Jun 28 16:23:41 S /netbsd: wd0e: uncorrectable data error reading fsbn 36063056 of 36063040-36063151 (wd0 bn 39432800; cn 39119 tn 13 sn 29), retrying
Jun 28 16:23:41 S /netbsd: wd0e: uncorrectable data error reading fsbn 36063056 of 36063040-36063151 (wd0 bn 39432800; cn 39119 tn 13 sn 29), retrying
Jun 28 16:23:41 S /netbsd: wd0e: uncorrectable data error reading fsbn 36063056 of 36063040-36063151 (wd0 bn 39432800; cn 39119 tn 13 sn 29), retrying
Jun 28 16:23:41 S /netbsd: wd0e: uncorrectable data error reading fsbn 36063060 of 36063040-36063151 (wd0 bn 39432804; cn 39119 tn 13 sn 33), retrying
Jun 28 16:23:41 S /netbsd: wd0e: uncorrectable data error reading fsbn 36063060 of 36063040-36063151 (wd0 bn 39432804; cn 39119 tn 13 sn 33)


THE FOLLOWING DISK SECTORS COULD NOT BE READ: 35772621, 35772622,

CANNOT READ: BLK 36063040
CONTINUE? [yn] y


Jun 28 16:24:39 S /netbsd: wd0e: uncorrectable data error reading fsbn 36063060 (wd0 bn 39432804; cn 39119 tn 13 sn 33), retrying
Jun 28 16:25:07 S last message repeated 4 times
Jun 28 16:25:07 S /netbsd: wd0e: uncorrectable data error reading fsbn 36063060 (wd0 bn 39432804; cn 39119 tn 13 sn 33)

THE FOLLOWING DISK SECTORS COULD NOT BE READ: 36063060,
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
FREE BLK COUNT(S) WRONG IN SUPERBLK
SALVAGE? [yn] y


242994 files, 16235101 used, 11170500 free (53860 frags, 1389580 blocks, 0.2% fragmentation)

MARK FILE SYSTEM CLEAN? [yn] y


***** FILE SYSTEM MARKED CLEAN *****

***** FILE SYSTEM WAS MODIFIED *****