1

I have a perplexing problem with the EFI partition on my boot SSD. The GPT partition type is "Microsoft Basic Data". On all other drives in my system, including my Carbon Copy Cloner clone of my boot drive, the partition type is "EFI" (see below):

$ diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *512.1 GB   disk0
   1:       Microsoft Basic Data EFI                     209.7 MB   disk0s1
   2:                  Apple_HFS Tims Boot SSD           498.7 GB   disk0s2
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *960.2 GB   disk1
   1:                        EFI EFI                     209.7 MB   disk1s1
   2:                  Apple_HFS Users                   959.9 GB   disk1s2

...

/dev/disk4
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *512.1 GB   disk4
   1:                        EFI EFI                     209.7 MB   disk4s1
   2:                  Apple_HFS Tims Boot SSD Clone     511.8 GB   disk4s2

My system boots just fine, but it appears to be loading the bootloader (Clover in this case) from the /Users drive (disk1) instead of from the boot SSD (disk0), and I think the incorrect GPT partition type is to blame.

I tried to update the partition type using the "asr adjust" command as outlined at https://unix.stackexchange.com/questions/58705/mac-os-x-partition-type-problem, but it doesn't work and gives me a very unhelpful error message:

$ sudo asr adjust --target /dev/disk0s1 --settype EFI
asr: Volume adjustment failed: Unknown error: -123

I have found information about other possible ways to set the GPT partition type through Google searches, but all the other methods seem risky, with warnings about erasing the partition in question, etc.

Does anyone know how I can fix this?

  • Have you booted from another HD (or Recovery HD) and tried the asr command? – At0mic Sep 26 '15 at 19:29
  • Yes, I have a bootable USB backup clone of my boot drive. I booted from it and got the same error when I tried the asr command. – timbck2 Sep 27 '15 at 19:43
0

I recreated your problem using a 4 GB flash drive. Below is the output from the command diskutil list /dev/disk1.

/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *4.0 GB     disk1
   1:       Microsoft Basic Data EFI                     209.7 MB   disk1s1
   2:                  Apple_HFS Tims Boot SSD           3.7 GB     disk1s2

Below is the output from the command sudo gpt -r show /dev/disk1

    start     size  index  contents
        0        1         PMBR
        1        1         Pri GPT header
        2       32         Pri GPT table
       34        6         
       40   409600      1  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
   409640  7220264      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
  7629904   262150         
  7892054       32         Sec GPT table
  7892086        1         Sec GPT header

The problem is the partition type GUID for the EFI partition is EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 and it should be C12A7328-F81F-11D2-BA4B-00A0C93EC93B.

To correct this, I entered the following commands. In your case, you would substitute disk0 for disk1. You should enter these commands from the bootable USB backup clone of your boot drive.

diskutil unmountdisk /dev/disk1
sudo gpt remove -i 1 /dev/disk1
diskutil unmountdisk /dev/disk1
sudo gpt add -i 1 -b 40 -s 409600 -t C12A7328-F81F-11D2-BA4B-00A0C93EC93B /dev/disk1

Before entering type above commands, make sure your start and size entries are 40 and 409600, respectively. If not, make the appropriate corrections to the -b and -s options.

  • That did the trick - thank you! I wonder how the partition type got set wrong in the first place? – timbck2 Sep 30 '15 at 12:45
  • macerror -123 Mac OS error -123 (wrgVolTypErr): Wrong volume type error [operation not supported for MFS] – cave-canem May 16 '17 at 21:48
0

You can change the partition type with GPT fdisk. This can be done in a running system, booted from the disk on which you want to only change that single unused partition to EFI, leaving the other partitions unchanged.

You can download the current version of gdisk from here : https://sourceforge.net/projects/gptfdisk/files/gptfdisk/

After installing, to change the type of your disk0s1 partition, in Terminal :

  • sudo umount /dev/disk0s1 in case it is mounted.
  • sudo gdisk /dev/disk0

Then in gdisk, use these commands :

  • ? to print the list of commands
  • p to print the partition table
  • l to list partition type codes Then
  • Use t to change the partition type
    • Enter 1 when prompted to select the partition (assuming you want to change partition 1)
    • Enter ef00 for the "Hex code or GUID" to change the type to "EFI"
  • Use c to change the partition name
    • Enter 1 when prompted to select the partition
    • Enter EFI for the name Finally
  • Use p to check it is as you intended,
  • and w to actually write the new partition to disk and exit
  • Reboot.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .