summaryrefslogtreecommitdiff
path: root/sbin/fdisk/disk.c
diff options
context:
space:
mode:
authorKjell Wooding <kjell@cvs.openbsd.org>2000-04-18 22:40:16 +0000
committerKjell Wooding <kjell@cvs.openbsd.org>2000-04-18 22:40:16 +0000
commit22e40391ab28576c053e63b2d852fa85d8cd90bc (patch)
tree49d9a6978db7fa7b94cd778cda17b901325e5fc4 /sbin/fdisk/disk.c
parent333ec701ac3e7a013ec330538d23d0b2e6ce86e7 (diff)
Favor BIOS geometry over physical. This should fix MANY problems with
hard drives >8G sharing partitions with other operating systems. Also, support extended partition type 0x0F, which is quite common now.
Diffstat (limited to 'sbin/fdisk/disk.c')
-rw-r--r--sbin/fdisk/disk.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/sbin/fdisk/disk.c b/sbin/fdisk/disk.c
index 9dccf8fdd32..08da0227d6f 100644
--- a/sbin/fdisk/disk.c
+++ b/sbin/fdisk/disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disk.c,v 1.10 2000/01/08 04:51:16 deraadt Exp $ */
+/* $OpenBSD: disk.c,v 1.11 2000/04/18 22:40:15 kjell Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
@@ -195,6 +195,13 @@ DISK_getmetrics(disk, user)
return (0);
}
+ /* If we have BIOS geometry, use that */
+ if (disk->bios) {
+ disk->real = disk->bios;
+ return (0);
+ }
+
+
/* If we have a label, use that */
if (!disk->real && disk->label)
disk->real = disk->label;
@@ -203,18 +210,6 @@ DISK_getmetrics(disk, user)
if (disk->real == NULL)
return (1);
- /* If we have a bios, use that (if label looks bogus)
- *
- * XXX - This needs to be fixed!!!!
- * Currently machdep.bios.biosdev is USELESS
- * It needs to be, at least, a BSD device.
- * Or we need a mapping from biosdev -> BSD universe.
- */
- if (disk->bios)
- if (disk->real->cylinders > 262144 || disk->real->heads > 256 ||
- disk->real->sectors > 63)
- disk->real = disk->bios;
-
return (0);
}