1

Trying following scsi_id command:-

/lib/udev/scsi_id --verbose --page 0x83 --whitelisted /dev/disk/by-path/ip-10.182.97.58:3260-iscsi-iqn.2018-02.com.dum:target02-lun-3

But command is exiting with following output :-

scsi_id: cannot open /dev/disk/by-path/ip-10.182.97.58:3260-iscsi-iqn.2018-02.com.dum:target02-lun-3: No such device or address

But given device is present:-

ls -ltr /dev/disk/by-path/ip-10.182.97.58:3260-iscsi-iqn.2018-02.com.dum:target02-lun-3

lrwxrwxrwx. 1 root root 9 Feb 8 10:35 /dev/disk/by-path/ip-10.182.97.58:3260-iscsi-iqn.2018-02.com.dum:target02-lun-3 -> ../../sdt

mindalkar
  • 13
  • 6

1 Answers1

1

When the iSCSI transport's connection is yanked out from under the disk, the entry in /dev usually sticks behind. The presence of this file is no guarantee that the device is connected.

Here's a disk that used to be attached to my system. It hasn't been able to reach the iSCSI target in some time, because I'm on a totally different network. The entry in /dev is still there, but any attempt to access the device reports that it's not actually there:

$ ls -lat /dev/sde
brw-rw----. 1 block disk 8, 64 Nov 17 21:57 /dev/sde

$ /lib/udev/scsi_id --verbose /dev/sde
scsi_id: cannot open /dev/sde: No such device or address

$ dd if=/dev/sde of=/dev/null bs=4096 count=1 iflag=direct
dd: failed to open ‘/dev/sde’: No such device or address

If you look at the device state, you'll likely find that it's in transport-offline, like mine:

$ cat /sys/class/block/sde/device/state
transport-offline

As for why the device is offline? Sometimes iscsiadm -m session -P 3 can help, but typically you have to troll through the logs on the system to figure out what happened.

Mike Andrews
  • 3,045
  • 18
  • 28