2

如何更改分区的UUDI

 3 years ago
source link: https://www.lujun9972.win/blog/2018/12/31/%E5%A6%82%E4%BD%95%E6%9B%B4%E6%94%B9%E5%88%86%E5%8C%BA%E7%9A%84uudi/index.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

如何更改分区的UUDI

当用 dd 命令进行分区对拷时,两个分区就有了相同的UUID,这种情况下就有必要手工修改分区的UUID了。

查看分区的UUID

使用 blkid 能够查看分区的UUID

blkid
/dev/sda1: UUID="f1060c0a-bd02-4547-98d4-af3e1685e513" TYPE="swap" PARTUUID="18b918b8-01"
/dev/sda2: UUID="a3e3ff49-bb3d-4610-a898-c623d9ff4b2b" TYPE="ext4" PARTUUID="18b918b8-02"
/dev/sda3: UUID="aef39bc8-c88d-46bd-b600-34d267486fa7" TYPE="ext4" PARTUUID="18b918b8-03"

手工修改分区UUID

使用tune2fs能够修改分区的UUID:

# 1. 卸载要修改UUID的分区
umount /dev/sda3
# 2. 设置UUID
tune2fs -U ${UUID} /dev/sdb1

其中 UUID 可以是一串由分号分割的十六进制数字,或者下面几个关键字:

clear清空文件系统中的UUID random随机生成一个UUID time根据时间生成一个UUID


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK