11

In Ubuntu 14.04 there is only one UUID for each partition.

For example my sudo blkid shows

/dev/sda1: UUID="b2be9c80-8413-4fdb-a562-6ca072385c02" TYPE="ext4" 
/dev/sda2: UUID="ccd2f497-5d8f-48c7-9102-c339c2689ff8" TYPE="swap" 
/dev/sdb4: UUID="eb34f285-4a78-494c-9950-a2095b1740ce" TYPE="ext4"

But in Ubuntu 15.04 in blkid and /etc/fstab there is also PARTUUID like this

/dev/sda5: LABEL="volume1" UUID="bb69c64d-5c45-4bab-90e1-ba46e5afd6b2" TYPE="ext4" PARTUUID="094b7241-4895-4051-90ab-439252b4e3f4"

What is it for?

muru
  • 193,181
  • 53
  • 473
  • 722
Pilot6
  • 88,764
  • 91
  • 205
  • 313
  • It also shows up for FAT32/ntfs based partitions. `/dev/sdc1: LABEL="MUSIC_9" UUID="5A5B-2F15" TYPE="vfat" PARTUUID="7602dd12-01"` The UUID is actually the FAT32 serial number. I changed my serial number, and the PARTUUID did not change. – Kevin Oct 30 '15 at 19:56
  • I wonder why my Ubuntu 16.04 `/etc/fstab` only shows the UUID and there is no PartUUID like there was in your Ubuntu 15.10? Does your current Ubuntu still have a PartUUID? – WinEunuuchs2Unix Apr 27 '18 at 23:18
  • I never mentioned that my `/etc/fstab` showed PARTUUID. – Pilot6 Apr 28 '18 at 16:27

1 Answers1

8

I don't know what it is for, but it is a GPT feature. Since the G in GPT stands for GUID (Globally Unique Identifier), the PARTUUIDs might be the GUID of the corresponding GPT partition. The UUID, on the other hand, is from the filesystem.

The PARTUUID should remain unchanged if you format the partition to a different filesystem, as long as you don't modify the partition itself. I tested it on Arch Linux on a spare pen drive:

$ sudo blkid /dev/sdd1
/dev/sdd1: UUID="1e867d95-dd7f-4c97-aa3f-7ee4490744bc" TYPE="ext4" PARTUUID="a96b7ca5-f7f8-40c9-a35c-6d995787ab2f"
$ sudo mkfs -t ext4 /dev/sdd1
mke2fs 1.42.12 (29-Aug-2014)
/dev/sdd1 contains a ext4 file system
    created on Fri Jul 10 20:51:19 2015
Proceed anyway? (y,n) y
Creating filesystem with 1954167 4k blocks and 488640 inodes
Filesystem UUID: 6c3393bf-aba1-4854-9815-f62818facfda
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done 

$ sudo blkid /dev/sdd1       
/dev/sdd1: UUID="6c3393bf-aba1-4854-9815-f62818facfda" TYPE="ext4" PARTUUID="a96b7ca5-f7f8-40c9-a35c-6d995787ab2f"
$ sudo mkfs -t ntfs -Q /dev/sdd1
Cluster size has been automatically set to 4096 bytes.
Creating NTFS volume structures.
mkntfs completed successfully. Have a nice day.
$ sudo blkid /dev/sdd1          
/dev/sdd1: UUID="2905A16E2CDB44E8" TYPE="ntfs" PARTUUID="a96b7ca5-f7f8-40c9-a35c-6d995787ab2f"
muru
  • 193,181
  • 53
  • 473
  • 722
  • But what is the point of having two UUIDs for a partition? – Pilot6 Jul 09 '15 at 18:07
  • 2
    @Pilot6, because the designers of GPT thought it a good idea to have a UUID to identify a partition, but this was a feature that was important enough to the linux community that they already had implemented it years earlier within linux filesystems ( which was the only way you could do it on a DOS partition table ). – psusi Jul 09 '15 at 18:12
  • 1
    @Pilot6 UUIDs are not for a partition, but for a filesystem. – muru Jul 09 '15 at 18:16
  • @muru So if I reformat a partition UUID will change, but PARTUUID will stay? – Pilot6 Jul 09 '15 at 18:17
  • 1
    @Pilot6 assuming that by format you mean run some `mkfs` command on it, yes, I think it should. – muru Jul 09 '15 at 18:19
  • @muru It is a shame that I can't test it. I have a lot of GPT disks around, but no 15.04 install. In 14.04 it does not show PARTUUID. – Pilot6 Jul 09 '15 at 18:23
  • @Pilot6 FWIW, I ran mkfs a couple of times on a GPT partition from an Arch Linux box. The PARTUUID remained unchanged. – muru Jul 10 '15 at 16:21
  • @muru Good! Thx! Maybe it makes sense to add it to the answer? I guess it is the main practical difference. – Pilot6 Jul 10 '15 at 16:23