hfs_fs-0.95: hfs_hfind: corrupted b-tree 4

Michael A. Erickson hfs-interest@ccs.neu.edu
Thu, 21 Jan 1999 05:54:59 -0500

I am a new subscriber to the list, so I am blindly hoping this kind of
post is appropriate.

(There are five paragraphs of background before I get to the heart of
my question.)

I had an IDE drive in a Mac 6500/300 that went bad the other day.  It
was odd (in my limited experience with drives going bad) that I heard
some sort of noise, a click, come out of the machine just as things
went south.

It took a while to even get the Mac to run at all--I kept getting the
flashing ? disk upon booting.  Finally, with Norton Utilities and
Command-Option PR, we were able to get the machine running again, but
Norton Utilities said it couldn't fix my problem.

So, I backed everything that I could get to up to tape (rather than
having to restore from an old image and 30 or more incrementals), and
I put in a new hard drive.  I was holding out on trying to reformat
the old one until I could see what was wrong with it (i.e., what had
become unavailable).  Plus, I was hoping that I wouldn't even have to
use the tape, that I could just mount a new drive along with the old
drive in my Mac and do a disk-to-disk copy.

Unfortunately the 6500s have fairly constrained cases and connectors,
and it didn't seem likely that I could just pop in a second hard
drive.  So, I went with starting from scratch and restoring from tape.

Once I got my Mac all back together, I thought it would be fun to see
what all this hfs on Linux stuff was about, and I am really, really
impressed.  Combined with netatalk (or alone), it's just beautiful to
be able to mount something as odd (to my mind) as an HFS IDE drive.
It's incredible to be able to do something for a Mac on an x86 box
that I couldn't figure out how to do on a Mac.

Now that you have the story, here is where my questions begin.  First,
when I run du on the HFS device, I get the following errors:

du: /mac/Archive/dianthus-tars: No such file or directory
du: /mac/CodeWarrior Lite/Metrowerks CodeWarrior/MacOS Support/Libraries/Pascal/68K: No such file or directory
du: /mac/CodeWarrior Lite/Metrowerks CodeWarrior/MacOS Support/Libraries/Runtime/Runtime 68K: No such file or directory
du: /mac/Documents/Spring Rg Data/mixed up data/s007: No such file or directory
du: /mac/Documents/Spring Rg Data/s009: No such file or directory
du: /mac/Documents/Spring Rg Data/s013: No such file or directory
du: /mac/local/MCL 4.2/Examples/FF Examples: No such file or directory
du: /mac/local/MCL 4.2/Patches 4.2: No such file or directory
du: /mac/local/PsyScope.1.2.2.PPC: No such file or directory
du: /mac/Printers/HP LaserJet folder: No such file or directory
du: /mac/tmp: No such file or directory
du: /mac/Web Pages/rab-pix: No such file or directory
du: /mac/wrk: No such file or directory

and at the same time, the console says (just once):

hfs_bfind: corrupted b-tree 4.

Some (probably all, I haven't checked thoroughly) of these nonexistent
directories are also the ones that didn't get backed up in the
post-crash image.

Also, even though the Mac, and now df reports that this drive is
almost completely full:

Filesystem         1024-blocks  Used Available Capacity Mounted on
/dev/hda             3906600 3906240      360    100%   /mac

du (and the mac-to-mac backup) only find 1729980k.

So, my guess is that there is some disconnection between the directory
structure and the files on the device.

My question is: even though Norton Utilities couldn't fix it, is there
any chance I could walk through the directory structure and the
unaccounted for locations on the disk to get some of this stuff back?

BTW, I am interested in this out of curiosity more than anything
else.  I believe that backups made over time before the drive crashed
will have the missing files.  I am just interested in finding out what
the underlying problem is.

Michael A. Erickson