Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 04 Nov 1996 17:07:02 +0000
From:      Matt Thomas <matt@lkg.dec.com>
To:        Karl Denninger <karl@mcs.net>
Cc:        hackers@freebsd.org
Subject:   Re: Blargh - BSDI disk labels 
Message-ID:  <199611041707.RAA03867@whydos.lkg.dec.com>
In-Reply-To: Your message of "Fri, 01 Nov 1996 18:00:51 CST." <199611020000.SAA14917@Jupiter.Mcs.Net> 

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> Blargh folks.
> 
> FreeBSD doesn't understand BSDI disk labels.  Like at all.
> 
> There's no fix for this, is there?

Here's a patch I made for 2.1.0 so I could mount my BSD/OS labels.
It's ugly but it works...

--- /sys/kern/subr_diskslice.c	Tue May 30 08:05:51 1995
+++ ./subr_diskslice.c	Mon Nov  4 17:03:58 1996
@@ -748,17 +748,27 @@
 	}
 	if (pp->p_offset != start) {
 		if (sname != NULL) {
-			printf(
-"%s: rejecting BSD label: raw partition offset != slice offset\n",
-			       sname);
+			if (sp->ds_type == 159 /* BSD/OS */ && pp->p_offset == 0) {
+				printf(
+"%s: BSD/OS BSD label: restricting to diskslice\n", sname);
+				pp->p_offset += start;
+				pp->p_size -= start; 
+				if (pp->p_size > sp->ds_size)
+				    pp->p_size = sp->ds_size;
+			} else {
+				printf(
+"%s: rejecting BSD label: raw partition offset (%d) != slice offset (%d)\n",
+				       sname, pp->p_offset, start);
+			}
 			slice_info(sname, sp);
 			partition_info(sname, RAW_PART, pp);
 		}
-		return ("fixlabel: raw partition offset != slice offset");
+		if (pp->p_offset != start)
+			return ("fixlabel: raw partition offset != slice offset");
 	}
 	if (pp->p_size != sp->ds_size) {
 		if (sname != NULL) {
-			printf("%s: raw partition size != slice size\n", sname);
+			printf("%s: raw partition size (%d) != slice size (%d)\n", sname, pp->p_size, sp->ds_size);
 			slice_info(sname, sp);
 			partition_info(sname, RAW_PART, pp);
 		}
@@ -783,8 +793,8 @@
 			    || pp->p_offset + pp->p_size < pp->p_offset) {
 				if (sname != NULL) {
 					printf(
-"%s: rejecting partition in BSD label: it isn't entirely within the slice\n",
-					       sname);
+"%s: rejecting partition %c in BSD label: it isn't entirely within the slice\n",
+					       sname, 'a' + part);
 					if (!warned) {
 						slice_info(sname, sp);
 						warned = TRUE;

-- 
Matt Thomas               Internet:   matt@3am-software.com
3am Software Foundry      WWW URL:    http://www.3am-software.com/bio/matt.html
Westford, MA              Disclaimer: I disavow all knowledge of this message





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199611041707.RAA03867>