Subject: Messed up my disk even further; more help needed
To: None <netbsd-help@NetBSD.ORG>
From: Robert Kennedy <robert@Theory.Stanford.EDU>
List: netbsd-help
Date: 05/13/1998 14:04:43
Re-sending the following text, sanitized, because it never showed up
on the list -- makes me think some sort of censorship continues on the
NetBSD lists...

I am at odds with myself over whether now is the best time to write
and send this message. On one hand, my memory of exactly what happened
is the clearest it will ever be, and that's probably worth some
improvement of my chances of getting my stuff back. On the other hand,
I am mad as hell at myself and will likely express myself somewhat
obnoxiously and perhaps even offensively.

In accordance with the helpful instructions given me by a collection
of generous netbsd-help readers, I booted from an old floppy I had
lying around (but unfortunately not the long-since recycled one that
contained the original disklabel for my hard disk). Then I built a
disklabel for my hard disk that included the correct geometry, but
with the 'a' partition artificially huge just so I could get started
looking at the contents of the drive.

After labeling the disk with that label, I was able to mount the 'a'
partition readonly and look at it. It looked like things were going
well. I unmounted the partition.

Someone had suggested taking a look at things with fsdb, so I stupidly
fired up fsdb on the disk. I had no idea that if I didn't do anything
and just looked around, fsdb would screw up my disk, but apparently
that's what it did. I typed "help" and then "quit". My fsdb command
was
./fsdb -d -f /dev/sd0a

When I typed "quit", I got the first indication of trouble: a message
saying fsdb had marked my 'a' partition's filesystem dirty. As a
result, when I next tried to mount the partition, I was told the
filesystem was dirty and I needed to run fsck. At this point,
apparently the filesystem was mounted, but nothing in the error
message from "mount" indicated that it had gone ahead and mounted the
partition!

Next I made my biggest mistake. I ran fsck on the partition. I don't
know if it matters that the partition was (apparently, in retrospect)
mounted when I ran fsck or not, but the stupidest thing was that I
didn't supply the "-n" switch to fsck, and I actually answered "y" to
a couple of questions before it became clear that things weren't
looking rosy. All I wanted was for fsck to mark my filesystem clean
and let me go on searching for my partition boundaries. Once I
realized that fsck seemed to have no clue that there was a valid
filesystem there, I interrupted fsck.

Instead of marking my superblock clean and so forth, fsck appears to
have completely emptied the root directory on that filesystem. As a
result, of course, I can no longer get at anything on that filesystem.

What should I do? I only answered "y" to maybe two, probably three,
and at most four of fsck's questions before I interrupted
fsck. Consequently, I presume that not much damage was done, and an
appropriately experienced fsdb wizard would probably be able to hack
whatever the required bits would be to return my root directory and
other stuff to existence.

I don't have much money, but I am willing to shell out some consulting
funds to get this fixed if that's what I have to do.

Can anyone help me? Should I just give up and start from scratch? It
would be a major pain in the ass and very sad to lose all the state
including mail, configuration, etc. that lived on that drive. The
irony is that the origin of this disaster was in my installing a new
drive to back up my stuff so this wouldn't happen.

	-- Robert