什么是PARTUUID?

Modified on: Sat, 09 Jun 2018 08:38:23 +0800

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

但是在blkid/etc/fstab中的Ubuntu 15.04中,还有PARTUUID这样的

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

它的用途是什么?

作者:muru,Pilot6

最佳答案

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

如果您将分区格式化为其他文件系统,则PARTUUID应保持不变,只要您不修改分区本身即可。我在备用笔式驱动器上在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"
作者:,muru

相关问答

添加新评论