Subject: port-i386/2543: BSDI fdisk partitions not recognised
To: None <gnats-bugs@NetBSD.ORG>
From: None <driehuis@playbeing.org>
List: netbsd-bugs
Date: 06/10/1996 03:38:51
>Number:         2543
>Category:       port-i386
>Synopsis:       BSDI fdisk partitions not recognised
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 12 13:20:03 1996
>Last-Modified:
>Originator:     Bert Driehuis
>Organization:
	PlayBeing-Intl
>Release:        NetBSD-1.2_ALPHA as of 960606
>Environment:
System: NetBSD venus.playbeing.org 1.1_ALPHA NetBSD 1.1_ALPHA (BERT) #1: Sat Nov 18 00:07:06 MET 1995 bert@venus.playbeing.org:/usr/src/sys/arch/sparc/compile/BERT sparc


>Description:
	NetBSD doesn't grok BSDI 2.0.1 fdisk-style partitions. This seems silly,
	since the BSDI format appears to be identical to NetBSD's. I just 
	added partition type 0x9f as an equivalent for 0xa5, and was happy 
	ever after.

	Note that BSDI got rid of the d-partition, and may or may not have
	done other things differently in cases that I didn't test. Caveat
	emptor! Note also that you don't need this if you do not install
	DOS coresidency (i.e., if you use native BSD disklabels).
>How-To-Repeat:
	Install NetBSD and BSDI on different disks in one machine. Get very
	frustrated about not being able to reach your home directory, since
	it resides on a BSDI file system inside an fdisk-style partition.
>Fix:
	Apply this patch:
*** arch/i386/include/disklabel.h.orig	Sun Mar 10 02:21:41 1996
--- arch/i386/include/disklabel.h	Mon Jun 10 01:19:05 1996
***************
*** 58,61 ****
--- 58,64 ----
  
  /* Known DOS partition types. */
+ #ifdef COMPAT_BSDIPART
+ #define	DOSPTYP_BSDI	0x9f		/* BSDI partition type */
+ #endif
  #define	DOSPTYP_386BSD	0xa5		/* 386BSD partition type */
  #define DOSPTYP_NETBSD	DOSPTYP_386BSD	/* NetBSD partition type (XXX) */
*** arch/i386/i386/disksubr.c.orig	Sat May  4 13:47:03 1996
--- arch/i386/i386/disksubr.c	Mon Jun 10 01:21:49 1996
***************
*** 125,129 ****
--- 125,135 ----
  
  				/* is this ours? */
+ #ifdef COMPAT_BSDIPART
+ 				if (dp->dp_size &&
+ 					(dp->dp_typ == DOSPTYP_386BSD
+ 						|| dp->dp_typ == DOSPTYP_BSDI)
+ #else
  				if (dp->dp_size && dp->dp_typ == DOSPTYP_386BSD
+ #endif
  				    && dospartoff == 0) {
  					/* need sector address for SCSI/IDE,
>Audit-Trail:
>Unformatted: