Re: Removal of GEOM_BSD, GEOM_MBR, GEOM_PC98 and GEOM_SUNLABEL

From: Marcel Moolenaar <xcllnt_at_mac.com>
Date: Thu, 02 Apr 2009 21:44:02 -0700
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)
_at__at_ -403,9 +403,13 _at__at_
  	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
Received on Fri Apr 03 2009 - 02:44:09 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:45 UTC