--- geom_bsd.c.orig	Tue May 31 21:53:31 2005
+++ geom_bsd.c	Tue Jun  7 04:04:11 2005
@@ -42,6 +42,8 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD: src/sys/geom/geom_bsd.c,v 1.70.2.3 2005/03/22 13:41:58 pjd Exp $");
 
+#define MAXPARTITIONS 16
+
 #include <sys/param.h>
 #include <sys/endian.h>
 #include <sys/systm.h>
@@ -131,7 +133,11 @@
 		if (o < rawoffset)
 			rawoffset = 0;
 	}
-	
+
+	if(dl.d_npartitions > 8)
+		rawoffset = (off_t)dl.d_partitions[0].p_offset * dl.d_secsize;
+
+
 	if (rawoffset != 0 && (off_t)rawoffset != ms->mbroffset)
 		printf("WARNING: Expected rawoffset %jd, found %jd\n",
 		    (intmax_t)ms->mbroffset/dl.d_secsize,
@@ -512,7 +518,8 @@
 		 */
 		error = g_getattr("MBR::type", cp, &i);
 		if (!error) {
-			if (i != 165 && flags == G_TF_NORMAL)
+			if (i != 165 && i != 166 && i != 169 &&
+			    flags == G_TF_NORMAL)
 				break;
 			error = g_getattr("MBR::offset", cp, &ms->mbroffset);
 			if (error)

