什么是 PARTUUID?

什么是 PARTUUID?

在 Ubuntu 14.04 中每个分区只有一个 UUID。

例如我的sudo blkid节目

/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"

但在 Ubuntu 15.04 中blkid/etc/fstab出现PARTUUID这样的情况

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

它是用来做什么的?

答案1

我不知道它是干什么用的,但它是GPT 功能。由于 GPT 中的 G 代表 GUID(全局唯一标识符),PARTUUID 可能是相应 GPT 分区的 GUID。另一方面,UUID 来自文件系统。

如果您将分区格式化为其他文件系统,只要您不修改分区本身,PARTUUID 应该保持不变。我在备用 U 盘上的 Arch Linux 上对其进行了测试:

$ 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"

相关内容