gmirror issues (fdisk?, disklabel?, newfs?)

Rick C. Petty rick-freebsd at kiwi-computer.com
Wed Dec 27 15:49:37 PST 2006


On Wed, Dec 27, 2006 at 10:18:12AM -0800, R. B. Riddick wrote:
>
> On R6.1 it works like it should:

I've seen just the opposite behavior, in 6.2-R.  Once geom_mirror is
loaded, I can't use bsdlabel or fdisk:

# boot0cfg -B ad1
boot0cfg: /dev/ad1: Geom not found
boot0cfg: write_mbr: /dev/ad1: No such file or directory
# ls /dev/ad*
/dev/ad0    /dev/ad2    /dev/ad2s1a /dev/ad2s1c /dev/ad2s1e /dev/ad2s1g
/dev/ad1    /dev/ad2s1  /dev/ad2s1b /dev/ad2s1d /dev/ad2s1f

# gmirror status
      Name    Status  Components
mirror/gm0  COMPLETE  ad0
                      ad1

I have the same problem with "fdisk -B".  Once geom opens the device, none
of the fdisk/bsdlabel/boot0cfg tools work anymore.  However, I wouldn't
expect them to, but this also fails:

# boot0cfg -B /dev/mirror/gm0
boot0cfg: /dev/mirror/gm0: Geom not found
boot0cfg: /dev/mirror/gm0: ioctl DIOCSMBR: Operation not permitted

So, once you enable any geom layer, you no longer have write access to the
boot blocks or otherwise.  This has been broken ever since GEOM was
introduced in 5.0.  I've been bitten many times by this in:  gmirror,
gvinum, gpt, glabel, etc.

What's worse is that these modules don't have a way to "untaste".  If you
load the module, all providers get tasted and there's no way back.  I got
burned last week when gmirror decided to flip out and it whacked ad1.
The system panicked on every boot.  The only remedy was to boot a 5.5-R
media (IIRC) and do "gmirror clear ad1" *before* geom_mirror was loaded.
IIRC, 6.0, 6.1, and all the other 5.x media I had didn't work.  What a
PITA!

It would be nice if the tools had a "load but don't taste" command, an
"untaste" command, and a "taste" command.  Until then, it all just feels
so incomplete, like it was hacked together.

-- Rick C. Petty


More information about the freebsd-geom mailing list