From owner-freebsd-current@FreeBSD.ORG Sat Mar 18 01:48:14 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C133016A41F for ; Sat, 18 Mar 2006 01:48:14 +0000 (UTC) (envelope-from dmitry@atlantis.dp.ua) Received: from postman.atlantis.dp.ua (postman.atlantis.dp.ua [193.108.47.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 01AC843D49 for ; Sat, 18 Mar 2006 01:48:13 +0000 (GMT) (envelope-from dmitry@atlantis.dp.ua) Received: from smtp.atlantis.dp.ua (smtp.atlantis.dp.ua [193.108.46.231]) by postman.atlantis.dp.ua (8.13.1/8.13.1) with ESMTP id k2I1m4Tg072835; Sat, 18 Mar 2006 03:48:04 +0200 (EET) (envelope-from dmitry@atlantis.dp.ua) Date: Sat, 18 Mar 2006 03:48:04 +0200 (EET) From: Dmitry Pryanishnikov To: Jos Backus In-Reply-To: <20060317204704.GA16269@lizzy.catnook.local> Message-ID: <20060318032023.K40573@atlantis.atlantis.dp.ua> References: <20060317012428.N52721@atlantis.atlantis.dp.ua> <863bhh3y05.fsf@xps.des.no> <20060317174743.GA13507@lizzy.catnook.local> <20060317213430.R31244@atlantis.atlantis.dp.ua> <20060317204704.GA16269@lizzy.catnook.local> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-current@freebsd.org Subject: Re: [patch] NetBSD disklabel support for geom_bsd X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Mar 2006 01:48:14 -0000 Hello! On Fri, 17 Mar 2006, Jos Backus wrote: >> My patch modifies disklabel only for NetBSD partition (type 169), >> and only in memory, not on disk. So it definitely won't affect >> moving any partition using a non-FreeBSD aware tools. > > Thanks for clarifying that. I guess I phrased this poorly. I meant to say that > if FreeBSD were to move to the NetBSD model, that would seem to be one of the > downsides as it must be for NetBSD today. When moving a NetBSD partition, the > label needs to be updated whereas with a FreeBSD partition it does not. Well, as I wrote in my previuos letter, it's my mistake that FreeBSD uses slice-relative offsets while NetBSD uses absolute offsets. Actually, both systems use absolute offsets, and offset conversion isn't required (but just accidently happens harmless). Actually, I can tell what has created my confusion. Did anyone analyze how disklabel offsets look under RELENG_4? It's very interesting: # fdisk ad4 ******* Working on device /dev/ad4 ******* parameters extracted from in-core disklabel are: cylinders=788 heads=255 sectors/track=63 (16065 blks/cyl) parameters to be used for BIOS calculations are: cylinders=788 heads=255 sectors/track=63 (16065 blks/cyl) Media sector size is 512 Warning: BIOS sector numbering starts with sector 1 Information from DOS bootblock is: The data for partition 1 is: sysid 165,(FreeBSD/NetBSD/386BSD) start 63, size 10474317 (5114 Meg), flag 0 beg: cyl 0/ head 1/ sector 1; end: cyl 651/ head 254/ sector 63 The data for partition 2 is: sysid 165,(FreeBSD/NetBSD/386BSD) start 10474380, size 2184840 (1066 Meg), flag 80 (active) beg: cyl 652/ head 0/ sector 1; end: cyl 787/ head 254/ sector 63 The data for partition 3 is: The data for partition 4 is: So 1st slice starts at usual offset 63. # dd bs=512 if=/dev/ad4s1 iseek=1 | hd | more 00000000 57 45 56 82 05 00 00 00 61 64 34 73 31 00 00 00 |WEV.....ad4s1...| 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000020 00 00 00 00 00 00 00 00 00 02 00 00 3f 00 00 00 |............?...| 00000030 ff 00 00 00 8b 02 00 00 c1 3e 00 00 4d d3 9f 00 |.........>..M...| 00000040 00 00 00 00 00 00 00 00 10 0e 01 00 00 00 00 00 |................| 00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00000080 00 00 00 00 57 45 56 82 31 f4 08 00 00 20 00 00 |....WEV.1.... ..| 00000090 00 20 00 00 00 00 08 00 00 00 00 00 00 00 00 00 |. ..............| 000000a0 07 00 00 00 00 00 10 00 00 00 08 00 00 00 00 00 |................| 000000b0 01 00 00 00 4d d3 9f 00 00 00 00 00 00 00 00 00 |....M...........| 000000c0 00 00 00 00 4d d3 87 00 00 00 18 00 00 00 00 00 |....M...........| Partition table starts at offset 0x94, and media offset (starting sector) goes at offset 4 in every entry. As you can see, offset of 'a' partition is zero (bytes 98-9b of dump). So here it IS slice-relative. But now dump this sector using base unit (ad4) entry instead of slice (ad4s1): # dd bs=512 if=/dev/ad4 iseek=64 | hd | more 00000000 57 45 56 82 05 00 00 00 61 64 34 73 31 00 00 00 |WEV.....ad4s1...| 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000020 00 00 00 00 00 00 00 00 00 02 00 00 3f 00 00 00 |............?...| 00000030 ff 00 00 00 14 03 00 00 c1 3e 00 00 c2 5d c1 00 |.........>...]..| 00000040 00 00 00 00 00 00 00 00 10 0e 01 00 00 00 00 00 |................| 00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00000080 00 00 00 00 57 45 56 82 7f 7b 08 00 00 20 00 00 |....WEV..{... ..| 00000090 00 20 00 00 00 00 08 00 3f 00 00 00 00 00 00 00 |. ......?.......| 000000a0 07 00 00 00 00 00 10 00 3f 00 08 00 00 00 00 00 |........?.......| 000000b0 01 00 00 00 4d d3 9f 00 3f 00 00 00 00 00 00 00 |....M...?.......| 000000c0 00 00 00 00 4d d3 87 00 3f 00 18 00 00 00 00 00 |....M...?.......| As you can see, now offsets are absolute. This behaviour (label auto-conversion "on the fly") has created so much confusion for me. There is no such conversion in modern (e.g., RELENG_6) FreeBSD, I just see absolute labels in both cases (and I like it). Sincerely, Dmitry -- Atlantis ISP, System Administrator e-mail: dmitry@atlantis.dp.ua nic-hdl: LYNX-RIPE