Bug #2741


format shouldn't allow write SMI label to disk with EFI partition

Added by Alexander Eremin about 10 years ago. Updated almost 10 years ago.

cmd - userland programs
Start date:
Due date:
% Done:


Estimated time:
Gerrit CR:


If disk has an EFI partition, but efi label is missing, format allows to write SMI label (and think that disk has SMI label):
(after clearing efi label with dd):
format> la
[0] SMI Label
[1] EFI Label
Specify Label type [0]: 0
Ready to label disk, continue? y
And disk with EFI partition gets it senseless SMI label.
Before writing SMI label, format should call existing warning about deleting EFI partition and creating new Solaris partition.

Also if disk has no label but EFI partition and user selected EFI label, format reports that the disk has a SMI label, that's wrong.

Actions #1

Updated by Alexander Eremin almost 10 years ago

  • Status changed from New to Pending RTI
  • % Done changed from 0 to 100
Actions #2

Updated by Albert Lee almost 10 years ago

Clarification from Alexander:

if disk has one whole-disk EFI partition and no primary and backup EFI labels (this is possible to

setup with dd), then format thinks the disk is SMI-labeled by default and allows to write SMI

label. So at the end we can get disk with EFI partition and SMI label. Also if in this situation choose

EFI label in menu, format reports that disk has SMI label.

So this fix prevents format to write SMI label in case of whole-disk EFI partition

and fixes warning appearance.

Actions #3

Updated by Albert Lee almost 10 years ago

Additional notes from me:
What format(1M) calls an "EFI label", and is officially just a "GPT",
is a single block containing a GPT header, followed by blocks
containing partition entries. These must exist for any partitions to
be described in the EFI/GPT scheme. In that scheme, everything else is

If I understand you correctly, the failure case is when a disk has:
  • A legacy MBR/fdisk partition table
  • An fdisk partition with an "EFI" partition type - as is commonly
    used to protect the GPT (EFI label) from legacy partitioning tools
  • No GPTs present

For example, if you manually added an fdisk partition to the MBR of a
blank disk prior to attempting to create the EFI label with

So while the state of the disk is unusual (the only normal case where
legacy fdisk partitions may exist prior to the GPTs being created is
when the GPT-managed part of the disk has to coexist with legacy fdisk
partitions a la Boot Camp on Macs), the behaviour of format(1M) here
in assuming the disk has an fdisk partition with SMI partition type is
indeed incorrect, and the new behaviour is an improvement.

Actions #4

Updated by Albert Lee almost 10 years ago

  • Status changed from Pending RTI to Resolved

Fixed in:
changeset: 13742:b6bbdd77139c
tag: tip
user: Alexander Eremin <>
date: Thu Jun 14 12:09:31 2012 +0400
files: usr/src/cmd/format/menu_command.c
2741 format shouldn't allow write SMI label to disk with EFI partition
Reviewed by: Garrett D'Amore <>
Reviewed by: Milan Jurik <>
Reviewed by: Steve Gonczi <>
Reviewed by: Gary Mills <>
Approved by: Albert Lee <>


Also available in: Atom PDF