-
-
Notifications
You must be signed in to change notification settings - Fork 6
Partition Types
Partition types are defined in sys/sys/gpt.h
These MidnightBSD types have been used for some time, and predate 1.0.
For MBR partitions, we piggyback off FreeBSD types. With GPT, we have the following types:
#define GPT_ENT_TYPE_MIDNIGHTBSD \
{0x85d5e45a,0x237c,0x11e1,0xb4,0xb3,{0xe8,0x9a,0x8f,0x7f,0xc3,0xa7}}
#define GPT_ENT_TYPE_MIDNIGHTBSD_NANDFS \
{0x85d5e45e,0x237c,0x11e1,0xbd,0x04,{0x00,0xe0,0x81,0x28,0x6a,0xcf}}
#define GPT_ENT_TYPE_MIDNIGHTBSD_SWAP \
{0x85d5e45b,0x237c,0x11e1,0xb4,0xb3,{0xe8,0x9a,0x8f,0x7f,0xc3,0xa7}}
#define GPT_ENT_TYPE_MIDNIGHTBSD_VINUM \
{0x85d5e45c,0x237c,0x11e1,0xb4,0xb3,{0xe8,0x9a,0x8f,0x7f,0xc3,0xa7}}
#define GPT_ENT_TYPE_MIDNIGHTBSD_ZFS \
{0x85d5e45d,0x237c,0x11e1,0xb4,0xb3,{0xe8,0x9a,0x8f,0x7f,0xc3,0xa7}}
#define GPT_ENT_TYPE_MIDNIGHTBSD_BOOT \
{0x85d5e45e,0x237c,0x11e1,0xb4,0xb3,{0xe8,0x9a,0x8f,0x7f,0xc3,0xa7}}
#define GPT_ENT_TYPE_MIDNIGHTBSD_UFS \
{0x0394ef8b,0x237e,0x11e1,0xb4,0xb3,{0xe8,0x9a,0x8f,0x7f,0xc3,0xa7}}
These get defined in GEOM like so:
/usr/src/sys/geom/part/g_part_gpt.c:static struct uuid gpt_uuid_midnightbsd = GPT_ENT_TYPE_MIDNIGHTBSD;
/usr/src/sys/geom/part/g_part_gpt.c:static struct uuid gpt_uuid_midnightbsd_boot = GPT_ENT_TYPE_MIDNIGHTBSD_BOOT;
/usr/src/sys/geom/part/g_part_gpt.c:static struct uuid gpt_uuid_midnightbsd_nandfs = GPT_ENT_TYPE_MIDNIGHTBSD_NANDFS;
/usr/src/sys/geom/part/g_part_gpt.c:static struct uuid gpt_uuid_midnightbsd_swap = GPT_ENT_TYPE_MIDNIGHTBSD_SWAP;
/usr/src/sys/geom/part/g_part_gpt.c:static struct uuid gpt_uuid_midnightbsd_ufs = GPT_ENT_TYPE_MIDNIGHTBSD_UFS;
/usr/src/sys/geom/part/g_part_gpt.c:static struct uuid gpt_uuid_midnightbsd_vinum = GPT_ENT_TYPE_MIDNIGHTBSD_VINUM;
/usr/src/sys/geom/part/g_part_gpt.c:static struct uuid gpt_uuid_midnightbsd_zfs = GPT_ENT_TYPE_MIDNIGHTBSD_ZFS;
The friendly names for these as displayed by tools:
/usr/src/sys/geom/part/g_part.c: { "mnbsd-boot", G_PART_ALIAS_MIDNIGHTBSD_BOOT },
/usr/src/sys/geom/part/g_part.c: { "mnbsd-nandfs", G_PART_ALIAS_MIDNIGHTBSD_NANDFS },
/usr/src/sys/geom/part/g_part.c: { "mnbsd-swap", G_PART_ALIAS_MIDNIGHTBSD_SWAP },
/usr/src/sys/geom/part/g_part.c: { "mnbsd-ufs", G_PART_ALIAS_MIDNIGHTBSD_UFS },
/usr/src/sys/geom/part/g_part.c: { "mnbsd-vinum", G_PART_ALIAS_MIDNIGHTBSD_VINUM },
/usr/src/sys/geom/part/g_part.c: { "mnbsd-zfs", G_PART_ALIAS_MIDNIGHTBSD_ZFS },