From owner-freebsd-current@FreeBSD.ORG Tue Nov 11 00:36:52 2003 Return-Path: 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 DC29116A4D2 for ; Tue, 11 Nov 2003 00:36:52 -0800 (PST) Received: from mail.broadpark.no (mail.broadpark.no [217.13.4.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 169E24401F for ; Tue, 11 Nov 2003 00:36:20 -0800 (PST) (envelope-from des@des.no) Received: from smtp.des.no (37.80-203-228.nextgentel.com [80.203.228.37]) by mail.broadpark.no (Postfix) with ESMTP id 5369E78FC9 for ; Tue, 11 Nov 2003 09:36:19 +0100 (MET) Received: by smtp.des.no (Pony Express, from userid 666) id 145D19BE8C; Tue, 11 Nov 2003 09:36:19 +0100 (CET) Received: from dwp.des.no (dwp.des.no [10.0.0.4]) by smtp.des.no (Pony Express) with ESMTP id B67609BE1C for ; Tue, 11 Nov 2003 09:36:14 +0100 (CET) Received: by dwp.des.no (Postfix, from userid 2602) id 755F2B825; Tue, 11 Nov 2003 09:36:14 +0100 (CET) To: current@freebsd.org From: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Tue, 11 Nov 2003 09:36:14 +0100 Message-ID: User-Agent: Gnus/5.090024 (Oort Gnus v0.24) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on dsa.des.no X-Spam-Level: X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no version=2.60 Subject: boot0 and fdisk / disklabel misbehaviour X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Tue, 11 Nov 2003 08:36:53 -0000 I've been busy installing various OSes on a spare disk in order to try to reproduce some of fefe's benchmarks. In the process, I've noticed a couple of bogons in boot0 and disklabel: - disklabel -B trashes the partition table: # dd if=3D/dev/zero of=3D/dev/ad0 count=3D20 # fdisk -i ad0 (create a FreeBSD partition) # disklabel -rw ad0s1 auto # newfs -U /dev/ad0s1a # disklabel -B ad0s1a (this trashes the partition table) This probably happens because fdisk silently allows the user to create a partition that overlaps the partition table. Arguably pilot error, but very confusing at the time, and fdisk should warn about it. - boot0 off-by-one error: The OS table in boot0.s is as follows: .byte os_misc-. # Unknown .byte os_dos-. # DOS .byte os_dos-. # DOS .byte os_dos-. # DOS .byte os_dos-. # Windows .byte os_dos-. # Windows .byte os_dos-. # Windows .byte os_linux-. # Linux .byte os_bsd-. # BSD/OS .byte os_freebsd-. # FreeBSD .byte os_bsd-. # OpenBSD .byte os_bsd-. # NetBSD Now, boot0 identifies my FreeBSD partitions as "BSD" instead of "FreeBSD". It also identifies my Debian partition (type 0x83) as "BSD" instead of "Linux" and my Debian swap partition (type 0x82) as "DOS" instead of "Unknown", and NetBSD gives it the hives. It seems to me that it's consistently off by one. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no