Removal of GEOM_BSD, GEOM_MBR, GEOM_PC98 and GEOM_SUNLABEL

Marcel Moolenaar xcllnt at mac.com
Thu Apr 2 21:44:10 PDT 2009


On Apr 2, 2009, at 6:35 PM, Tai-hwa Liang wrote:

> On Thu, 2 Apr 2009, Marcel Moolenaar wrote:
>> Can you dump the first 2 sectors of slice 3 and
>> send it to me:
>> 	dd if=/dev/ad0s3 of=/tmp/dump.dd count=2 bs=512

*snip*
> 000001b0  00 00 00 00 00 f2 0e 00  00 00 00 00 00 00 00 01   
> |................|
> 000001c0  c1 ff 83 ef ff ff 3f 00  00 00 21 17 00 01 00 00   
> |......?...!.....|
> 000001d0  c1 ff 05 ef ff ff 60 17  00 01 b0 a8 fe 02 00 00   
> |......`.........|
> 000001e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   
> |................|
> 000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa   
> |..............U.|
*snip*

It looks like you have a boot menu entry at 0x1b6. Can you
try the following patch:

Index: g_part_ebr.c
===================================================================
--- g_part_ebr.c	(revision 190655)
+++ g_part_ebr.c	(working copy)
@@ -403,9 +403,13 @@
  	if (magic != DOSMAGIC)
  		goto out;

-	/* The sector is all zeroes, except for the partition entries. */
+	/*
+	 * The sector is all zeroes, except for the partition entries
+	 * and a possible IBM Boot Manager menu entry. The menu entry
+	 * is 9 bytes in length and preceeds the partition entries.
+	 */
  	sum = 0;
-	for (index = 0; index < DOSPARTOFF; index++)
+	for (index = 0; index < DOSPARTOFF - 9; index++)
  		sum += buf[index];
  	if (sum != 0)
  		goto out;


The real fix will be a bit more involved, because we should
avoid wiping out the boot menu entry on a write. But at least
with the patch you should be able to read the EBR.

Thanks,

-- 
Marcel Moolenaar
xcllnt at mac.com





More information about the freebsd-current mailing list