G_PART macro definitions

perryh at pluto.rain.com perryh at pluto.rain.com
Tue Nov 30 10:41:28 UTC 2010


"Andrey V. Elsukov" <bu7cher at yandex.ru> wrote:

> > I'm trying to figure out why my disk partitions are not being
> > recognized correctly.  There's a description of what I currently
> > think is happening at
> > http://lists.freebsd.org/pipermail/freebsd-questions/2010-November/224466.html
>
> Can you show detailed log of what you did (all commands with output)?

Most of it is already in the archives :)

  Mirror creation
  http://lists.freebsd.org/pipermail/freebsd-questions/2010-September/221253.html

  Unexpected, and apparently bogus, messages from gmirror
  http://lists.freebsd.org/pipermail/freebsd-questions/2010-September/221283.html

  Journal creation, newfs, install (incl. /boot/loader.conf and
  /etc/fstab created before rebooting)
  http://lists.freebsd.org/pipermail/freebsd-geom/2010-November/004479.html

but I think the essence of the problem can be reproduced without
involving gjournal at all:

1. Slice & bsdlabel a disk, creating (for example) ad0s2a and ad0s2b.

2. Create a gmirror (gm0) with ad0s2a as its provider.

2a. Load gmirror.ko, if not already loaded, so that /dev/mirror/gm0
    exists.

3. Bsdlabel gm0, creating gm0a, gm0d, gm0e; examine /dev/mirror and
   find them in existence.

4. Reboot, ensuring that gmirror.ko is loaded.

After the reboot, we _should_ still have:

  /dev/ad0
  /dev/ad0s1
  /dev/ad0s2
  /dev/ad0s2a
  /dev/ad0s2b
  /dev/mirror/gm0
  /dev/mirror/gm0a
  /dev/mirror/gm0d
  /dev/mirror/gm0e

but what I got was

  /dev/ad0
  /dev/ad0s1
  /dev/ad0s2
  /dev/ad0s2a
  /dev/ad0s2d
  /dev/ad0s2e

/dev/ad0s2b is missing, and the partitions that should be on
/dev/mirror/gm0 show up as partitions of ad0s2 instead.

I think Marcel Moolenaar is very likely correct that the confusion
arises from the two bsdlabels appearing to be nested, but it's not
yet clear how I _should_ go about partitioning the mirror, so as to
avoid this while still enabling the loader to find the kernel (on a
system whose BIOS is too old to understand GPT).


More information about the freebsd-geom mailing list