Re: Removal of GEOM_BSD, GEOM_MBR, GEOM_PC98 and GEOM_SUNLABEL

From: Tai-hwa Liang <avatar_at_mmlab.cse.yzu.edu.tw>
Date: Fri, 3 Apr 2009 13:29:33 +0800 (CST)
On Thu, 2 Apr 2009, Marcel Moolenaar wrote:
[...]
> 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.

   Much better. I can see extended partition nodes after booting with the
patched kernel:

# ls -la /dev/ad*
crw-r-----  1 root  operator    0,  73  4  3 21:12 /dev/ad0
crw-r-----  1 root  operator    0,  79  4  3 21:12 /dev/ad0s1
crw-r-----  1 root  operator    0,  80  4  3 21:12 /dev/ad0s2
crw-r-----  1 root  operator    0,  82  4  3 21:12 /dev/ad0s2a
crw-r-----  1 root  operator    0,  83  4  3 21:12 /dev/ad0s2b
crw-r-----  1 root  operator    0,  84  4  3 21:12 /dev/ad0s2d
crw-r-----  1 root  operator    0,  85  4  3 21:12 /dev/ad0s2e
crw-r-----  1 root  operator    0,  81  4  3 21:12 /dev/ad0s3
crw-r-----  1 root  operator    0,  86  4  3 21:12 /dev/ad0s3+00000001
crw-r-----  1 root  operator    0,  88  4  3 21:12 /dev/ad0s3+000410a1
crw-r-----  1 root  operator    0,  90  4  3 21:12 /dev/ad0s3+00103bf1
crw-r-----  1 root  operator    0,  92  4  3 21:12 /dev/ad0s3+0017cda1
lrwxr-xr-x  1 root  wheel           14  4  3 21:12 /dev/ad0s5 -> ad0s3+00000001
lrwxr-xr-x  1 root  wheel           14  4  3 21:12 /dev/ad0s6 -> ad0s3+000410a1
lrwxr-xr-x  1 root  wheel           14  4  3 21:12 /dev/ad0s7 -> ad0s3+00103bf1
lrwxr-xr-x  1 root  wheel           14  4  3 21:12 /dev/ad0s8 -> ad0s3+0017cda1
# gpart show
=>       63  228338775  ad0  MBR  (109G)
          63   18688257    1  !12  (8.9G)
    18688320   16783200    2  freebsd  [active]  (8.0G)
    35471520  192855600    3  !15  (92G)
   228327120      11718       - free -  (5.7M)

=>       0  16783200  ad0s2  BSD  (8.0G)
          0    786432      1  freebsd-ufs  (384M)
     786432   4194304      2  freebsd-swap  (2.0G)
    4980736    393216      4  freebsd-ufs  (192M)
    5373952  11409248      5  freebsd-ufs  (5.4G)

=>        0  192855600  ad0s3  EBR  (92G)
           0   16783200      1  !131  (8.0G)
    16783200   50243760  266401  !11  (24G)
    67026960   31251024  1063921  freebsd  (15G)
    98277984   94577616  1559969  freebsd  (45G)

   The only downside is that I'll have to update /etc/fstab to boot correctly
as /dev/ad0s7a is still missing.

-- 
Thanks,

Tai-hwa Liang
Received on Fri Apr 03 2009 - 03:29:56 UTC

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