How to check which local device is assigned to which iscsi disk in linux

root's picture

By listing linked devices in /dev:

root@pluto:~# ls -la /dev/disk/by-path/*iscsi*
lrwxrwxrwx 1 root root  9 Dec  6 14:13 /dev/disk/by-path/ip-9.6.9.3:3260-iscsi-iqn.2014-07.ro.gz.sun:backups-btrfs-lun-0 -> ../../sdb
lrwxrwxrwx 1 root root  9 Dec  6 14:39 /dev/disk/by-path/ip-9.6.9.3:3260-iscsi-iqn.2014-07.ro.gz.sun:pluto-lun-0 -> ../../sdd
lrwxrwxrwx 1 root root  9 Dec  6 14:13 /dev/disk/by-path/ip-9.6.9.4:3260-iscsi-iqn.2014-07.ro.gz.ogle:backups-btrfs-lun-0 -> ../../sdc
lrwxrwxrwx 1 root root  9 Dec  6 14:22 /dev/disk/by-path/ip-9.6.9.4:3260-iscsi-iqn.2014-07.ro.gz.ogle:pluto-lun-0 -> ../../sde
lrwxrwxrwx 1 root root 10 Dec  6 14:32 /dev/disk/by-path/ip-9.6.9.4:3260-iscsi-iqn.2014-07.ro.gz.ogle:pluto-lun-0-part1 -> ../../sde1

Thou shalt not steal!

If you want to use this information on your own website, please remember: by doing copy/paste entirely it is always stealing and you should be ashamed of yourself! Have at least the decency to create your own text and comments and run the commands on your own servers and provide your output, not what I did!

Or at least link back to this website.

Recent content