3

I've got some iSCSI/FC storage, currently using only iSCSI. I have in general no problems with mounting LUNs - under Linux and under Windows.

Unfortunately - when I add LUN for my Linux iSCSI initiator - I receive info in messages:

Warning! Received an indication that the LUN assignments on this target have changed. The Linux SCSI layer does not automatically remap LUN assignments

and new LUN does not appear in

fdisk -l

If I restart iscsi daemon - I get new LUN but loose connection with mounted old LUNs, moreover - devices letters (dev/sd..) are changing.

On Windows - new LUN is visible at once and can be mounted with no affecting previous ones.

Is there special option in

iscsiadm

(I tried such as "rescan" but with no success)?

Arek B.
  • 327

2 Answers2

6

If you're adding a new LUN, and your iscsi initiator is already connected, you just have to rescan your iscsi bus for the new LUN:

for i in /sys/class/scsi_host/host*/scan ; do echo - - - > $i ; done

If you're changing the size / geometry of a LUN, you'll also need to rescan the device:

for i in /sys/class/scsi_device/*/device/rescan ; do echo 1 > $i ; done

That works for me. If it does not for you, you can try to rescan the iscsi session:

iscsiadm -m node -R

You should really use UUIDs or WWIDs (when working with multipath) so that you don't have to rely on device names.

Daniel S. Sterling
  • 1,584
  • 2
  • 11
  • 13
Craig
  • 590
0

Are you trying to make a connection to a new LUN without restarting open-iscsi? If so, you can do

iscsiadm -m discovery -t st -p <portal_IP>

which will find the new LUNs. Then to log into the LUN

iscsiadm -m node -T <LUN_Name> -l

Is that what you want to do?

edit: Also, if you are having a problem with drive letters changing on your targets, you should look into using label so you could do something like

mount -t xfs -l backups /mnt/backups

and it won't matter if the device path changes.

Kendall
  • 68
Kendall
  • 1,063