How to get the partition number of a GPT partition from the geom?
Marius Nünnerich
marius at nuenneri.ch
Sun Oct 19 22:37:48 UTC 2008
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?
I need that number as an index into the partition table.
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?
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?
Thanks for your help
Marius
More information about the freebsd-geom
mailing list