WWN discrepancie?

Hello all,

I have a question about the WWN naming reported by /dev/disk/by-id, for example:

mercury:~ # ls -la /dev/disk/by-id/
total 0
drwxr-xr-x 2 root root 260 out 4 10:33 .
drwxr-xr-x 6 root root 120 out 4 10:31 …
lrwxrwxrwx 1 root root 9 out 4 10:31 ata-QEMU_DVD-ROM_QM00001 → …/…/sr0
lrwxrwxrwx 1 root root 9 out 4 10:31 scsi-0QEMU_QEMU_DVD-ROM_QM00001 → …/…/sr0
lrwxrwxrwx 1 root root 9 out 4 10:31 scsi-1ATA_QEMU_DVD-ROM_QM00001 → …/…/sr0
lrwxrwxrwx 1 root root 9 out 4 10:33 scsi-1LIO-ORGsbd:41b031be-0322-44c6-8314-eef8787f954f → …/…/sda
lrwxrwxrwx 1 root root 9 out 4 10:33 scsi-1LIO-ORGshared1:5ae9bb02-73e3-4af8-93d1-6893005657b1 → …/…/sdb

lrwxrwxrwx 1 root root 9 out 4 10:33 scsi-3600140541b031be032244c68314eef87 → …/…/sda
lrwxrwxrwx 1 root root 9 out 4 10:33 scsi-360014055ae9bb0273e34af893d168930 → …/…/sdb
lrwxrwxrwx 1 root root 9 out 4 10:33 scsi-SLIO-ORG_sbd_41b031be-0322-44c6-8314-eef8787f954f → …/…/sda
lrwxrwxrwx 1 root root 9 out 4 10:33 scsi-SLIO-ORG_shared1_5ae9bb02-73e3-4af8-93d1-6893005657b1 → …/…/sdb

lrwxrwxrwx 1 root root 9 out 4 10:33 wwn-0x600140541b031be032244c68314eef87 → …/…/sda
lrwxrwxrwx 1 root root 9 out 4 10:33 wwn-0x60014055ae9bb0273e34af893d168930 → …/…/sdb

the bold entries are the “correct” ones (the ones that mach the WWN as reported by targetcli - a redhat machine)

the result of this commands are the ‘culprit’:

mercury:~ # /lib/udev/scsi_id --page=0x83 --whitelisted --device=/dev/sda
3600140541b031be032244c68314eef87

mercury:~ # /lib/udev/scsi_id --page=0x80 --whitelisted --device=/dev/sda
SLIO-ORG sbd 41b031be-0322-44c6-8314-eef8787f954f

shouldn’t the numbers be the same? because forming a ’ wwn-0x60014055ae9bb0273e34af893d168930’ can lead to a wrong conclusion, in this case the WWN is

/backstores/block/sbd> ls │··············································
o- sbd … [/dev/cluster_lab/sbd (8.0MiB) write-thru activated]│·············································· o- alua … [ALUA Groups: 1]│··············································
o- default_tg_pt_gp … [ALUA state: Active/optimized]│··············································/backstores/block/sbd> info │··············································
dev: /dev/cluster_lab/sbd │··············································name: sbd │··············································
plugin: block │··············································readonly: False │··············································
write_back: False │··············································
wwn: 41b031be-0322-44c6-8314-eef8787f954f │··············································
/backstores/block/sbd>

as reported in the iscsi target machine.

Can someone explain this? Also, just for 2 LUN’s I get 8 entries:

lrwxrwxrwx 1 root root 9 out 4 10:33 scsi-1LIO-ORGsbd:41b031be-0322-44c6-8314-eef8787f954f → …/…/sda
lrwxrwxrwx 1 root root 9 out 4 10:33 scsi-1LIO-ORGshared1:5ae9bb02-73e3-4af8-93d1-6893005657b1 → …/…/sdb

lrwxrwxrwx 1 root root 9 out 4 10:33 scsi-3600140541b031be032244c68314eef87 → …/…/sda
lrwxrwxrwx 1 root root 9 out 4 10:33 scsi-360014055ae9bb0273e34af893d168930 → …/…/sdb
lrwxrwxrwx 1 root root 9 out 4 10:33 scsi-SLIO-ORG_sbd_41b031be-0322-44c6-8314-eef8787f954f → …/…/sda
lrwxrwxrwx 1 root root 9 out 4 10:33 scsi-SLIO-ORG_shared1_5ae9bb02-73e3-4af8-93d1-6893005657b1 → …/…/sdb

lrwxrwxrwx 1 root root 9 out 4 10:33 wwn-0x600140541b031be032244c68314eef87 → …/…/sda
lrwxrwxrwx 1 root root 9 out 4 10:33 wwn-0x60014055ae9bb0273e34af893d168930 → …/…/sdb

shouldn’t it be 4 at best? the man page for scsi_id states that it shoud try to fetch only the type 0x80 OR 0x83, not both.

Help? :slight_smile:

Thank you.

Hi rfragoso,

the WWN naming reported by /dev/disk/by-id

I’ve never been looking at /dev/disk/by-id that way - to me it’s what udev rules consider to be plausible unique names for a device - and looking at the rules you will see that various symlinks are created, depending on the device and available info.

[scsi_id page 0x80 and page 0x83] shouldn’t the numbers be the same?

I don’t know - what has the SCSI standard to say on this?

Also, just for 2 LUN’s I get 8 entries […] shouldn’t it be 4 at best? the man page for scsi_id states that it shoud try to fetch only the type 0x80 OR 0x83, not both.

as it is about what udev considers to be required symlinks, it’d be best if you take a look at the udev rules and how (and under which conditions) symlinks are created.

Regards,
J