gpart bootcode and /boot/boot

Marcel Moolenaar xcllnt at
Thu Feb 26 09:54:39 PST 2009

On Feb 26, 2009, at 8:28 AM, Andriy Gapon wrote:

> on 22/01/2009 21:00 Andriy Gapon said the following:
>> Sorry for being lazy - what is "gpart bootcode" equivalent of  
>> bsdlabel
>> -B [-b boot] ?
> Marcel, guys, I am still curious.
> disklabel -B refuses do to anything because of what it thinks is  
> incorrect
> partition info.
> And the following command gets "Operation not permitted" when it  
> opens ad6s1 for
> writing:
> gpart bootcode -p /boot/boot -i 1 ad6

Don't you mean "gpart bootcode -b /boot/boot ad6s1"

If you say "-i 1 ad6", then what you want is bootcode
in a partition that is controlled by the scheme on ad6
(the scheme on ad6 is the MBR). You can't do that,
because that partition is sub-partitioned by the BSD

Since you want bootcode in the BSD scheme, you need
to add bootcode to ad6s1.

> This is amd64, stable/7, gpart-only kernel (gpart_mbr, gpart_bsd).

Bootcode for the BSD scheme is not present in 7-STABLE yet.
I just recently added that to -CURRENT (I must have missed
it) and I need to get around MFCing it. Feel free to do the
MFC for me. The code has been in -CURRENT long enough to do
a MFC.


Marcel Moolenaar
xcllnt at

More information about the freebsd-geom mailing list