Last few days I was working on Oracle cloning possibility using storage snapshots (post will be blogged soon) and I hit a ISCSI issue at the very beginning.
I have been playing with restarting storage and Linux box and from time to time ISCSI disk has been mapped to different block devices (/dev/sdb1 instead of /dev/sdc1). I really need to keep this persistent and I found this instruction for RedHat Linux (so it should work for OEL and CentOS).
I have been playing with restarting storage and Linux box and from time to time ISCSI disk has been mapped to different block devices (/dev/sdb1 instead of /dev/sdc1). I really need to keep this persistent and I found this instruction for RedHat Linux (so it should work for OEL and CentOS).
Additionally I was looking for possibility to check how IQN shared on storage is mapped to Linux block devices. There is a nice directory layout where you can check that.
Here is output from my configuration
regards,
Marcin
[root@piorovm by-path]# pwd /dev/disk/by-path [root@piorovm by-path]# ls -l total 0 lrwxrwxrwx 1 root root 9 May 11 13:01 ip-10.10.20.241:3260-iscsi-iqn.1986-03.com.sun:02:6fe1e73d-8d7a-6ee7-8446-db844ae0d0c7-lun-0 -> ../../sdc lrwxrwxrwx 1 root root 10 May 11 13:01 ip-10.10.20.241:3260-iscsi-iqn.1986-03.com.sun:02:6fe1e73d-8d7a-6ee7-8446-db844ae0d0c7-lun-0-part1 -> ../../sdc1 lrwxrwxrwx 1 root root 9 May 11 13:01 ip-10.10.20.241:3260-iscsi-iqn.1986-03.com.sun:02:f6746dbb-c95f-e2dc-8bb6-c82d3ef5169a-lun-0 -> ../../sdb lrwxrwxrwx 1 root root 10 May 11 13:01 ip-10.10.20.241:3260-iscsi-iqn.1986-03.com.sun:02:f6746dbb-c95f-e2dc-8bb6-c82d3ef5169a-lun-0-part1 -> ../../sdb1 lrwxrwxrwx 1 root root 9 May 11 13:00 pci-0000:00:07.1-ide-0:0 -> ../../hda lrwxrwxrwx 1 root root 10 May 11 13:00 pci-0000:00:07.1-ide-0:0-part1 -> ../../hda1 lrwxrwxrwx 1 root root 10 May 11 13:00 pci-0000:00:07.1-ide-0:0-part2 -> ../../hda2 lrwxrwxrwx 1 root root 9 May 11 13:00 pci-0000:00:07.1-ide-1:0 -> ../../hdc lrwxrwxrwx 1 root root 9 May 11 13:00 pci-0000:00:10.0-scsi-0:0:0:0 -> ../../sda lrwxrwxrwx 1 root root 10 May 11 13:00 pci-0000:00:10.0-scsi-0:0:0:0-part1 -> ../../sda1 [root@piorovm by-path]#When you know which IQN is pointed to which block devices we can use mentioned RedHat instruction with some additional remarks.
Here is output from my configuration
- Check WWID for block devices
- Go to
[root@piorovm ~]# cd /etc/udev/rules.d/
and create a file called 20-names.rules Replace my WWID with results from scsi_id command and put correct names[root@piorovm rules.d]# cat 20-name.rules KERNEL=="sd*", BUS=="scsi", PROGRAM="/sbin/scsi_id -g -s", RESULT=="3600144f04be7ffdf00000c2936224200", NAME="sdc" KERNEL=="sd*", BUS=="scsi", PROGRAM="/sbin/scsi_id -g -s", RESULT=="3600144f04be80ec000000c2936224200", NAME="sdb"
Here is a change with RedHat doc – use double equal mark "==" instead of one equal mark "=" for compare (KERNEL, BUS,RESULT).
- Save file and start
[root@piorovm ~]# start_udev Starting udev: [ OK ] [root@piorovm ~]#
[root@piorovm ~]# scsi_id -g -s /block/sdb 3600144f04be80ec000000c2936224200 [root@piorovm ~]# scsi_id -g -s /block/sdc 3600144f04be7ffdf00000c2936224200
regards,
Marcin

