[comp.unix.xenix] Corrupted Filesystem * IDEAS *

ac1@rosemary.cs.reading.ac.uk (Andrew Cunningham) (05/02/90)

In article <RW33-1Dggpc2@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes:
>I know the horses have already got out, but what we do at FICC is to
>dd the superblock out of every file system every night, so if it *does*
>get clobbered we can just dd it back and run fsck, which generally puts
>everything back together.


You could also try fsck -b<number>. This number if the superblock location.

I've yet to see a disk drive without a second superblock at 16 (/etc/fsck -b16)
though yours may be different.  Look in /etc/sbtab for a list if it's
not your root partition that's gone with the wind......



AndyC


Andrew Cunningham			 	JANET:ac1@uk.ac.reading.cs.csug
SNAIL: Dept. of Computer Science, Whiteknights, READING RG6 2AX
FROM UselessCapitals IMPORT Disclaimer;
"Sodomy non sapiens" (Buggered if I know)  -Terry Pratchett "Mort"

guy@auspex.auspex.com (Guy Harris) (05/04/90)

>I've yet to see a disk drive without a second superblock at 16 (/etc/fsck -b16)

I've seen plenty of them.

Some of them were running the BSD file system; they had it at 32, not 16.

Others were running the V7 file system as used by S5; they didn't *have*
a second superblock, period.

Does SCO Xenix's file system (which I'd have assumed was basically the
V7 file system as used by S5) store alternate superblocks somewhere?

torsten@pcsbst.pcs.com) (Administrator for this machine) (05/05/90)

In article <1990Apr29.133610.11755@NCoast.ORG> rhg@ncoast.ORG (Rich Garrett) writes:
>
>
>PROBLEM: I've lost a filesystem, one that has very important files on it.
>         As I posted to comp.unix.xenix, this was caused during a system
>         freeze while I was running Paradox under vpix.  A reboot followed
>         and I have to-date been unable to recover this filesystem.  The
>         paradox files were on the device /dev/de052 (/mnt2) and not on
>         or part of the DOS partition.
[..] Stuff deleted


	I've also sent this answer to Rich by mail but i think this is
	of general interest, so i post it here.

	I don't know vpix, but i think there are ways to do it :

	--You have a plain SYS_V filesystem, do the following :

	# :> file       # create an empty file
	# mkfs file YOUR_FILESYSTEM_CONFIGURATION     # do an mkfs which matches
						      # your damaged filesystem
		  # Be sure that you match it exactly !!!!!!!!!!!!!!!!!!!!!!!!!!
	          # Now use dd to copy the newly created superblock
		  # to your damaged filesystem. You should only copy
		  # the second block !!!!!

	# dd if=file of=/dev/device bs=512 skip=1 seek=1 count=1


	Now fsck will do the rest for you, because it now has all information
	it will need.


	--You have a BSD fast filesystem :

	Use fsck -b BLOCK to specify an alternate superblock to be used.
	On our Workhorses block 32 is always a copy of it.
	For your system lookup the fine manual ;-).

		Good luck, Torsten.
---
Name    : Torsten Homeyer
Company : PCS GmbH, Pfaelzer-Wald-Str. 36, 8000 Munich W-Germany.
UUCP    : ..[pyramid ;uunet!unido]!pcsbst!tho  (PYRAMID PREFERRED!!)
DOMAIN  : tho@pcsbst.pcs.[ COM From rest of world; DE From Europe ]
Name    : Torsten Homeyer
Company : PCS GmbH, Pfaelzer-Wald-Str. 36, 8000 Munich W-Germany.
UUCP    : ..[pyramid ;uunet!unido]!pcsbst!tho  (PYRAMID PREFERRED!!)
DOMAIN  : tho@pcsbst.pcs.[ COM From rest of world; DE From Europe ]

rick@crash.cts.com (Rick Stout) (05/05/90)

In article <3295@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes:
>>I've yet to see a disk drive without a second superblock at 16 (/etc/fsck -b16)
>
>I've seen plenty of them.
>
>Some of them were running the BSD file system; they had it at 32, not 16.
>

Whats the purpose of a second superblock?
If the first one is corrupted can you boot off the second?

-Rick

jca@pnet01.cts.com (John C. Archambeau) (05/06/90)

rick@crash.cts.com (Rick Stout) writes:
>In article <3295@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes:
>>>I've yet to see a disk drive without a second superblock at 16 (/etc/fsck -b16)
>>
>>I've seen plenty of them.
>>
>>Some of them were running the BSD file system; they had it at 32, not 16.
>>
>
>Whats the purpose of a second superblock?
>If the first one is corrupted can you boot off the second?
>
>-Rick


Or if a bad spot manifests itself at the first superblock.
 
     // JCA

 /*
 **--------------------------------------------------------------------------*
 ** Flames  : /dev/null                     | Xenix is the ONLY thing
 ** ARPANET : crash!pnet01!jca@nosc.mil     | Microsoft did right.
 ** INTERNET: jca@pnet01.cts.com
 ** UUCP    : {nosc ucsd hplabs!hd-sdd}!crash!pnet01!jca
 **--------------------------------------------------------------------------*
 */

rick@crash.cts.com (Rick Stout) (05/06/90)

In article <2527@crash.cts.com> jca@pnet01.cts.com (John C. Archambeau) writes:
>rick@crash.cts.com (Rick Stout) writes:
>>In article <3295@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes:
>>>>I've yet to see a disk drive without a second superblock at 16 (/etc/fsck -b16)
>>>
>>>I've seen plenty of them.
>>>
>>>Some of them were running the BSD file system; they had it at 32, not 16.
>>
>>Whats the purpose of a second superblock?
>>If the first one is corrupted can you boot off the second?
>>
>>-Rick
>
>
>Or if a bad spot manifests itself at the first superblock.
> 
>     // JCA
So how do you boot off the second superblock?

Do you have to boot off a boot and root floppy, mount the
hard disk and recover the superblock somehow?

-Rick

jca@pnet01.cts.com (John C. Archambeau) (05/07/90)

rick@crash.cts.com (Rick Stout) writes:
>In article <2527@crash.cts.com> jca@pnet01.cts.com (John C. Archambeau) writes:
>>rick@crash.cts.com (Rick Stout) writes:
>>>In article <3295@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes:
>>>>>I've yet to see a disk drive without a second superblock at 16 (/etc/fsck -b16)
>>>>
>>>>I've seen plenty of them.
>>>>
>>>>Some of them were running the BSD file system; they had it at 32, not 16.
>>>
>>>Whats the purpose of a second superblock?
>>>If the first one is corrupted can you boot off the second?
>>
>>Or if a bad spot manifests itself at the first superblock.
>> 
>So how do you boot off the second superblock?
>
>Do you have to boot off a boot and root floppy, mount the
>hard disk and recover the superblock somehow?

Depends on how bad the superblock is damaged.  If you get a disk write error
during a sync, then the primary superblock has manifested a bad spot, but if
your file system supports backup superblocks, then the writes to the
subsequent superblocks will be ok, just that the write to the first superblock
didn't take so you're going to have to start reading from the backup
superblocks.

If your root file system has the the bad superblock and reading the backup
superblock(s) just doesn't help.  I am sorry to say that your root file system
is gone.  But if you are smart in laying on your file systems, the only thing
you should have in your root file system should be those things that you can
reload off of your distribution master tape or disk.  You could try dinking
with a file system debugger, but that can be messy business and sometimes can
make matters worse.  Someone suggested doing a dd of your superblock every
night.  Now that actually is a good idea because if your superblock is blown
away, you are going to have some serious problems.

You can try booting from floppy in single user mode and do an fsck and set the
option to read the backup superblock(s) instead of the primary.  If that
works, you're in business.  Backup your file system with the bad superblock
and do a surface analysis of the file system immediately.  If you have a bad
spot, better let Xenix know about it.

Unfortunately, I'm not well versed in Xenix file system specifics.  I'm
relaying my knowledge of the BSD 4.2 file system since I support Sun
workstations.  I am getting more well versed with SCO Xenix, but it has been
a problem setting aside time just to pick up Xenix specifics since it's not
really System V or BSD 4.2, it's to some degree in the middle from my (little)
understanding.

I just started with Xenix about a month ago and I'm still trying to get the
can and can nots down.
 
     // JCA

 /*
 **--------------------------------------------------------------------------*
 ** Flames  : /dev/null                     | Xenix is the ONLY thing
 ** ARPANET : crash!pnet01!jca@nosc.mil     | Microsoft did right.
 ** INTERNET: jca@pnet01.cts.com
 ** UUCP    : {nosc ucsd hplabs!hd-sdd}!crash!pnet01!jca
 **--------------------------------------------------------------------------*
 */

peter@ontmoh.UUCP (Peter Renzland) (05/08/90)

John C. Archambeau writes:
[...]
> If your root file system has the the bad superblock and reading the backup
> superblock(s) just doesn't help.  I am sorry to say that your root file system
> is gone.  
[...]

Fortunately for those with the small misfortune of having lost a superblock,
and for those who earn a living doing data rescue, things aren't quite as bad
as all that.  Superblocks contain very little that's necessary, and nothing
that can't be reconstructed from an otherwise intact file system.  Don't give
up hope, and don't believe all the gloomy things you read on the net.

-- 
Peter Renzland @ Ontario Ministry of Health  416/964-9141  peter@ontmoh.UUCP
		 Director, UniForum Canada,  Co-ordinator, GOMIG BBS

jca@pnet01.cts.com (John C. Archambeau) (05/09/90)

peter@ontmoh.UUCP (Peter Renzland) writes:
>John C. Archambeau writes:
>[...]
>> If your root file system has the the bad superblock and reading the backup
>> superblock(s) just doesn't help.  I am sorry to say that your root file system
>> is gone.  
>[...]
>
>Fortunately for those with the small misfortune of having lost a superblock,
>and for those who earn a living doing data rescue, things aren't quite as bad
>as all that.  Superblocks contain very little that's necessary, and nothing
>that can't be reconstructed from an otherwise intact file system.  Don't give
>up hope, and don't believe all the gloomy things you read on the net.

Problem is, if I'm not mistaken, you have to have a good superblock for fsck
to do its job in an acceptable manner.  Are there any publications on the
exact details on step by step recovery of a Unix file system that fsck can't
salvage with any level of success?
 
     // JCA

 /*
 **--------------------------------------------------------------------------*
 ** Flames  : /dev/null                     | Xenix is the ONLY thing
 ** ARPANET : crash!pnet01!jca@nosc.mil     | Microsoft did right.
 ** INTERNET: jca@pnet01.cts.com
 ** UUCP    : {nosc ucsd hplabs!hd-sdd}!crash!pnet01!jca
 **--------------------------------------------------------------------------*
 */