This is an old revision of the document!
====== Booting from iSCSI with Debian Lenny ====== ==== Introduction ==== This howto is similar to [[sanboot:debian_lenny_iscsi|how to get iSCSI working with Debian Etch]]. It is important to note the following differences from that howto: * The [[http://git.kernel.org/?p=linux/kernel/git/mnc/open-iscsi.git;a=tree;f=utils/fwparam_ibft;h=c5a9e5e47f71d7de12cb0b4f07b89e31406bd95b;hb=054ada67a9eba729cb7b0f96c218877f8a2b933c|fwparam_ibft]] utility used in the initrd scripts in the Debian Etch solution does not exist anymore. Its functionality has changed slightly, and it has been merged into the other tool called ''iscsistart''. To test it simply say ''iscsistart -f''. Both utilites are/were part of the [[http://www.open-iscsi.org/|Open-iSCSI]] software. * While the iSCSI + Etch guide told you to compile the open-iscsi tools from source because the ''iscsistart'' and ''fwparam_ibft'' tools were missing from the package, Lenny actually has the ''iscsistart'' in the package called ''open-iscsi'' in its repository. Simply say ''aptitude install open-iscsi'' to have it installed, and have a look at its [[http://wiki.debian.org/iSCSI/open-iscsi|its documentation]]. * The ''open-iscsi'' package in Lenny also installs iscsi related boot scripts for initrd so you might not have to make your own. However, the devil is in the details below. ==== Doing iSCSI the lenny way ==== Install open-iscsi <code bash>aptitude install open-iscsi</code> Touch the indicatorfile, which is queried to determine whether the iscsi tools and scripts are to be copied into the new initrd <code bash>touch /etc/iscsi/iscsi.initramfs</code> Rebuild your initrd. <code bash> aptitude install initramfs-tools update-initramfs -u </code> Configure the root and rootdelay parameters to your kernel with the following goals in mind: * The initiator and other iSCSI related parameter should be specified so that the open-iscsi boot scripts can get going with setting up iSCSI * The kernel should find the correct disk once iSCSI is online. The safest way is to use a ''LABEL='' or ''UUID='' identification. Example: <code grub> title Debian Lenny iSCSI kernel /vmlinuz-2.6.28-11-generic ISCSI_INITIATOR=iqn.2009-04.mynet:general iSCSI_TARGET_NAME=iqn.2009-04.mynet.node1:general.vol1 iSCSI_TARGET_IP=192.168.1.1 ISCSI_TARGET_PORT=3260 root=UUID=021ebcfc-188a-41ba-9864-ee18cbf7af9f ro initrd /initrd.img-2.6.28-11-generic </code> Try to boot! ==== Lenny doesnt fetch from iBFT ==== Now if Open-iSCSI is in the repositories then why did I bother to write this howto? Good question! The answer is simply that you don't get the same result with the iSCSI + Etch howto as you get when instlling open-iscsi from the lenny repositories. While the "etch solution" fetches iscsi parameters from the [[iBFT]], the "built-in lenny solution" fetches the parameters from configuration file(s) under ''/etc/'' in the initramfs image itself. While this simple distinction might seem innocent enough, it really isn't. In many cases it is impracticalt to create a new initrd or root image to change the iscsi parameters. Luckily, for most people there is a more elegant way to get the parameters. The latest lenny kernel (as of 4. November 2009) has an [[iBFT]] function compiled in that makes fetching the iSCSI parameters from [[iBFT]] really easy. From your initrd script, simply traverse the directory ''/sys/firmware/ibft'' The files in there contain all the ibft information you could ever want. <code bash> TODO: post an initrd hook/script that does exactly that </code> ==== XEN Troubles ==== There is a catch though. The /sys/firmware/ibft directory is empty if you boot with a xen kernel. This is due to a bug that makes the kernel unable to map memory below 1 MiB correctly. This turned out to be a major problem as we want to configure all of our webserver farm nodes to boot xen dom0 kernels over iSCSI for my little [[http://colobg.net/|webhost company]]. ==== Solutions to XEN + iSCSI + Lenny + iBFT ==== There are 3 solutions to the problem of aquiering iSCSI data from the iBFT with a lenny XEN kernel in initrd: * Patch the kernel or use an alternate kernel to fix the iBFT + XEN problem. This patch looks promising: http://patchwork.kernel.org/patch/50838/ . Documentation for how to proceed with that is available here: http://wiki.debian.org/DebianKernelCustomCompilation and you might also want to read this: http://packages.debian.org/lenny/kernel-package and this: http://www.debian.org/doc/FAQ/ch-kernel.en.html * Use an utility that gets hold of the iBFT data without depending on the kernel sysfs directory ''/sys/firmware/ibft''. One way that has been tested and that works is to do that is to fetch an older version of the Open-iSCSI sourcecode from here: http://www.open-iscsi.org/bits/ and compiling the old fwparam_ibft tool that is mentioned in the etch howto. This tool gets its iBFT data directly from memory without asking the kernel at all. This has been confirmed to work with an XEN dom-0 kernel. * Fall back to the default behaviour in Lenny, namely to read the settings from configurations in ''/etc/''.