From owner-freebsd-hackers Mon Feb 17 13:24:36 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id NAA16124 for hackers-outgoing; Mon, 17 Feb 1997 13:24:36 -0800 (PST) Received: from mole.mole.org (marmot.mole.org [204.216.57.191]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id NAA16118 for ; Mon, 17 Feb 1997 13:24:25 -0800 (PST) Received: (from mail@localhost) by mole.mole.org (8.6.12/8.6.12) id VAA08726; Mon, 17 Feb 1997 21:24:16 GMT Received: from meerkat.mole.org(206.197.192.110) by mole.mole.org via smap (V1.3) id sma008724; Mon Feb 17 21:23:58 1997 Received: (from mrm@localhost) by meerkat.mole.org (8.6.11/8.6.9) id NAA26953; Mon, 17 Feb 1997 13:23:14 -0800 Date: Mon, 17 Feb 1997 13:23:14 -0800 From: "M.R.Murphy" Message-Id: <199702172123.NAA26953@meerkat.mole.org> To: avalon@coombs.anu.edu.au, kuku@gilberto.physik.rwth-aachen.de Subject: Re: File system/disk recovery tools ? Cc: hackers@freebsd.org, luigi@labinfo.iet.unipi.it, msmith@atrad.adelaide.edu.au Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > > > > > > > actually an annoying thing with fsck -b is that I never know what > > > > to use as an alternate superblock number. 32, says the manpage, is > > > > an alternate superblock, but what are others ? I guess they depend > > > > upon the geometry of the disk... is there a "magic" number that I > > > > can look for ? > > > > > > You mean you didn't write them down when you made your filesystems? 8) Ah, yes, I write them down each time :-) Never :-) > > > > > > Ok, presumably your disklabel is OK. Have a look in /sys/ufs/ffs/fs.h > > > at the superblock layout; it's 8K long, has a fixed checksum, and > > > contains various predictable fields (eg. the last mountpoint). This > > > should let you hunt a copy of it down. # disklabel -r wd0 or # disklabel -r sd0 or whatever , depending upon the drive in use, then # newfs -N wd0a or # newfs -N sd0s1f or whatever, depending upon the disk and partition. Notice the "-N" switch :-) Like this: otchig# disklabel -r wd0 # /dev/rwd0c: type: ESDI disk: wd0s1 label: flags: bytes/sector: 512 sectors/track: 63 tracks/cylinder: 16 sectors/cylinder: 1008 cylinders: 2100 sectors/unit: 2116800 rpm: 3600 interleave: 1 trackskew: 0 cylinderskew: 0 headswitch: 0 # milliseconds track-to-track seek: 0 # milliseconds drivedata: 0 8 partitions: # size offset fstype [fsize bsize bps/cpg] a: 49152 0 4.2BSD 0 0 0 # (Cyl. 0 - 48*) b: 262144 49152 swap # (Cyl. 48*- 308*) c: 2116800 0 unused 0 0 # (Cyl. 0 - 2099) e: 131072 311296 4.2BSD 0 0 0 # (Cyl. 308*- 438*) f: 196608 442368 4.2BSD 0 0 0 # (Cyl. 438*- 633*) g: 1477824 638976 4.2BSD 0 0 0 # (Cyl. 633*- 2099*) otchig# newfs -N wd0g Warning: 832 sector(s) in last cylinder unallocated /dev/rwd0g: 1477824 sectors in 361 cylinders of 1 tracks, 4096 sectors 721.6MB in 23 cyl groups (16 c/g, 32.00MB/g, 7680 i/g) super-block backups (for fsck -b #) at: 32, 65568, 131104, 196640, 262176, 327712, 393248, 458784, 524320, 589856, 655392, 720928, 786464, 852000, 917536, 983072, 1048608, 1114144, 1179680, 1245216, 1310752, 1376288, 1441824, otchig# Someday I'll remember to write down a few of the alternate superblocks. Yeah, in my dreams... :-) -- Mike Murphy mrm@Mole.ORG +1 619 598 5874 Better is the enemy of Good