diff --git a/sys/geom/part/g_part_gpt.c b/sys/geom/part/g_part_gpt.c --- a/sys/geom/part/g_part_gpt.c +++ b/sys/geom/part/g_part_gpt.c @@ -1043,6 +1043,18 @@ g_free(sectbl); } + /* + * Warn when the lba_start doesn't meet the stanard's minimum size of + * the gpt array. UEFI 2.10 section 5.3 specifies that the LBA must be + * 32 (for 512 byte sectors) or 6 (4k sectors) or larger. This is + * different than the number of valid entries in the gpt entry array. + */ + if (table->hdr->hdr_lba_start < GPT_MIN_RESERVED / pp->sectorsize + 2) { + printf("GEOM: warning: %s lba_start %llu < required min %d\n", + pp->name, (unsigned long long)table->hdr->hdr_lba_start, + GPT_MIN_RESERVED + 2); + } + basetable->gpt_first = table->hdr->hdr_lba_start; basetable->gpt_last = table->hdr->hdr_lba_end; basetable->gpt_entries = table->hdr->hdr_entries;