I have an AWS Storage gateway that exposes two iscsi targets. I am attaching them to an EC2 instance running Amazon Linux:
iscsiadm --mode node --targetname gateway.com.amazon:volume1 --portal <ip>,3260 --login
iscsiadm --mode node --targetname gateway.com.amazon:volume2 --portal <ip>,3260 --login
However, this attaches the volumes to /dev/sda and /dev/sdb. The boot volume is at /dev/xvda, and during the boot process the mount of /dev/sda fails and instead mounts the boot volume. If I manually unmount and remount /dev/sda after boot, things are fine:
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 8T 0 disk
└─sda1 8:1 0 8T 0 part /share/volume-a
sdb 8:16 0 8T 0 disk
└─sdb1 8:17 0 8T 0 part /share/volume-b
xvda 202:0 0 8G 0 disk
└─xvda1 202:1 0 8G 0 part /
I've tried labeling the volumes with e2label, and using the labels in /etc/fstab, but that made no difference:
LABEL=volumeA /share/volume-a ext4 defaults,nofail 0 2
LABEL=volumeB /share/volume-b ext4 defaults,nofail 0 2
Is there a way to force the iscsiadm --login to start with a different device, say /dev/sdc?