From owner-freebsd-questions@FreeBSD.ORG Thu Mar 20 16:42:33 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E1FE1065673 for ; Thu, 20 Mar 2008 16:42:33 +0000 (UTC) (envelope-from ap@d-dt.de) Received: from webmail.hansenet.de (mx01.hansenet.de [213.191.73.25]) by mx1.freebsd.org (Postfix) with ESMTP id 0BA0E8FC2B for ; Thu, 20 Mar 2008 16:42:32 +0000 (UTC) (envelope-from ap@d-dt.de) Received: from ham.dnsalias.net (85.176.175.40) by webmail.hansenet.de (7.3.118.12) (authenticated as mbx33928817@d-dt.de) id 47E24271000FBB05; Thu, 20 Mar 2008 17:22:14 +0100 Received: from [10.12.0.41] (unknown [10.12.0.41]) by brain.lan.d-dt.de (Postfix) with ESMTP id E63AE866858; Thu, 20 Mar 2008 17:22:00 +0100 (CET) Message-ID: <47E284D8.9090000@d-dt.de> Date: Thu, 20 Mar 2008 16:38:00 +0100 From: Adam Pordzik User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: Jerry McAllister References: <47DA5637.7000209@fuckner.net> <20080314155222.GF19851@gizmo.acns.msu.edu> In-Reply-To: <20080314155222.GF19851@gizmo.acns.msu.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: bsdlabel offset X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2008 16:42:33 -0000 Jerry McAllister wrote: > On Fri, Mar 14, 2008 at 11:40:55AM +0100, Tektonaut wrote: > >> Hi, >> >> following bsdllabel output caught my attention: >> >> # size offset fstype [fsize bsize bps/cpg] >> a: 2097152 0 4.2BSD 2048 16384 28552 >> b: 4194304 2097152 swap >> c: 312576642 0 unused 0 0 # "raw" part, don't >> edit >> d: 33554432 6291456 4.2BSD 2048 16384 28552 >> ... >> >> I created this disk with sade or sysinstall. What I'm not sure >> about is that partition 'a' has an offset of 0. With an 8k big >> /boot/boot I would guess offset should be 16block large. >> >> But since the disk is booting, some boot1 loader ist located at >> sector 0 (from the beginning of this slice). How is it assured, >> that the first block will never be overwritten? Where is boot1 >> located, where boot2? >> >> Comparing the first sector with boot and boot1 differs already >> at the first char. (and there were no updates so far) > > That sector 0 lies outside of the slice block 0. What you are > seeing is not an absolute disk offset, but the offset in to the slice. Right, and sector 0 of the bsd-partition (label) begins where the bsd-partition- starts. Since offset of ads1a is zero, sector 0 ad0s1a is the same as sector 0 of ad0s1. So my problem was to understand how there can be any room for boot1+2, if the filesystem start right there. My fault was to assume, that the ufs-superblock begins at first sector. (see below) > It is possible to create it otherwise but isn't done that > way by default. Nowdays, actually a whole track is held > out, instead of just sector 0 and that is where some of the > fancier MBRs such as GRUB get their extra space to work. > But, the standard FreeBSD MBR sticks to the official standard > of just one sector - which is why it is so plain vanilla. Since I have no real use for a DOS/MBR-partitiontable, I'd like to partitionate a "dangerously dedicated" layout. How would I do this in a safe way? I found the answer to my question in sys/ufs/ffs/fh.h: UFS leaves some sectors free up to the superblock. Dependening on xxxxxxxxx that can be 0k, 8k, 32k, 64k or even 256k. Adam --