Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Oct 2008 19:55:34 +0200
From:      "=?ISO-8859-1?Q?Marius_N=FCnnerich?=" <marius@nuenneri.ch>
To:        freebsd-geom@freebsd.org
Subject:   Re: How to get the partition number of a GPT partition from the geom?
Message-ID:  <b649e5e0810201055s27adb3a9i836251d943e1b475@mail.gmail.com>
In-Reply-To: <b649e5e0810191537s3b505c5cke7c11e2677f2a294@mail.gmail.com>
References:  <b649e5e0810191537s3b505c5cke7c11e2677f2a294@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Time for an update :)

On Mon, Oct 20, 2008 at 12:37 AM, Marius N=FCnnerich <marius@nuenneri.ch> w=
rote:
> Hi all,
>
> I'm currently experimenting with adding a geom_label for the GPT
> labels and uuid's. I'm not sure how to proceed because it's different
> to FS labels. I added g_label_gpt_taste() and changed some files
> according to the comment in g_label.c.
>
> Can I somehow determine which partion number cp->provider has? I
> already check that cp->provider->geom->class->name is equal to "PART".
> cp->provider->name is "md0p1" for example, do I really need to parse
> that string for the number?
No

> I need that number as an index into the partition table.
It's cp->provider->index :)

> Another thing: Can I call g_part_read() which is provided by the PART
> class to get the partition table of the geom or would I need to read
> and parse it on my own?
I don't need to, because the whole table is stored in cp->provider->geom->s=
oftc.

> Another idea: geom_part already provides a mechanism to get/set the
> label from userspace, would it be possible to use that mechanism from
> inside the geom_label?
Wouldn't help, seems like userland gpart parses the dumpconf xml.

A new question popped up:
Is it possible to test the a geom of class PART is of "subclass" GPT?

 - Marius



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?b649e5e0810201055s27adb3a9i836251d943e1b475>