Linux – Alterar o UUID e Label do disco
EXT4 Para alterar o UUID do disco utilizamos o tune2fs para efetuar a alteração e o uuidgen para gerar um UUID:
1 2 3 4 5 6 7 8 |
[root@centos ~]# blkid | grep ext4 /dev/mapper/vol--ext4-lv--ext4: UUID="dabdd9a3-2436-48e2-a772-2ad7eee42de0" TYPE="ext4" [root@centos ~]# tune2fs /dev/mapper/vol--ext4-lv--ext4 -U $(uuidgen) tune2fs 1.42.9 (28-Dec-2013) [root@centos ~]# blkid | grep ext4 /dev/mapper/vol--ext4-lv--ext4: UUID="26b0f173-d7de-46df-915e-4acb1535104a" TYPE="ext4" |
Abaixo adicionar ou alterar o label
1 2 3 4 |
[root@centos ~]# e2label /dev/mapper/vol--ext4-lv--ext4 disco-do-ext4 [root@centos ~]# blkid | grep ext4 /dev/mapper/vol--ext4-lv--ext4: LABEL="disco-do-ext4" UUID="26b0f173-d7de-46df-915e-4acb1535104a" TYPE="ext4" |
XFS Para alterar o UUID do disco utilizamos o xfs_admin para efetuar a alteração e o uuidgen para gerar um UUID:
1 2 3 4 5 6 7 8 9 10 |
[root@centos ~]# blkid | grep vol--xfs-lv--xfs /dev/mapper/vol--xfs-lv--xfs: UUID="b070f40f-bade-4558-b017-14870dd222bc" TYPE="xfs" [root@centos ~]# xfs_admin -U $(uuidgen) /dev/mapper/vol--xfs-lv--xfs Clearing log and setting UUID writing all SBs new UUID = 846f1765-eaa7-42e6-9a1b-3da83df46a65 [root@centos ~]# blkid | grep vol--xfs-lv--xfs /dev/mapper/vol--xfs-lv--xfs: UUID="846f1765-eaa7-42e6-9a1b-3da83df46a65" TYPE="xfs" |
…
Continue reading →