Subject: port-i386/540: People don't understand what the "overwriting disk.." message from disklabel means
To: None <gnats-admin@sun-lamp.cs.berkeley.edu>
From: Ken Hornstein <kenh@excalibur.entropic.com>
List: netbsd-bugs
Date: 10/30/1994 00:20:03
>Number:         540
>Category:       port-i386
>Synopsis:       People don't understand what the "overwriting disk.." message from disklabel means
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Oct 30 00:20:01 1994
>Originator:     Ken Hornstein
>Organization:
"	"
>Release:        
>Environment:
	
System: NetBSD excalibur 1.0 NetBSD 1.0 (EXCALIBUR) #5: Wed Oct 26 03:26:15 EDT 1994 kenh@excalibur:/usr/src/sys/arch/i386/compile/EXCALIBUR i386


>Description:
People don't really understand what the "Overwriting disk with DOS partition
table" message you get from disklabel means.  And when someone _does_
understand it, they don't get any feedback as to _why_ disklabel thinks their
DOS and Unix partition setup doesn't jive.
	
>How-To-Repeat:
Have some inexperienced users try to install NetBSD on their drive and have
it co-exist with DOS.  Watch the partition tables get trashed :-)
	
>Fix:
	
The following patch will make a user think twice before hitting 'y', and also
give some possible reasons why you got that message.

--- disklabel.c.old	Sun Oct 30 01:34:18 1994
+++ disklabel.c	Sun Oct 30 02:08:00 1994
@@ -404,8 +404,24 @@
 			if (dosdp) {
 				int c;
 
-				printf("overwriting disk with DOS partition table? (n): ");
+				printf("Warning!!  A wrong answer to the question below could trash your disk!\n");
+				printf("\nYou have a DOS partition table that is not compatible with NetBSD.\n");
+				printf("This can be caused by one of three things:\n");
+				printf(" - a partition type that is not %d\n",
+					DOSPTYP_386BSD);
+				printf("   (Your partition type is %d)\n",
+					dosdp->dp_typ);
+				printf(" - a zero size for your Unix 'c' partition\n");
+				printf("   (Your 'c' partition is %d blocks)\n",
+					pp->p_size);
+				printf(" - the offset of your NetBSD MS-DOS partition not being the same as\n   the offset of your Unix 'c' partition\n");
+				printf("   (Your MS-DOS paritition offset is %d, your Unix 'c' partition\n    offset is %d)\n",
+					dosdp->dp_start, pp->p_offset);
+				printf("\nYou should only answer 'y' to the following question if you plan on using\n");
+				printf("your whole disk for NetBSD.  Otherwise hit 'n' and correct your\npartition table.\n");
+				printf("\nOverwriting disk with DOS partition table? (n): ");
 				fflush(stdout);
+				exit(0);
 				c = getchar();
 				if (c != EOF && c != '\n')
 					while (getchar() != '\n')
>Audit-Trail:
>Unformatted: