From owner-freebsd-current@FreeBSD.ORG Tue Nov 11 00:43:27 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 1B21B16A4CE for ; Tue, 11 Nov 2003 00:43:27 -0800 (PST) Received: from mail.broadpark.no (mail.broadpark.no [217.13.4.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 22EDB43FB1 for ; Tue, 11 Nov 2003 00:43:26 -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 4680979036 for ; Tue, 11 Nov 2003 09:43:25 +0100 (MET) Received: by smtp.des.no (Pony Express, from userid 666) id 15B8C9BE8C; Tue, 11 Nov 2003 09:43:25 +0100 (CET) Received: from dwp.des.no (dwp.des.no [10.0.0.4]) by smtp.des.no (Pony Express) with ESMTP id 0F7C29BE1C for ; Tue, 11 Nov 2003 09:43:21 +0100 (CET) Received: by dwp.des.no (Postfix, from userid 2602) id 093D0B825; Tue, 11 Nov 2003 09:43:21 +0100 (CET) To: current@freebsd.org References: From: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Tue, 11 Nov 2003 09:43:20 +0100 In-Reply-To: (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav's?= message of "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: multipart/mixed; boundary="=-=-=" 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: Re: 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:43:27 -0000 --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable des@des.no (Dag-Erling Sm=F8rgrav) writes: > 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. ...and here's the patch. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=fdisk.diff Index: fdisk.c =================================================================== RCS file: /home/ncvs/src/sbin/fdisk/fdisk.c,v retrieving revision 1.71 diff -u -r1.71 fdisk.c --- fdisk.c 3 May 2003 18:41:56 -0000 1.71 +++ fdisk.c 11 Nov 2003 08:38:09 -0000 @@ -1300,6 +1300,11 @@ if (start % dos_sectors == 0 && (start + size) % dos_sectors == 0) return (1); + if (start == 0) { + warnx("WARNING: partition overlaps with partition table"); + if (ok("Correct this automatically?")) + start = dos_sectors; + } if (start % dos_sectors != 0) warnx("WARNING: partition does not start on a head boundary"); if ((start +size) % dos_sectors != 0) --=-=-=--