the automatic node startup is explained VERY poor and I still can't
understand how to automatically start the node once the iscsid daemon
as far as I understand this is done by iscsi_discovery program - it
tells me that it adds the discovered node to automatic startup, but
this doesn't happen when I restart the iscsid node.
this is _really_ annoying.
How are you restarting? And what distro are you using?
I am on Debian - and I start with /etc/init.d/open-iscsi start.
if I am correct, the start script for Debian hasn't been updated yet
for using this
automatic login. The SuSE and RedHat versions are.
in fact the shutdown script doesn't work good too.
I'm on 2.6.18 debian and when the kernel shuts down (reboot or
shutdown -h) I see a error message
"module is in use and cannot be unloaded" (or something similiar).
And right at the end of the system shutdown process, I see a message
"Synchronizing disk cache to /dev/sdb" and it stops at that point.
Seems like this is a major bug.
Normally, what should happen is that your distro or open-iscsi will have
a init script. This gets installed to /etc/init.d/. When your system
starts up that script gets run and the iscsi connections or sessions you
marked as automatic get logged into. Currently the script for debian is
broken but people are working on fixing it. Maybe debian itself has a
working script integrated in it already - I do not know.
Then your distro will have some way for the disks, on the targets that
were just logged into, to be be mounted at startup. For Fedora/Red Hat,
we use the _netdev in /etc/fstab. Other distros use something else.
As Mike pointed out, open-iscsi has a start/stop script in /etc/init.d,
these are (slightly) different for the different distributions
(RedHat/Fedora, SuSE, Debian) and have been mainained separately for
open-iscsi so far. Of these the Debian one has been lagging behind a
When this script starts up, it checks if for every set up target the
parameter node.conn.startup is set to "automatic", default is
manual. You can set this parameter with iscsiadm:
iscsiadm -m node -T iqn.com.domain:target -p 10.0.0.1 -o update -n
node.conn.startup -v automatic
This is the bit missing from the debian start script.
Next problem will be that the device name of the target (/dev/sdX,
where X=a..z) depends on existing disks (including usb drives) because
it picks the next available scsi diskdrive letter, and therefore
doesn't have to be the same everytime.
This is where the udev service comes in. According to Hannes Reinecke
version 0.95 and above will create a device like
/dev/iscsi/<targetname>/part1 (first partition) or similar. Since the
targetname is known and fixed you can now do a mount:
mount -t ext3 /dev/iscsi/<targetname>/part1 /mnt/mydisk
For versions before that there is a small script which does more or
less the same (within limitations).
Since iscsi works through your ethernet device you have to make sure it
is mounted after the network has been started. This is where the
_netdev stuff comes in (for RedHat/Fedora at least).
Here's an entry from my /etc/fstab, so it is mounted automatically:
/dev/iscsi/<targetname>/part1 /mnt/mydisk ext3
_netdev 0 0
So these are the three steps:
1) Set node.conn.startup to automatic
2) Make sure you have the correct /dev/sdX mapping, of course if this
is always the same device you can use /dev/sdX, but it is less
flexible. udev is the way to go.
3) Edit your fstab accordingly and include the _netdev option (for
This should give you automatically mounted iscsi disks.
Hope this helps,
Where can i submit it?
Met vriendelijke groet,
Wido den Hollander
PCextreme technische dienst
Antwoorden op veel vragen vindt u in onze handleiding op:
Just one tiny addition. If you use a port other than the default 3260,
you need to pass in -p/--portal as: