*BSD News Article 16886


Return to BSD News archive

Newsgroups: comp.os.386bsd.questions
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!elroy.jpl.nasa.gov!swrinde!gatech!news.byu.edu!cwis.isu.edu!fcom.cc.utah.edu!cs.weber.edu!terry
From: terry@cs.weber.edu (A Wizard of Earth C)
Subject: Re: Help with restoring my drive
Message-ID: <1993Jun7.215922.6403@fcom.cc.utah.edu>
Sender: news@fcom.cc.utah.edu
Organization: Weber State University  (Ogden, UT)
References: <Mg4f2JW00WB54AlJYb@andrew.cmu.edu>
Date: Mon, 7 Jun 93 21:59:22 GMT
Lines: 64

In article <Mg4f2JW00WB54AlJYb@andrew.cmu.edu> "Alex R.N. Wetmore" <aw2t+@andrew.cmu.edu> writes:
>I just lost the drive that contains my /usr partition.  All of the data
>is still there, but I killed the disklabel, and possibly the bootblock. 
>Basically, I was trying to make it my primary drive (so that I could
>boot off of it), and disklabeled and used os-bs to put a boot block on
>it.  At that point os-bs would come up and never bootstrap the
>partition.  So I gave up the project and tried to revert what I did.  I
>used os-bs to restore the original boot-block, and re-disklabeled the
>disk back to its original state.  Now the drive won't fsck (it gives
>hard errors and says that the super block doesn't agree with the
>alternate super block).

All of the data my not be there, depending on how big your boot blocks were
-- basically, if they are larger than your superblock, real data was
probably destroyed.

You have two options, either of which require a rather intimate knowledge
of the disk layout of the trashed disk:

1)	fsck then mount using one of the backup superblocks.  This info
	was printed when you mkfs'ed the disk in the first place, and
	you should heve written it down for just such an emergency.

	Then do a backup, re-mkfs the disk, and restore.


2)	Using dd with the appropriate block size and count and skip, get
	a copy of one of the backup superblocks into a file, and using
	the reverse of the process, write over the (now corrupt) block
	at the front of your disk.

	You should then be able to fsck then mount normally.

	To know the offsets, you need to know the original offsets from the
	start of the partition, which were reported when you mkfs'ed the
	disk.


If you didn't write down the backup superblock locations when you mkfs'ed
the disk in the first place:

1)	Shame on you!

2)	Go to the mkfs sources, and, given the options used when the
	disk was built (or, hope beyond hope, the defaults for the disk
	partition of that size and start/end/block geometry), calculate
	by hand where the backup superblocks would have been put.  Try
	a fsck first to make sure that you've found the right location
	before copying it off.

Unless you are a real UNIX hack or have one there with you, you are
probably out of luck, since this is not the type of thing that can be
done by remote control through news postings or email.

Good luck with your recovery!


					Terry Lambert
					terry@icarus.weber.edu
					terry_lambert@novell.com
---
Any opinions in this posting are my own and not those of my present
or previous employers.