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" |
Abaixo adicionar ou alterar o label
1 2 3 4 5 6 |
[root@centos ~]# xfs_admin -L disco-do-xfs /dev/mapper/vol--xfs-lv--xfs writing all SBs new label = "disco-do-xfs" [root@centos ~]# blkid | grep vol--xfs-lv--xfs /dev/mapper/vol--xfs-lv--xfs: LABEL="disco-do-xfs" UUID="846f1765-eaa7-42e6-9a1b-3da83df46a65" TYPE="xfs" |
BTRFS
Para alterar o UUID do disco utilizamos o btrfstune para efetuar a alteração e o parâmetro "-u" para gerar automaticamente o UUID, caso queira pode ser utilizado o "-U" e utilizar o uuidgen para gerar um UUID:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
[root@centos ~]# blkid | grep btrfs /dev/mapper/vol--brtfs-lv--brtfs: UUID="e26f5192-f7a8-457d-bbf1-acd9489fc4f0" UUID_SUB="ce9f3114-29a0-48e7-90de-dbf8f0fb2d4e" TYPE="btrfs" [root@centos ~]# btrfs check /dev/mapper/vol--brtfs-lv--brtfs Checking filesystem on /dev/mapper/vol--brtfs-lv--brtfs UUID: e26f5192-f7a8-457d-bbf1-acd9489fc4f0 checking extents checking free space cache checking fs roots checking csums checking root refs found 2866462720 bytes used err is 0 total csum bytes: 2753280 total tree bytes: 46841856 total fs tree bytes: 41418752 total extent tree bytes: 2260992 btree space waste bytes: 6601637 file data blocks allocated: 2819620864 referenced 2819620864 [root@centos ~]# btrfstune -u /dev/mapper/vol--brtfs-lv--brtfs WARNING: it's highly recommended to run 'btrfs check' before this operation WARNING: also canceling running UUID change progress may cause corruption We are going to change UUID, are your sure? [y/N]: y Current fsid: e26f5192-f7a8-457d-bbf1-acd9489fc4f0 New fsid: 31ed4f17-edaf-438a-9012-1ea0e2171034 Set superblock flag CHANGING_FSID Change fsid in extents Change fsid on devices Clear superblock flag CHANGING_FSID Fsid change finished [root@centos ~]# blkid | grep btrfs /dev/mapper/vol--brtfs-lv--brtfs: UUID="31ed4f17-edaf-438a-9012-1ea0e2171034" UUID_SUB="ce9f3114-29a0-48e7-90de-dbf8f0fb2d4e" TYPE="btrfs" |
Abaixo adicionar ou alterar o label
1 2 3 |
[root@centos ~]# btrfs filesystem label /dev/mapper/vol--brtfs-lv--brtfs disco-do-btrfs [root@centos ~]# blkid | grep btrfs /dev/mapper/vol--brtfs-lv--brtfs: LABEL="disco-do-btrfs" UUID="31ed4f17-edaf-438a-9012-1ea0e2171034" UUID_SUB="ce9f3114-29a0-48e7-90de-dbf8f0fb2d4e" TYPE="btrfs" |
E pra ver os discos numa árvore pega essa 8)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
[root@centos ~]# lsblk -o name,mountpoint,label,size,uuid NAME MOUNTPOINT LABEL SIZE UUID sda 30G tqsda1 /boot 500M 12e419c0-1ee2-4dde-8b69-350e64702952 mqsda2 29.5G psy0d3-RjKW-BfCs-lDaZ-oSN7-QMUt-Fq1OtK tqcentos-root / 27.5G d339496b-1e85-4d8e-869e-f0fe8fe22d1e mqcentos-swap [SWAP] 2G b0aed931-e05e-47d8-a233-e8c6baeb21f6 sdb 1G mqsdb1 centos:0 1023M aff178d9-232b-20ac-4ac9-50ef79748552 mqmd0 2G mqmd0p1 2G qnxiwq-oqg2-JvP5-7rub-1rqd-09ob-32EBmw mqvol--ext4-lv--ext4 disco-do-ext4 4G 26b0f173-d7de-46df-915e-4acb1535104a sdc 1G mqsdc1 centos:0 1023M aff178d9-232b-20ac-4ac9-50ef79748552 mqmd0 2G mqmd0p1 2G qnxiwq-oqg2-JvP5-7rub-1rqd-09ob-32EBmw mqvol--ext4-lv--ext4 disco-do-ext4 4G 26b0f173-d7de-46df-915e-4acb1535104a sdd 1G mqsdd1 centos:0 1023M aff178d9-232b-20ac-4ac9-50ef79748552 mqmd0 2G mqmd0p1 2G qnxiwq-oqg2-JvP5-7rub-1rqd-09ob-32EBmw mqvol--ext4-lv--ext4 disco-do-ext4 4G 26b0f173-d7de-46df-915e-4acb1535104a sde 1G mqsde1 centos:0 1023M aff178d9-232b-20ac-4ac9-50ef79748552 mqmd0 2G mqmd0p1 2G qnxiwq-oqg2-JvP5-7rub-1rqd-09ob-32EBmw mqvol--ext4-lv--ext4 disco-do-ext4 4G 26b0f173-d7de-46df-915e-4acb1535104a sdf 1G mqsdf1 centos:1 1023M 7fb908d0-00d6-514f-01c8-ef3312d969c9 mqmd1 1022.4M lk19Mk-0oOr-O7Mu-DukF-5c0H-4b0Q-dvQG6F mqvol--xfs-lv--xfs disco-do-xfs 3G 846f1765-eaa7-42e6-9a1b-3da83df46a65 sdg 1G mqsdg1 centos:1 1023M 7fb908d0-00d6-514f-01c8-ef3312d969c9 mqmd1 1022.4M lk19Mk-0oOr-O7Mu-DukF-5c0H-4b0Q-dvQG6F mqvol--xfs-lv--xfs disco-do-xfs 3G 846f1765-eaa7-42e6-9a1b-3da83df46a65 sdh 1G mqsdh1 centos:2 1023M a5674934-1e34-5131-9d82-66d166b820a3 mqmd2 1022.4M mqmd2p1 1021.4M IKkOAx-H0al-AMp9-YHfI-HIc4-7319-jVf9G9 mqvol--brtfs-lv--brtfs disco-do-btrfs 3G 31ed4f17-edaf-438a-9012-1ea0e2171034 sdi 1G mqsdi1 centos:2 1023M a5674934-1e34-5131-9d82-66d166b820a3 mqmd2 1022.4M mqmd2p1 1021.4M IKkOAx-H0al-AMp9-YHfI-HIc4-7319-jVf9G9 mqvol--brtfs-lv--brtfs disco-do-btrfs 3G 31ed4f17-edaf-438a-9012-1ea0e2171034 sdj 2G mqsdj1 2G oMxfZh-8zR6-p8mh-lJb5-3JXW-Enn3-sRIh8l mqvol--ext4-lv--ext4 disco-do-ext4 4G 26b0f173-d7de-46df-915e-4acb1535104a sdk 2G mqsdk1 2G 4WW0fg-iz9b-t960-nXIe-9o5E-ib2e-mNFH85 mqvol--xfs-lv--xfs disco-do-xfs 3G 846f1765-eaa7-42e6-9a1b-3da83df46a65 sdl 2G mqsdl1 2G JKn22s-qSIq-e1lv-oNwY-fYIk-mvuA-rReQll mqvol--brtfs-lv--brtfs disco-do-btrfs 3G 31ed4f17-edaf-438a-9012-1ea0e2171034 sr0 1024M |