poor automatic startup description

1,568 views
Skip to first unread message

Arkadiy Kulev

unread,
Oct 17, 2006, 4:01:54 AM10/17/06
to open-...@googlegroups.com
Hello everyone,

the automatic node startup is explained VERY poor and I still can't
understand how to automatically start the node once the iscsid daemon
starts.

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.

any comments?

--
Best regards,
Arkadiy mailto:e...@ethaniel.com

Mike Christie

unread,
Oct 17, 2006, 9:38:58 PM10/17/06
to open-...@googlegroups.com
Arkadiy Kulev wrote:
> Hello everyone,
>
> the automatic node startup is explained VERY poor and I still can't
> understand how to automatically start the node once the iscsid daemon
> starts.
>
> 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.
>

How are you restarting? And what distro are you using?

Arkadiy Kulev

unread,
Oct 18, 2006, 7:29:51 AM10/18/06
to Mike Christie
Hello Mike,

I am on Debian - and I start with /etc/init.d/open-iscsi start.

>


Albert Pauw

unread,
Oct 18, 2006, 10:18:20 AM10/18/06
to open-iscsi
Ah,

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.

Arkadiy Kulev

unread,
Oct 18, 2006, 12:09:33 PM10/18/06
to Albert Pauw
Hello Albert,

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.

Albert Pauw

unread,
Oct 18, 2006, 2:54:35 PM10/18/06
to open-iscsi
I guess the debian script has been unmaintained for quite some time.
Probably best when all three (RedHat/SuSE/Debian) would be contained in
one go.
Somehow that should keep them all in sync and better maintained.

suk...@mail.com

unread,
Nov 1, 2006, 6:01:55 PM11/1/06
to open-iscsi
Ok, but all of this still doesnt answer the question on how to
automatically connect and mount a node.
Anyone willing to explain?

tnx
Patrick

Mike Christie

unread,
Nov 3, 2006, 12:30:44 PM11/3/06
to open-...@googlegroups.com

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.

Albert Pauw

unread,
Nov 3, 2006, 2:20:48 PM11/3/06
to open-iscsi
To clear things up here's the recipe.

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
bit.

When this script starts up, it checks if for every set up target the
parameter node.conn[0].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[0].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[0].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
RedHat/Fedora)

This should give you automatically mounted iscsi disks.

Hope this helps,

Albert

Albert Pauw

unread,
Nov 4, 2006, 2:54:09 AM11/4/06
to open-iscsi
Maybe an idea to put this in a separate README or on the open-iscsi.org
website?
Would be nice to have the three main distributions covered with this
description (RedHat/Fedora,SuSE,Debian).

PCextreme - Updates

unread,
Nov 4, 2006, 12:35:51 PM11/4/06
to open-...@googlegroups.com
I have made a script wich works fine with Debian (Open-iSCSI 1.0-485)

Where can i submit it?

Met vriendelijke groet,

Wido den Hollander
PCextreme technische dienst

Telefoon: 020-5060100
Fax: 020-4470944
E-mail: te...@pcextreme.nl
Internet: http://www.pcextreme.nl

Antwoorden op veel vragen vindt u in onze handleiding op:
http://handleiding.pcextreme.nl/

Mike Christie

unread,
Nov 6, 2006, 6:01:27 PM11/6/06
to open-...@googlegroups.com
Albert Pauw wrote:
> To clear things up here's the recipe.
>
> 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
> bit.
>
> When this script starts up, it checks if for every set up target the
> parameter node.conn[0].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[0].startup -v automatic
>

Just one tiny addition. If you use a port other than the default 3260,
you need to pass in -p/--portal as:

-p ip:port

Reply all
Reply to author
Forward
0 new messages