I have some questions on setting up iscsi boot with opensuse 11.1. Of course, I could find out many of the answers by trying but if anyone knows the answers already, then it would save me a lot of time.

I already checked the wiki Open-iSCSI and SUSE Linux - openSUSE but that contains only information on automatically mounting iscsi volumes through fstab but that approach, as understand from other investigations I did, only works after the root filesystem has been mounted. In particular, the hotplug option there indicates to fstab that networking should be up before the volume is mounted. Also, the advice given there to mount a disk by uuid is not that relevant to me since I will be using LVM so I can user logical, hardware independent, device names in fstab.

What I am looking for is booting from iSCSI. That would involve starting up a network interface even before the root volume is mounted. In mkinitrd, there appears to be support for this already. In particular:

  • Kernel option: ip=<ipspec>, explictly configuring a network interface using static configuration (preferred)
  • -D interface: Use DHCP to configure the interface
  • -I interface: statically configure the interface
  • -f iscsi: To enable the iscsi feature. I am assuming this must always be passed to mkinitrd if I want to boot from iscsi

In addition there is the option to configure the iSCI initiator name which is straightforward.

I now have the following question:

  • If I configure the interface statically then do I need to use both -I interface and ip=<ipspec> or is using the latter option sufficient?
  • How do I find out the interface name? Is this alway ethN or can I use some explicit indication based on a hardware id (Mac address). In particular, I will be using this booting approach on a system with multiple interface cards.
  • If a network interface is configured through mkinitrd then do I explicitly need to exclude it from being managed by /etc/init.d/network?


it is possible to boot totally diskless, although you will have to boot from some kind of medium tftp (pxe) to go totally diskless for example ?

Leaving some custom scripts, initrd, kernel images on your tftp server bam you are ready to go.

This link here goes into more detail :


I already know various ways to boot up the system: hard disk boot sector, CD ROM, and PXE are all options. In fact I am considering to use CD ROM boot for the final solution. Right now, I am using xen to boot up a guest domain because that approach saves me a lot of reboots.

In the mean time I have made some progress. I am able to get the iscsi disk mounted by the initrd script. For this I need to specify both TargetName and TargetAddress. Also, I have modified that script to create the directory /etc/iscsi if it does not exist because otherwise the creation of /etc/iscsi/initiatorname.iscsi fails. Also the instruction

/sbin/iscsiadm -m node -L onboot

had to be replaced by an explicit login to the iscsi target.

I am using dhcp to setup the network interface and have configure the network interface as ‘On NFS Boot’ to make sure the /etc/init.d/network does not prematurely shut down the network interface at shutdown.

So now I have a system that boots up, still has local root file system and sets up an iscsi volume at boot. The last step is now to put the root filesystem on the iscsi target and boot from there.

So, almost there, and by all means not that trivial.



I have now progressed onto the stage that it seems to be booting from iscsi, but it hangs immediately after it has mounted the ext3 filesystem.

Apparently, something is wrong but if the debug output is going to be put into /var/log/boot.msg after the root file system is mounted and there is some error at mounting of the root file system then there is no way to see the debug output. Is there any way to make sure that all debug output of initrd (generated because of the kernel linuxrc=trace option) goes straight to the console?



I finally solved the problem. I was using a xen guest for my experiments with at first a local boot with iscsi mount of the future root partition using an iscsi initiator during the initial stage before init. After that, I switched the xen configuration to boot the guest OS from the initiator, ignoring the local root file system on the machine.

That resulted in a hang, but then specifying the extra option console=xvc0 resulted in all debug output being shown. Apparently, the script was also being run for some reason basically doing the same that was already done before (e.g. starting iscsid) and that caused the problem. Finally, disabling the script in the runlevel editor solved the problem.

Therefore, I know now how to do an iscsi root boot with opensuse 11.1. The steps are as follows:
[li] Network card config[/li] [list]
[li] General properties: Activate Device On NFS Root[/li] This prevents the network device from being disabled too
soon at shutdown.
[li] Addressing: select ‘No IP Address’ to avoid a second setup[/li] of the IP address (it was already setup before)
[li] Disable to avoid a hang at boot. [/li][li] In /lib/mkinitrd/scripts/ create the [/li] /etc/iscsi directory before the initiatorname.iscsi is being
written there

 if [[ ! -d /etc/iscsi ]]
   mkdir /etc/iscsi
 echo "InitiatorName=$InitiatorName" &gt;     /etc/iscsi/initiatorname.iscsi

[li] In the same script modify the last lines to explicitly [/li]activate the selected iscsi target.

Activate all ‘onboot’ sessions

#/sbin/iscsiadm -m node -L onboot
/sbin/iscsiadm -m node -l -p $TargetAddress:$TargetPort -T $TargetName

[li] Create the initrd file using [/li]

mkinitrd -f “kpartx network iscsi lvm2” -D eth0 -d /dev/guest/root

Note that this is a dhcp setup of the network interface. I will also have a look at static
Note: kpartx might not be needed, must check this.
[li] Make sure to use the following kernel boot params[/li]

linuxrc=trace sysrq=9 debug loglevel=7
root_lvm2=1 root=/dev/guest/root TargetAddress= TargetName=iqn.2001-04.lan.hawk InitiatorName=iqn.1996-04.lan.opensuse11b:test

Note: linuxrc, sysrq, debug, loglevel are debug options.
root_lvm2 activates logical volume management (which I need because root is on a logical volume). The last three parameters describe the iscsi address.


Just for completeness.
Fixed IP setup is exactly as described in the mkinitrd man page.

Replace ‘-D eth0’ by ‘-I eth0’ and specify the ip kernel parameter, e.g.


Also, the kpartx feature of mkinitrd is not required.

can this setup is done from YaST2?i need to setup it for some other purpose.i have read