Date: Tue, 11 Nov 2003 09:43:20 +0100 From: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) To: current@freebsd.org Subject: Re: boot0 and fdisk / disklabel misbehaviour Message-ID: <xzpwua7nvmf.fsf@dwp.des.no> In-Reply-To: <xzp1xsfpaip.fsf@dwp.des.no> (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav's?= message of "Tue, 11 Nov 2003 09:36:14 %2B0100") References: <xzp1xsfpaip.fsf@dwp.des.no>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
des@des.no (Dag-Erling Smørgrav) 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
--
Dag-Erling Smørgrav - des@des.no
[-- Attachment #2 --]
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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xzpwua7nvmf.fsf>
