summaryrefslogtreecommitdiffstats
path: root/sbin/fdisk
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2003-11-13 21:13:43 +0000
committerdes <des@FreeBSD.org>2003-11-13 21:13:43 +0000
commitc0bafc9a839056bd4969563775267b32a90a9015 (patch)
tree80169939273928654ffa1237c3e8fc9596ca70d5 /sbin/fdisk
parentbea24614ec4cd9ba6ecab5f77482d9b27f0395ef (diff)
downloadFreeBSD-src-c0bafc9a839056bd4969563775267b32a90a9015.zip
FreeBSD-src-c0bafc9a839056bd4969563775267b32a90a9015.tar.gz
Warn about partitions that would overlap with the master boot record, and
if the user agrees, move them out one track. MFC after: 7 days
Diffstat (limited to 'sbin/fdisk')
-rw-r--r--sbin/fdisk/fdisk.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sbin/fdisk/fdisk.c b/sbin/fdisk/fdisk.c
index 44290f1..2ecc4f5 100644
--- a/sbin/fdisk/fdisk.c
+++ b/sbin/fdisk/fdisk.c
@@ -1300,6 +1300,11 @@ sanitize_partition(struct dos_partition *partp)
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)
OpenPOWER on IntegriCloud