From owner-freebsd-questions Tue Jan 15 10:30:47 2002 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-65-31-201-166.mmcable.com [65.31.201.166]) by hub.freebsd.org (Postfix) with SMTP id 3F29B37B404 for ; Tue, 15 Jan 2002 10:30:44 -0800 (PST) Received: (qmail 15233 invoked by uid 100); 15 Jan 2002 18:30:43 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15428.30035.136131.19101@guru.mired.org> Date: Tue, 15 Jan 2002 12:30:43 -0600 To: Annelise Anderson Cc: Alex.Wilkinson@dsto.defence.gov.au, freebsd-questions@FreeBSD.ORG Subject: Re: Super Block In-Reply-To: References: <15427.39528.11439.547654@guru.mired.org> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ From: "Mike Meyer" X-Delivery-Agent: TMDA/0.44 (Python 2.2; freebsd-4.4-STABLE-i386) Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Annelise Anderson 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. 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