Date: Sun, 12 Aug 2001 13:29:18 -0400 From: "Igor Shmukler" <shmukler@mail.ru> To: "Ian Dowse" <iedowse@maths.tcd.ie> Cc: <freebsd-fs@freebsd.org> Subject: Re: another FFS question Message-ID: <001401c12354$528bc040$7b02a8c0@tp600e> References: <200108121757.aa23922@salmon.maths.tcd.ie>
next in thread | previous in thread | raw e-mail | index | archive | help
> >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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?001401c12354$528bc040$7b02a8c0>
