-
查看磁盘的UUID
查看需要修改磁盘的格式化类型 TYPE;不同的类型使用的命令不一样方法1: root@ac810:~# blkid /dev/sda2: UUID="4e87d18b-3223-4f9d-aa48-2bd450ad33d0" TYPE="ext4" PARTUUID="337a99de-78d8-4d7d-8f9c-c0ca59b373a8" /dev/sda1: UUID="C095-90BB" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="57b0ee8e-072f-45ee-a93a-bc872b2ba875" 方法2: root@ac810:~# tree /dev/disk/ /dev/disk/ ├── by-id │ ├── ata-FORESEE_128GB_SSD_MHV024Q002234 -> ../../sda │ ├── ata-FORESEE_128GB_SSD_MHV024Q002234-part1 -> ../../sda1 │ ├── ata-FORESEE_128GB_SSD_MHV024Q002234-part2 -> ../../sda2 │ ├── wwn-0x53a5a270241e1253 -> ../../sda │ ├── wwn-0x53a5a270241e1253-part1 -> ../../sda1 │ └── wwn-0x53a5a270241e1253-part2 -> ../../sda2 ├── by-partlabel │ └── EFI\x20System\x20Partition -> ../../sda1 ├── by-partuuid │ ├── 337a99de-78d8-4d7d-8f9c-c0ca59b373a8 -> ../../sda2 │ └── 57b0ee8e-072f-45ee-a93a-bc872b2ba875 -> ../../sda1 ├── by-path │ ├── pci-0000:00:14.0-usb-0:1:1.0-scsi-0:0:0:0 -> ../../sda │ ├── pci-0000:00:14.0-usb-0:1:1.0-scsi-0:0:0:0-part1 -> ../../sda1 │ └── pci-0000:00:14.0-usb-0:1:1.0-scsi-0:0:0:0-part2 -> ../../sda2 └── by-uuid ├── 4e87d18b-3223-4f9d-aa48-2bd450ad33d0 -> ../../sda2 └── C095-90BB -> ../../sda1
-
xfs格式的磁盘UUID修改
root@ac810:~# uuidgen | xargs xfs_admin /dev/sdc1 -U
-
ext2/3/4格式的磁盘UUID修改
root@ac810:~# uuidgen | xargs tune2fs /dev/sda2 -U
-
注意事项不要轻易修改磁盘的UUID,尤其是系统盘的UUID,修改后需要修改对应的grub和fstab,否则系统无法加载起来
文章来源地址https://www.toymoban.com/news/detail-529160.html
文章来源:https://www.toymoban.com/news/detail-529160.html
到了这里,关于Linux磁盘分区UUID查看和修改的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!