Como descobrir (listar) o UUID e LABEL de todas as partições?
Link: https://bistrunka.net/2012/09/22/como-descobrir-listar-o-uuid-e-label-de-todas-as-particoes/
( How to find out (list) the UUID and LABEL all the partitions? )
Para listar o código UUID (universally unique identifier) e LABEL (rótulo/nome) de todas as partições de todos os discos do computador com um único comando basta utilizar, como root, o comando blkid:
sudo blkid
Olhe a saída no meu computador:
zumm@destino:~$ sudo blkid
/dev/sda1: LABEL=”Ubuntu-12.10″ UUID=”98e6d91d-9b8b-46e5-8429-e492044cbbd5″ TYPE=”ext4″
/dev/sda2: LABEL=”Vídeos” UUID=”457fce87-b36d-4364-971a-afaa11e39357″ TYPE=”ext4″
/dev/sda3: LABEL=”Backup” UUID=”ae9f9aeb-ae10-4e70-b680-396e0dd1c320″ TYPE=”ext4″
/dev/sda5: UUID=”c526a707-a8bb-431a-a2ea-398bb59f8146″ TYPE=”swap”
/dev/sda6: LABEL=”AMD64″ UUID=”a1d9c813-b4e7-4331-b4eb-6a08e44938e8″ TYPE=”ext4″
/dev/sda7: LABEL=”Gentoo” UUID=”9daf9b72-ec06-4175-b484-01ff1add6a37″ TYPE=”ext4″
/dev/sda8: LABEL=”Mint” UUID=”417d751e-faf9-4abc-ac43-271d47c973c6″ TYPE=”ext4″
/dev/sdb1: LABEL=”Ubuntu-11.04″ UUID=”0a3b9f72-bbd6-4e7f-bf11-6ef2043cf973″ TYPE=”ext4″
/dev/sdb2: LABEL=”Dados” UUID=”9100787c-03bf-4e22-8080-bd9a586fa2fe” TYPE=”ext3″
/dev/sdb3: LABEL=”Músicas” UUID=”4d759fd5-5ab2-4b92-b6b6-c015507672ce” TYPE=”ext3″
/dev/sdb4: UUID=”bdf9c723-c739-4e53-8810-a4e98c9ea8f5″ TYPE=”swap”
/dev/sdc1: LABEL=”Debian” UUID=”09aefbca-ddea-4068-be78-380fd959c658″ TYPE=”ext4″
/dev/sdc2: LABEL=”Arch” UUID=”1e2b868a-c634-4f3b-81b6-0e22e33552b3″ TYPE=”ext4″
/dev/sdc5: UUID=”d6609dbc-1720-4e3d-b316-730fcd87d6b4″ TYPE=”swap”
/dev/sdc6: LABEL=”Music” UUID=”414d9df7-1cdd-47e5-bda3-523b0a1f0a53″ TYPE=”ext4″
/dev/sdc7: LABEL=”Video” UUID=”356f8f81-8569-46ef-9fbe-fd8837bb6538″ TYPE=”ext4″
Outros comandos:
Para listar o UUID:
zumm@destino:~$ ls -l /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 10 2012-09-21 20:06 0a3b9f72-bbd6-4e7f-bf11-6ef2043cf973 -> ../../sdb1
lrwxrwxrwx 1 root root 10 2012-09-21 20:05 417d751e-faf9-4abc-ac43-271d47c973c6 -> ../../sda8
lrwxrwxrwx 1 root root 10 2012-09-21 20:06 457fce87-b36d-4364-971a-afaa11e39357 -> ../../sda2
lrwxrwxrwx 1 root root 10 2012-09-21 20:06 4d759fd5-5ab2-4b92-b6b6-c015507672ce -> ../../sdb3
lrwxrwxrwx 1 root root 10 2012-09-21 20:06 9100787c-03bf-4e22-8080-bd9a586fa2fe -> ../../sdb2
lrwxrwxrwx 1 root root 10 2012-09-21 20:05 98e6d91d-9b8b-46e5-8429-e492044cbbd5 -> ../../sda1
lrwxrwxrwx 1 root root 10 2012-09-21 20:05 9daf9b72-ec06-4175-b484-01ff1add6a37 -> ../../sda7
lrwxrwxrwx 1 root root 10 2012-09-21 20:05 a1d9c813-b4e7-4331-b4eb-6a08e44938e8 -> ../../sda6
lrwxrwxrwx 1 root root 10 2012-09-21 20:06 ae9f9aeb-ae10-4e70-b680-396e0dd1c320 -> ../../sda3
lrwxrwxrwx 1 root root 10 2012-09-21 20:05 bdf9c723-c739-4e53-8810-a4e98c9ea8f5 -> ../../sdb4
lrwxrwxrwx 1 root root 10 2012-09-21 20:05 c526a707-a8bb-431a-a2ea-398bb59f8146 -> ../../sda5
Para listar o LABEL:
zumm@destino:~$ ls -l /dev/disk/by-label
total 0
drwxr-xr-x 2 root root 220 2012-09-22 16:37 .
drwxr-xr-x 6 root root 120 2012-09-21 20:05 ..
lrwxrwxrwx 1 root root 10 2012-09-21 20:05 AMD64 -> ../../sda6
lrwxrwxrwx 1 root root 10 2012-09-21 20:06 Backup -> ../../sda3
lrwxrwxrwx 1 root root 10 2012-09-21 20:06 Dados -> ../../sdb2
lrwxrwxrwx 1 root root 10 2012-09-21 20:05 Livre -> ../../sda7
lrwxrwxrwx 1 root root 10 2012-09-21 20:05 Mint -> ../../sda8
lrwxrwxrwx 1 root root 10 2012-09-21 20:06 Músicas -> ../../sdb3
lrwxrwxrwx 1 root root 10 2012-09-21 20:06 Ubuntu-11.04 -> ../../sdb1
lrwxrwxrwx 1 root root 10 2012-09-21 20:05 Ubuntu-12.10 -> ../../sda1
lrwxrwxrwx 1 root root 10 2012-09-21 20:06 Vídeos -> ../../sda2
Listando os UUID’s de apenas um disco:
zumm@destino:~$ blkid /dev/sda[1-9]
/dev/sda1: LABEL=”Ubuntu-12.10″ UUID=”98e6d91d-9b8b-46e5-8429-e492044cbbd5″ TYPE=”ext4″
/dev/sda2: LABEL=”Vídeos” UUID=”457fce87-b36d-4364-971a-afaa11e39357″ TYPE=”ext4″
/dev/sda3: LABEL=”Backup” UUID=”ae9f9aeb-ae10-4e70-b680-396e0dd1c320″ TYPE=”ext4″
/dev/sda5: UUID=”c526a707-a8bb-431a-a2ea-398bb59f8146″ TYPE=”swap”
/dev/sda6: LABEL=”AMD64″ UUID=”a1d9c813-b4e7-4331-b4eb-6a08e44938e8″ TYPE=”ext4″
/dev/sda7: LABEL=”Gentoo” UUID=”9daf9b72-ec06-4175-b484-01ff1add6a37″ TYPE=”ext4″
/dev/sda8: LABEL=”Mint” UUID=”417d751e-faf9-4abc-ac43-271d47c973c6″ TYPE=”ext4″
Listando organizado por colunas
zumm@destino:~$ sudo blkid -o list -c /dev/null
Obtendo todas as informações de uma partição com o TUNE2FS
zumm@destino:~$ sudo tune2fs /dev/sda2
tune2fs 1.41.14 (22-Dec-2010)
Filesystem volume name: Vídeos
Last mounted on: /media/Vídeos
Filesystem UUID: 457fce87-b36d-4364-971a-afaa11e39357
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags: signed_directory_hash
Default mount options: (none)
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 59375616
Block count: 237497855
Reserved block count: 11874892
Free blocks: 175586011
Free inodes: 59374910
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 967
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8192
Inode blocks per group: 512
RAID stride: 32750
Flex block group size: 16
Filesystem created: Tue Nov 1 00:13:51 2011
Last mount time: Fri Sep 21 20:06:02 2012
Last write time: Fri Sep 21 20:06:02 2012
Mount count: 16
Maximum mount count: 32
Last checked: Mon Sep 17 08:18:46 2012
Check interval: 15552000 (6 months)
Next check after: Sat Mar 16 08:18:46 2013
Lifetime writes: 251 GB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 28
Desired extra isize: 28
Journal inode: 8
Default directory hash: half_md4
Directory Hash Seed: d714b716-999e-4eb1-b4b8-a27ae6964d3b
Journal backup: inode blocks
zumm@destino:~$
Já dá para brincar um pouquinho.
No Comments