Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

iscsistart: TargetName not set.

212 views
Skip to first unread message

Fredrik Nilsson

unread,
Aug 19, 2016, 2:30:05 AM8/19/16
to
Hi,

I have installed Debian Jessie (8.5) on an iscsi disk but I am having difficulty booting the system afterwards. (The installation itself went smoothly although a bit slow.)

The Supermicro server I have at my disposal mounts the iscsci target fine via bios/nic firmware and grub loads then up nicely. But the problem starts after grub when the the ip-address has been retrieved via dhcp.

iscsistart then tries to mount the iscsi device but fails with the following line

iscsistart: TargetName not set. Exiting iscsistart

It then drops me into the initramfs shell. From there I have been able to find /etc/iscsi.initrams and /etc/initiatorname.iscsi which seems to contain the correct information to mount the target.

Any additional parameters I add to the kernel command line via grub seems to be ignored.

When I googled this error message I found an old error that was caused by the network not bein available at the time iscsistart was started, but it was several years that particular issue was resolved.

Any help on how I can debug and fix this is much appreciated.

Thanks!

/Fredrik


Christian Seiler

unread,
Aug 19, 2016, 7:40:04 AM8/19/16
to
Hi,

(writing this from my phone, so please pardon my bottom quote)

For reference: I co-maintain open-iscsi in Debian.

Could you provide the contents of the initiatorname.iscsi and iscsi.initramfs files in the initramfs verbatim? (Anonymizing users/passwords is OK of course.)

Also: did you specify the target as a host name or IP address? IIRC only IP addresses work for rootfs on iSCSI. (Not sure though and I am not in front of a computer to check.)

Furthermore: does the initramfs run its own DHCP client? Do you have ip=dhcp (or an equivalent static config) in your kernel command line args? (The installer should set this.)

Regards,
Christian

Fredrik Nilsson

unread,
Aug 19, 2016, 8:20:04 AM8/19/16
to
Hi,

Thanks for your reply.

The contents of initiatornam.iscsi is one line:

GenerateName=yes

iscsi.initramfs has the following contents:

ISCSI_TARGET_NAME="iqn.2004-04.com.qnap:ts-412:iscsi.littlesister.c83a5e"
ISCSI_TARGET_IP="192.168.15.251"
ISCSI_TARGET_PORT="3260"
ISCSI_TARGET_GROUP="1"

I don't use any user authentication in the current setup since I want to minimize things that can go wrong. I also only use ip-addresses when I communicate with the NAS which acts as the iSCSI target.

Looking at the kernel parameters there is no mentioning of any ip settings. I have tried supplying static ip settings, initiatorname and target name as kernel parameters but to me it looked liked those settings where ignored. So based on that I guess that the initramfs in this case runs its own DHCP client and grabs its config from some other place then the kernel parameters.

I have also tried to set the target name via the dhcp root-path option, which is then written out on the console at boot time, but the result is still the same error message and a drop to the initrams shell.

Regards
Fredrik

Christian Seiler

unread,
Aug 19, 2016, 11:30:05 AM8/19/16
to
On 08/19/2016 02:11 PM, Fredrik Nilsson wrote:
> The contents of initiatornam.iscsi is one line:
>
> GenerateName=yes

Ok, there's the problem. The message from iscsistart is misleading,
because not the target name is invalid, but the initiator name.
(Probably because of the way the options are passed, it thinks
that way.)

The reason why that is is actually a bug in open-iscsi, because
while it does copy the proper file into the root filesystem at the
end of the installer, it doesn't re-generate the initramfs, so that
only contains the default file.

This was fixed in Stretch anyway because we now generate the
initiator name on install (in postinst), but not upon first start
of the daemon anymore.

I've now reported this bug, to be able to track it.
https://bugs.debian.org/834830
(I've reproduced the problem in a VM on my system.)

I'll try to get a fix that for into the next point release - no
promises though.

If you want to boot your system in the mean time, there is a trick
you can do, once you're in the initramfs shell:

echo InitiatorName=iqn.test:test > /etc/initiatorname.iscsi
/scripts/local-top/iscsi
exit

That should boot your system. Once you're in the system, you need
to run (as root):

update-initramfs -k all -u

And then your system should boot normally.

> Looking at the kernel parameters there is no mentioning of any ip settings.
> I have tried supplying static ip settings, initiatorname and target name as
> kernel parameters but to me it looked liked those settings where ignored.

Yeah, so I checked again, and setting kernel parameters is actually
not necessary. (And won't change anything.)

> I have also tried to set the target name via the dhcp root-path option,
> which is then written out on the console at boot time, but the result is
> still the same error message and a drop to the initrams shell.

No, that doesn't help at all. In Jessie, open-iscsi is configured via
the files /etc/iscsi/iscsi.initramfs and /etc/iscsi/initiatorname.iscsi,
and there's no way to override things. In Stretch, there will be some
support for root=iscsi:... though. The DHCP parameters are completely
ignored even there though. (I'm not sure it'd be easy to support that
reliably across different types of configurations.)

Regards,
Christian
0 new messages