* Carlos E. R.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi, I want to find the disk IDs corresponding to a device.
Something similar to "lsblk -n --output UUID /dev/sdb" but for ID, and for the disk, not the partitions.
The way I know is this:
Telcontar:~ # l /dev/disk/by-id | grep -w sdb lrwxrwxrwx 1 root root 9 Nov 7 10:47 ata-ST2000DM001-1CH164_Z1F5J9FQ -> ../../sdb lrwxrwxrwx 1 root root 9 Nov 7 10:47 scsi-1ATA_ST2000DM001-1CH164_Z1F5J9FQ -> ../../sdb lrwxrwxrwx 1 root root 9 Nov 7 10:47 scsi-SATA_ST2000DM001-1CH1_Z1F5J9FQ -> ../../sdb lrwxrwxrwx 1 root root 9 Nov 7 10:47 scsi-SATA_ST2000DM001-1CH_Z1F5J9FQ -> ../../sdb lrwxrwxrwx 1 root root 9 Nov 7 10:47 wwn-0x5000c500792f9269 -> ../../sdb Telcontar:~ #
and then parse the output. I wonder about a command that directly gives the information. maybe blkid, but I don't see how.
- -- Cheers
Carlos E. R. (from 13.1 x86_64 "Bottle" at Telcontar)
You can start with something like: $ hdparm -I /dev/sda | egrep -i 'device.*media|number|wwn' Which, in mycase on this particular system, gives: ATA device, with non-removable media Model Number: WDC WD2002FAEX-007BA0 Serial Number: WD-WMAWPXXXXXXX Logical Unit WWN Device Identifier: 5001xxxxxxxx6708 The various links in the "/dev/disk/by-id/" dir appear to be made from combinations of the above. Do not know of another, more direct way to do it. Hope this helps! --Phil -- Philip Amadeo Saeli psaeli@zorodyne.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org