This document explains how to install and boot Linux on an iSCSI target LU using opensource
linux-iSCSI initiator.
The example shows how to perform this process for SUSE* Linux Enterprise Server 9-SP3.
The Red Hat* Enterprise Linux 4 process can be found here.
This is the recommended method for creating the driver disk.
![]() |
NOTES: Configure the initiatorname.iscsi and
iscsi.conf files according to your Target configuration. To do so you
will need to read the README provided by the linux-iscsi source code.
You must at least configure the DiscoveryAddress in the iscsi.conf. If your target supports advanced features such as CHAP, you will need to make sure that the iscsi.conf and initiatorname.iscsi match your target configuration at this point. These files will be used throughout the install and boot process. Alternatively you may create the driver disk using a different host machine other than SUSE Linux Enterprise Server 9-SP3. You will need to compile the iscsi.ko and iscsid using the 2.6.5-7.244-default kernel. You can learn to do this by reading the README provided with the linux-iscsi source code, which is available on the Internet. |
![]() |
NOTE: You need an Intel® iSCSI Boot capable adapter to connect to your target and boot the OS from the iSCSI Target Disk. |
netsetup=1
Ctrl-Alt-F4 will display something along the lines of
"iSCSI target bus 0 target 0 = iqn.XYZ"
"Attached scsi disk ..."
Example: INITRD_MODULES="... e1000 iscsi".
Add to line 1197 (after the "elif test -x $root_dir/sbin/iscsid $tmp_mnt/sbin/iscsid")
cp -fp $root_dir/etc/iscsi.conf $root_dir/etc/initiatorname.iscsi $tmp_mnt/etc/
Add the following to line 1830 (before the line "if has_module iscsi ; then")
echo "iscsi_boot=1" >> $linuxrc
Revise the "if has_module iscsi ; then" statement at line 1899. It should look like this:
if has_module iscsi ; then
cat_linuxrc <<-'EOF'
| echo "Starting iSCSI"
| iscsid
| usleep 5000000
|
| # clear dhcp_mode so it looks like we're disk booted...
| dhcp_mode=
EOF
fi
test "$a" = ethX && continue;
immediately after line number 169 where ethX is the ethernet interface
used for iSCSI communication.
NOTE: After the system has booted iscsid
will be running. The user may want to add something like "kill `pidof
iscsid`" to an init script. iscsid is only needed for discovery and
can be killed in this way without problems.
This process has three phases. First, before installation, you will need to create a DUD (Driver Update Disk). This disk will be used during the install process. Second, you will need to install Red Hat Enterprise Linux 4 U3 on the iSCSI Target using the normal installation process, but with some extra steps inserted. Third you will need to modify the initrd.img file created by the installation process. Once each of these phases has been completed the user will be able to boot from the newly installed Red Hat Enterprise Linux 4 U3 iSCSI Target.
![]() |
NOTE: The system used to connect to the iSCSI target durring the install process must not have any local disks installed. It should also not have any USB storage devices attached when the install starts. The intention is to get anaconda (the Red Hat installer) to see no disks in the system and stop. This will allow us to install the initiator and discover the iSCSI LUs. If there is any media installed anaconda will continue and attempt to install to the locally connected device. |
COMMAND | LOCATION | OUTPUT |
rpm -ivh iscsi-initiator-utils-4.0.3.0-3.src.rpm | Red Hat Enterprise Linux 4 U3 Source CD3 | /usr/src/redhat/SPECS/iscsi-initiator-utils.spec |
rpm -ivh kernel-2.6.9-34.EL.src.rpm | Red Hat Enterprise Linux 4 U3 Source CD4 | /usr/src/redhat/SPECS/kernel-2.6.spec |
rpm -ivh kernel-devel-2.6.9-34.EL.i686.rpm | Red Hat Enterprise Linux 4 U3 CD3 | /usr/src/kernels/2.6.9-34.EL-i686/ |
rpm -ivh kernel-smp-devel-2.6.9-34.EL.i686.rpm | Red Hat Enterprise Linux 4 U3 CD3 | /usr/src/kernels/2.6.9-34.EL-smp-i686/ |
rpm -ivh kernel-hugemem-devel-2.6.9-34.EL.i686.rpm | Red Hat Enterprise Linux 4 U3 CD3 | /usr/src/kernels/2.6.9-34.EL-hugemem-i686 |
rpmbuild -bp --target `uname -m` kernel-2.6.spec | /usr/src/redhat/SPECS | /usr/src/redhat/BUILD/kernel-2.6.9/ |
rpmbuild -bp --target `uname -m` iscsi-initiator-utils.spec | /usr/src/redhat/SPECS | /usr/src/redhat/BUILD/iscsi-initiator-utils-4.0.3.0 |
- cp iscsiboot.tar /home
- cd /home
- tar -xvf iscsiboot.tar
/usr/src/redhat/BUILD/iscsi-initiator-utils-4.0.3.0/linux-iscsi-4.0.3.0
-v 2.6.9-34.EL
This process uses dd to write the Driver Update Disk you may specify the device node with the -t option or the script will prompt you. Keep in mind that you must use the device node and not a mounted partition.
![]() |
NOTE: This assumes you have flashed and configured your iSCSI firmware to connect to your target and iscsi firmware was able to connect to the iscsi target. |
Floppy
mkdir /mnt/floppy
mount /dev/fd0 /mnt/floppy.
USB Floppy Drive
dmesg
Examine the output of dmesg and determine what /dev node is reserved for your USB drive (i.e. /dev/sdX)
mkdir /mnt/usb
mknod /dev/sdX b 8 0
mount /dev/sdX /mnt/usb
- Copy files to a temporary location
mkdir /tmp/iscsi
cp -fr /mnt/usb/* /tmp/iscsi/
umount /mnt/usb
- Run the "preinstall/iscsipreinstall" script from the mount point.
/mnt/usb/preinstall/iscsipreinstall
- Type "dmesg" to verify that discovery occurred correctly. It should show that drives were recently discovered.
- Press Ctrl+Alt+F1 and select "Done".
- Continue with the installation.
NOTE: When partitioning the iSCSI LUs ensure that your boot partition is not distributed across physical partitions on different iSCSI LUs. The Intel iSCSI Option ROM will only expose one iSCSI LU and if /boot is distributed across multiple LUs it will not be visible durring the boot process.
/tmp/iscsi/postinstall/iscsipostinstall
- Edit the /mnt/sysimage/etc/init.d/halt and scroll to the bottom.
- Change the line stating HALTARGS="-i -d" to HALTARGS="-d"
- Press Ctl+Alt+F7 to return to installation screen and select "Reboot".
![]() |
NOTE: After the system has booted iscsid will be running. The user may want to add something like "kill `pidof iscsid`" to an init script. iscsid is only needed for discovery and can be killed in this way without problems. |