What is UUID, PARTUUID and PTUUID?
What is UUID, PARTUUID and PTUUID?
https://unix.stackexchange.com/questions/375548/what-is-uuid-partuuid-and-ptuuid
Asked 8 years, 5 months ago Modified 1 year, 4 months ago Viewed 34k times 38
In the blkid output, some lines contain UUID and PARTUUID pairs and others only PTUUID. What do they mean?
In particular, why are two IDs required for a partition and why are some partitions identified by UUID/PARTUUID and some by PTUUID?
fstabgpt Share Improve this question Follow edited Mar 10, 2023 at 17:14 Peter Mortensen’s user avatar Peter Mortensen 1,01811 gold badge88 silver badges1010 bronze badges asked Jul 5, 2017 at 18:36 anatoly techtonik’s user avatar anatoly techtonik 2,78455 gold badges3030 silver badges4141 bronze badges 1 kernel.org/pub/linux/utils/util-linux/v2.25/libblkid-docs/… – don_crissti CommentedJul 5, 2017 at 18:38 1 @don_crissti I’ve seen that page in Google, but it doesn’t explain anything. – anatoly techtonik CommentedJul 5, 2017 at 18:40 2 What kind of “explanation” do you need, other than the description of PTUUID and PART_ENTRY_UUID (aka PARTUUID) ? – don_crissti CommentedJul 5, 2017 at 18:45 PARTUUID identifies a GPT partition (like /dev/sdbX). UUID identifies a filesystem. Not sure about PTUUID.. Maybe identifies a GPT device (like /dev/sdX)? – timothepoznanski CommentedSep 23, 2017 at 15:03 Add a comment 2 Answers Sorted by:
Highest score (default) 55
UUID is a filesystem-level UUID, which is retrieved from the filesystem metadata inside the partition. It can only be read if the filesystem type is known and readable.
PARTUUID is a partition-table-level UUID for the partition, a standard feature for all partitions on GPT-partitioned disks. Since it is retrieved from the partition table, it is accessible without making any assumptions at all about the actual contents of the partition. If the partition is encrypted using some unknown encryption method, this might be the only accessible unique identifier for that particular partition.
PTUUID is the UUID of the partition table itself, a unique identifier for the entire disk assigned at the time the disk was partitioned. It is the equivalent of the disk signature on MBR-partitioned disks but with more bits and a standardised procedure for its generation.
On MBR-partitioned disks, there are no UUIDs in the partition table. The 32-bit disk signature is used in place of a PTUUID, and PARTUUIDs are created by adding a dash and a two-digit partition number to the end of the disk signature.
Share Improve this answer Follow edited May 24, 2020 at 7:02 mcrute’s user avatar mcrute 10544 bronze badges answered Aug 18, 2018 at 20:42 telcoM’s user avatar telcoM 115k55 gold badges164164 silver badges313313 bronze badges 3 Can that PARTUUID be used in e.g. /etc/fstab like UUID? – jarno CommentedMay 23, 2020 at 8:14 4 @jarno According to man fstab on my Debian 10 system, yes. If you use a different distribution, check the man page on your system to verify. – telcoM CommentedMay 23, 2020 at 10:41 Here it also says that “Note that mount(8) uses UUIDs as strings. The string representation of the UUID should be based on lower case characters.” However, at least in one case also capital letters seem to work. – jarno CommentedMay 23, 2020 at 14:14 Is it possible to change or replace PTUUID and PARTUUID using dd? – Yousha Aleayoub CommentedOct 8, 2020 at 6:11 3 @YoushaAleayoub It’s technically possible, but very awkward to do, since you must calculate the location of each PTUUID and also recalculate and replace a CRC32 checksum after making a change. It’ll be much easier to use the expert commands of fdisk that is of a recent enough version to support GPT partitioning: x then i to change PTUUID, or x then u to change PARTUUID of a specific partition. – telcoM CommentedOct 8, 2020 at 6:24 Add a comment 1
You might also look at the use case. PartUUID and UUID have different use cases!
UUID:
Mounting Filesystems: UUIDs are used in /etc/fstab to mount filesystems during boot. Referencing Partitions: Scripts and configuration files often use UUIDs to identify specific partitions. PartUUID:
Identifying Partitions: PARTUUIDs help uniquely identify partitions, especially in scenarios like encrypted volumes. Stability Across Filesystem Changes: Unlike UUIDs, PARTUUIDs remain constant even if you reformat or change the filesystem. I found this how to useful for understanding more details and it helped me a lot.