Partition GUID Code vs Partition Unique GUID – Differences

gpt

I'm just reading up on GUID partition tables, and messing around with gdisk, I see these two titles.

What is the difference between them?

I am referring to the following (emphasis mine) shown when running gdisk:

GPT fdisk (gdisk) version 0.8.7

Type device filename, or press to exit: /dev/sda
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): i
Partition number (1-7): 4

Partition GUID code: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (Microsoft basic data)

Partition unique GUID: 85E66D2F-3709-4060-938E-FFE836433CC9
First sector: 2844672 (at 1.4 GiB)
Last sector: 651208703 (at 310.5 GiB) Partition size: 648364032
sectors (309.2 GiB) Attribute flags: 0000000000000000 Partition name:
'Basic data partition'

Command (? for help):

Best Answer

The partition unique GUID is generated at the time that the partition is created. It uniquely identifies the partition at least inside the disk and probably among all the disks you own (because it's unbelievably rare for GUIDs to collide).

A partition GUID code (by which I believe you mean a partition type GUID), on the other hand, is a known, fixed GUID. It identifies the type of data inside that partition. For example, if you had a partition that contained an ordinary GNU/Linux filesystem, you would assign it a partition type GUID of 0FC63DAF-8483-4772-8E79-3D69D8477DE4 (defined as "GNU/Linux filesystem data"). If that partition was used as your /home, you would give it a GUID of 933AC7E1-2EB4-4F13-B844-0E14E2AEF915 (defined as "GNU/Linux /home"). If that partition was encrypted with, say, LUKS, you would give it a GUID of CA7D7CCB-63ED-4C53-861C-1742536059CC (defined as "LUKS partition"). And so on and so forth.

tl;dr: the partition unique GUID identifies that exact partition. The partition GUID code identifies the type of data inside that particular partition.

Related Question