[comp.unix.wizards] any tool to *find* a filesystem on an ULTRIX disk with trashed partition table?

rtc@westford.ccur.com (Robert Chesler) (05/07/91)

I trashed the root partition on an ULTRIX system disk.  It had a non-standard
partition table since it was a non-DEC disk.  There are two partitions out
on the disk that I'd sure like to find.  Anyone have any tricks or tools to
help do this?

--Robert

==========================================================================
Robert Chesler		rtc@westford.ccur.com		decvax!chesler!rob

mouse@thunder.mcrcim.mcgill.edu (der Mouse) (05/13/91)

In article <62039@masscomp.westford.ccur.com>, rtc@westford.ccur.com (Robert Chesler) writes:
> I trashed the root partition on an ULTRIX system disk.  It had a
> non-standard partition table since it was a non-DEC disk.  There are
> two partitions out on the disk that I'd sure like to find.  Anyone
> have any tricks or tools to help do this?

Read the disk sector by sector, looking for a block containing FS_MAGIC
in the appropriate spot.  You may get some false positives, but you
should find the partition's superblock.  To weed out the false
positives, do some of the simple checks fsck does, like make sure
fs_size, fs_dsize, fs_ncg, fs_bsize, fs_fsize, fs_frag, etc, etc are
sane (eg, positive, less than something reasonable...).  That should
get the number of false positives down to where you can start using
fsck to test for them, but if you really want to finish the job
automatically, look for many identical superblocks in sectors whose
numbers are in arithmetical progression - they'll be the backup
superblocks.

(Assuming your Ultrix uses the Berkeley FFS, of course.)

					der Mouse

			old: mcgill-vision!mouse
			new: mouse@larry.mcrcim.mcgill.edu