From owner-freebsd-fs Sun Aug 12 10:29:30 2001 Delivered-To: freebsd-fs@freebsd.org Received: from gull.mail.pas.earthlink.net (gull.mail.pas.earthlink.net [207.217.121.85]) by hub.freebsd.org (Postfix) with ESMTP id ED9C137B401 for ; Sun, 12 Aug 2001 10:29:26 -0700 (PDT) (envelope-from shmukler@mail.ru) Received: from tp600e (user-2ivec3r.dialup.mindspring.com [165.247.48.123]) by gull.mail.pas.earthlink.net (EL-8_9_3_3/8.9.3) with SMTP id KAA15652; Sun, 12 Aug 2001 10:29:21 -0700 (PDT) Message-ID: <001401c12354$528bc040$7b02a8c0@tp600e> From: "Igor Shmukler" To: "Ian Dowse" Cc: References: <200108121757.aa23922@salmon.maths.tcd.ie> Subject: Re: another FFS question Date: Sun, 12 Aug 2001 13:29:18 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org > >Since it was only intended to run once, so I didn't check whether malloc > >would fail. > > That's fine, though you should at least ktrace the program to > check that all system calls succeeded before trusting the output. Let's assume call succeded. I'm sure malloc didn't fail me. ... > >I actually dumped partition and came up with following: > >I got 2 versions of FreeBSD installed on 2 different boxes. > >On FBSD 2.2 sectors 17,18 and 19 are 0x00 filled. > >On FBSD 4.3 same sectors seem to contain the FS structure, but still no > >FS_MAGIC present. > > You must be looking in the wrong place on the disk; every ffs > filesystem does have a superblock containing FS_MAGIC, and this is > checked by the ffs mount code, by fsck and by any other filesystem > utilities. That's what I thought. > Are you sure you are taking the offset of the start of the partition > into account? For a raw disk, you need to read the DOS slice table > and determine the start of the FreeBSD slice, and then read the > disklabel in that slice to find the partitions. Normally the 'a' > partition would begin right at the start of the FreeBSD slice, > but nothing stops you from putting it elsewhere. Try looking at the > raw disk/slice/partition with hd: I'm sure I found partition ok. Otherwise, how would I find boot code in 1st 8k of the partition? > For ad0s1, the disklabel should appear at 0x200. Same here. > Finally, for ad0s1a (which on a slice beginning with the 'a' partition > starts at the same place as ad0s1), the superblock can be found at > 0x2000, with the FS_MAGIC visable at 0x255c. OK. Seems I was looking at 0x2558 Thank you. Actually this makes me think that perhaps open did fail? Otherwise why would I get fs->fs_magic - 0? My bad. Also, above data reflects state of affairs on my 4.3 box. Is there a logical explanation for 0x00 filled sectors on 2.2 box? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message