[udev] /dev/disk/by-path link for scsi disks always has host "0", causing conflicts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
The /dev/disk/by-path links to scsi disks are supposed to be of the form "scsi-$
I noticed this while playing around with the lio fake scsi target adapter. Here is the full udev info on a disk created on such an adapter. As you can see, it has been assigned scsi host id 13, so that is what it should be using for the $host digit, rather than zero.
P: /devices/
N: sdg
S: disk/by-
E: DEVLINKS=
E: DEVNAME=/dev/sdg
E: DEVPATH=
E: DEVTYPE=disk
E: ID_BUS=scsi
E: ID_MODEL=FILEIO
E: ID_MODEL_
E: ID_PART_
E: ID_PATH=
E: ID_PATH_
E: ID_REVISION=4.0
E: ID_SCSI=1
E: ID_TYPE=disk
E: ID_VENDOR=LIO-ORG
E: ID_VENDOR_
E: MAJOR=8
E: MINOR=96
E: SUBSYSTEM=block
E: USEC_INITIALIZE
E: nomdmonddf=1
E: nomdmonisw=1
> It appears these numbers are pulled from ID_PATH, and I can't figure out where this variable comes from.
From what used to be /lib/udev/path_id, which is now built into libudev-private for performance reasons. You can do that part manually with:
sudo udevadm test-builtin path_id /sys/block/sr0