KnowingUUIDs
⇤ ← Revision 1 as of 2010-01-03 17:11:21
1678
Comment:
|
2356
|
Deletions are marked like this. | Additions are marked like this. |
Line 3: | Line 3: |
=== Knowing UUID and other IDs of disk partitions === | === Knowing UUID and other IDs of block devices === note: this is not only for disks physical partitions, bul also for multi-disk devices (RAID) and logical volume devices (LVM) |
Line 5: | Line 6: |
* this will list UUID for all known partitions ''(why "blk"?)'' | * this will list UUID for all known block devices |
Line 13: | Line 14: |
(!) must be run with administrative privileges (root or sudo) | (!) this command is part of {{{udev}}} package and must be run with administrative privileges (root or sudo) |
Line 33: | Line 34: |
==== udevinfo ==== /!\ command not found |
==== udevadm ==== (!) this command is part of {{{udev}}} package and must be run with administrative privileges (root or sudo) |
Line 36: | Line 37: |
* full ID list for one device | /!\ this command seems to replace the former {{{udevinfo}}} command * the following command (see the short form below) does list the {{{env}}} part of the {{{udev}}} db content, for one device. Valid queries are: {{{name}}}, {{{symlink}}}, {{{path}}}, {{{env}}}, {{{all}}}. |
Line 38: | Line 40: |
<user>@<host>:~# udevinfo -q env -n /dev/sda1 | <user>@<host>:~# udevadm info --query=env --name=/dev/sda1 |
Line 57: | Line 59: |
* this short form is not documented in {{{udevadm}}} man and has been borrowed from an {{{udevinfo}}} example: {{{ <user>@<host>:~# udevadm info -q env -n /dev/sda1 }}} |
1. Knowing UUID and other IDs of block devices
note: this is not only for disks physical partitions, bul also for multi-disk devices (RAID) and logical volume devices (LVM)
1.1. blkid
- this will list UUID for all known block devices
<user>@<host>:~$ blkid /dev/sda1: LABEL="sda1-boot-2GB" UUID="a596c61a-16b7-4967-890a-38022722b04d" SEC_TYPE="ext2" TYPE="ext3" /dev/sda2: ...
1.2. vol_id
this command is part of udev package and must be run with administrative privileges (root or sudo)
- short ID list for one device
<user>@<host>:~# vol_id /dev/sda1 ID_FS_USAGE=filesystem ID_FS_TYPE=ext3 ID_FS_VERSION=1.0 ID_FS_UUID=a596c61a-16b7-4967-890a-38022722b04d ID_FS_UUID_ENC=a596c61a-16b7-4967-890a-38022722b04d ID_FS_LABEL=sda1-boot-2GB ID_FS_LABEL_ENC=sda1-boot-2GB ID_FS_LABEL_SAFE=sda1-boot-2GB
- this is just the UUID for one device
<user>@<host>:~# vol_id -u /dev/sda1 a596c61a-16b7-4967-890a-38022722b04d
1.3. udevadm
this command is part of udev package and must be run with administrative privileges (root or sudo)
this command seems to replace the former udevinfo command
the following command (see the short form below) does list the env part of the udev db content, for one device. Valid queries are: name, symlink, path, env, all.
<user>@<host>:~# udevadm info --query=env --name=/dev/sda1 ID_VENDOR=ATA ID_MODEL=Hitachi_HDT72503 ID_REVISION=V54O ID_SERIAL=1ATA_Hitachi_HDT725032VLA360_xxx ID_SERIAL_SHORT=ATA_Hitachi_HDT725032VLA360_xxx ID_TYPE=disk ID_BUS=scsi ID_ATA_COMPAT=Hitachi_HDT725032VLA360_xxx ID_PATH=pci-0000:00:05.0-scsi-0:0:0:0 ID_FS_USAGE=filesystem ID_FS_TYPE=ext3 ID_FS_VERSION=1.0 ID_FS_UUID=a596c61a-16b7-4967-890a-38022722b04d ID_FS_UUID_ENC=a596c61a-16b7-4967-890a-38022722b04d ID_FS_LABEL=sda1-boot-2GB ID_FS_LABEL_ENC=sda1-boot-2GB ID_FS_LABEL_SAFE=sda1-boot-2GB
this short form is not documented in udevadm man and has been borrowed from an udevinfo example:
<user>@<host>:~# udevadm info -q env -n /dev/sda1
gangely/Computing/KnowingUUIDs (last edited 2010-01-06 15:01:36 by 31)