0

I am attempting to follow the answer post at https://apple.stackexchange.com/a/231027.

However, the third partition does not have a listed UUID. Instead, I have the following.

          start       size  index  contents
          0          1         PMBR
          1          1         Pri GPT header
          2          4         Pri GPT table
          6      76800      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
      76806  488269066      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
  488345872      32768         
  488378640          4         Sec GPT table
  488378644          1         Sec GPT header

So for the command given below, do I have to assign an UUID to missing block, or can I use any valid UUID, and that is what the added partition UUID will become?

gpt add -b LastBlockNumber-262183 -i 3 -s 262144 -t 426F6F74-0000-11AA-AA11-00306543ECAC disk1

In other words, does the UUID in the gpt add command have to be the UUID of the block you are adding, or is the UUID in the gpt add command what the added UUID will become after it is added?

1 Answer 1

0

Since GPT is an abbreviation for GUID Partition Table, this answer will use GUID in place of UUID.

Each GPT entry has a partition type GUID and an unique partition GUID. The exact format of an entry is given in the following GUID partition entry format table, which was copied from Wikipedia.

Offset Length Contents
 0 (0x00) 16 bytes Partition type GUID (mixed endian[7])
16 (0x10) 16 bytes Unique partition GUID (mixed endian)
32 (0x20)  8 bytes First LBA (little endian)
40 (0x28)  8 bytes Last LBA (inclusive, usually odd)
48 (0x30)  8 bytes Attribute flags (e.g. bit 60 denotes read-only)
56 (0x38) 72 bytes Partition name (36 UTF-16LE code units)

Partition Type GUID

You do not have to assign any GUIDs to a missing block. If you omit the -t option from the gpt add command, a partition type GUID of 48465300-0000-11AA-AA11-00306543ECAC will be used. You can specify any GUID as an argument to the -t option. No checking is preformed by the gpt add command to see if the entered GUID has been associated with a existing partition type. Common partition type GUIDs are listed in Wikipedia. You can also specify one of the following aliases as an argument to the -t option.

Alias Argument Actual GUID Used
efi C12A7328-F81F-11D2-BA4B-00A0C93EC93B
hfs 48465300-0000-11AA-AA11-00306543ECAC
apfs 7C3457EF-0000-11AA-AA11-00306543ECAC
linux EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
windows EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

With macOS (OS X) the partition type GUID usually has to match the type of data stored in the corresponding partition. For example, if the data is a valid Mac OS Extended Journaled (JHFS+) volume and the partition type GUID is EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, then the volume will not mount.

Unique Partition GUID

The gpt add command does not have a option for specifying an unique partition GUID for a GPT entry. The gpt add command leaves the existing unique partition GUID unchanged unless the value is 00000000-0000-0000-0000-000000000000. If the case where the existing unique partition GUID is 00000000-0000-0000-0000-000000000000, the gpt add command sets the GUID to a newly generated value.

I should point out that when the gpt remove command sets the partition type GUID of a GPT entry to 00000000-0000-0000-0000-000000000000, the corresponding unique partition GUID is left unchanged. Also, the gpt create command sets the partition type GUID of each GPT entry to 00000000-0000-0000-0000-000000000000 and sets the unique partition GUID for each GPT entry to a newly generated value.

Other GUIDs

The data stored in a partition defined by a GPT entry may also contain one or more GUIDs. The gpt add command has no options where any of these GUIDs would be used as a argument.


Original Answer

Being that the disk in the other question was assume to have a sector size of 4096 bytes and your disk has a sector size of 512 bytes, some numbers will need to be scaled by 8. So I would try the following.

gpt add -b 488345872 -i 3 -s 32768 -t 426F6F74-0000-11AA-AA11-00306543ECAC disk1

In order for this to work, there would also need to be a recovery volume stored at this location on disk1.

2
  • Ok, however the block that has a size of 32768 does not have a partition or UUID assigned to it, where as that block does have a part/uuid assigned in the linked answer. My question is does the UUID in the gpt add command have to be the UUID of the block you are adding, or is the UUID in the gpt add command what the added UUID will become after its added? Apr 22 at 16:13
  • Does UUID mean the unique partition GUID of the GPT entry, the partition type GUID of the GPT entry or the UUID of a volume in the partition defined by the GPT entry? Normally, all three would be different. Apr 22 at 20:30

You must log in to answer this question.

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