[PATCH] Teach geom_label to recognise gpt labels and uuids

Marius Nünnerich marius at nuenneri.ch
Thu Oct 23 16:21:29 UTC 2008


On Thu, Oct 23, 2008 at 5:57 PM, Marcel Moolenaar <xcllnt at mac.com> wrote:
>
> On Oct 23, 2008, at 4:41 AM, Ivan Voras wrote:
>
>> Marius Nünnerich wrote:
>>>
>>> Hi all,
>>>
>>> I wrote the following patch for geom_label:
>>> http://nuenneri.ch/freebsd/geom_label.patch
>>>
>>> What do you think about it? I would love to hear about some tests.
>>
>> Do you think it's wise to have two separate directories: /dev/gpt and
>> /dev/gpt_uuid? I don't think anyone will mistake the UUID from the label
>> if it's in the same directory. Also, if I remember correctly how GPT
>> works, UUID is always present but the label is optional?
>
> Yes, the name/label is optional.
>
> Something to think about: A system can have multiple disks,
> and therefore multiple GPT tables. Each table has its own
> UUID (hdr_uuid). This is the UUID of the disk itself in a
> way. It's probably a good idea to expose that as well:
>        /dev/gpt/${hdr_uuid}/${ent_uuid}
>        /dev/gpt/${hdr_uuid}/${ent_name}

I tried something like this but decided against it, no other g_label
is like this. If ent_name is not unique on the system only the first
one is shown, that's consistent with the normal FS labels.

> or even:
>        /dev/gpt/${hdr_uuid}-${ent_uuid}
>        /dev/gpt/${hdr_uuid}-${ent_name}

These are too long filenames imo. For my taste the ent_uuid is unique
enough as a filename, but there should probably be a way to show which
partition has which ent_uuid with `gpart show`. I know that you try to
keep the interface consistent and the other partition types don't have
such a field. Anyway, what do you think about that?

BTW, do you know about another partition type which could be exposed like this?

Thanks for your response!
Marius


More information about the freebsd-geom mailing list