Matthew Schumacher wrote:
> Hello Group,
> I'm working out the config to boot a host from an iscsi target and have
> everything pretty much working, but once the host is up, I can't connect
> to any other iscsi targets.
> My initrd script calls the following:
> -----------------------------------------------------------------------------
> # bring up iscsi
> /sbin/iscsid
> # connect to the share
> /sbin/iscsiadm -m discovery -t sendtargets -p ${ISCSI_PORTAL}
> /sbin/iscsiadm -m node -T ${ISCSI_TARGET} -p ${ISCSI_PORTAL} -l
> # mount and switch_root
> mount -o ro -t $ROOTFS $ROOTDEV /mnt
> umount /proc
> umount /sys
> exec switch_root /mnt /sbin/init
> -----------------------------------------------------------------------------
> Which correctly brings up the iscsi disk and starts init, but once the
> machine is up I can't discover targets anymore:
> r...@host:~# /sbin/iscsiadm -m node -T mail -p 192.168.x.101:3260 -l
> Logging in to [iface: default, target: mail, portal: 192.168.x.101,3260]
> r...@host:~#
> I suspect that the problem is that iscsid continues to run from the
> initrd image where it stores it's session database which is lost when I
> switch_root.

Yeah, when you run iscsid from the initrd then when you run iscsiadm -m 
discovery ... it will store the db info in the /etc/iscsi/nodes of the 
initrd FS.

> I tried restarting iscsid after boot, but the second I do that I loose
> my disk and my host crashes.

This is what we do in Red Hat. It is a little tricky, because when 
iscsid restarts it relogins into the target to make sure its state is 
all in sync with the kernel and session. So the network has to be up 
first, then restart iscsid. iscsid will then kill the running session 
and relogin. There will be a delay of a couple seconds at this time, but 
it should relogin and then the boot process should proceed.

You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to