Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Jan 2002 12:30:43 -0600
From:      "Mike Meyer" <mwm-dated-1011551443.80cdfb@mired.org>
To:        Annelise Anderson <andrsn@andrsn.stanford.edu>
Cc:        Alex.Wilkinson@dsto.defence.gov.au, freebsd-questions@FreeBSD.ORG
Subject:   Re: Super Block 
Message-ID:  <15428.30035.136131.19101@guru.mired.org>
In-Reply-To: <Pine.BSF.4.10.10201142256490.53039-100000@andrsn.stanford.edu>
References:  <15427.39528.11439.547654@guru.mired.org> <Pine.BSF.4.10.10201142256490.53039-100000@andrsn.stanford.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Annelise Anderson <andrsn@andrsn.stanford.edu> types:
> On Mon, 14 Jan 2002, Mike Meyer wrote:
> > One-sentence summary of why it's important: It where you start when
> > you want to find a file in the file system.
> Suppose you overwrite a disklabel and haven't made a copy; if you
> can access the slice and you want to write a new disklabel, is
> there any way to find out where the superblocks are?

Since you don't know the exact sizes, the only way I can think of is
to open the raw disk device, read in struct fs sized chunks at block
intervals, and check fs_magic for "real" superblocks. When you find a
pair that's 32 blocks apart, you've found the superblock and the first
alternate for a file system.

	<mike
--
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15428.30035.136131.19101>