Subject: Re: Sun 3/60 SCSI TERMPWR problem
To: None <port-sun3@NetBSD.ORG>
From: Santiago de la Paz <garnett@suod.cs.colorado.edu>
List: port-sun3
Date: 05/19/1998 19:13:20
David Brownlee (abs) wrote:
> On Tue, 19 May 1998, Todd Hansen wrote:
> > caused me to lose the data and my partition table, according to the other
> > sys admins here there is no other method that they know of to recover a
> > disk with a lost label.
> 
> 	Tsk, you have unimaginative sysadmins :) - Write a program to
> 	check for two superblocks 8 sectors apart (or something similar).
> 	Can quite easily catch each valid filesystem (might be a couple
> 	of false positives, but generally not) :)

There are a number of tools to do this sort of thing these days.  OpenBSD
uses ``scan_ffs,'' which saved my behind in a big way last month, a week
before the deadlines for two major papers when my disk lost its label, and
I've heard rumors of others in the works.

Re: false positives, I have to disagree with you.  If the disk has been used 
much, there will probably be several false filesystem-boundaries discovered, 
especially in the swap partition if you've been using mfs, but it's easy to 
determine what the filesystem was just by looking at the last-mounted-on 
information in the discovered superblock, and if multiple /usr partitions
(for example) are found (which was certainly true in my case, given the 
lenght of time I'd been using the disk and had repartitioned/reinstalled it),
it's easy enough just to use the one that was mounted last.  So in a certain
sense you're right, because the false mounts are easily ignored.

At any rate, this kind of tool is invaluable.  In my example, I was able to
completely recover my system in a few hours' work, the only hard part of which
was sweating blood the entire time, which was far quicker than reinstalling the
system and rebuilding it from dump tapes.  Of course, even that wouldn't have 
been the case if I'd kept copies of my disklabel offline, which I now do.

~james

James Garnett                             Department of Computer Science 
http://www.cs.colorado.edu/~garnett       The University of Colorado at Boulder

  "human nature has not materially altered in the three thousand
           years since Homer"
                         ---E.V.Rieu (Introduction to the Iliad)