# Booting from iSCSI

## mounty1

Hello, I current boot a diskless workstation with an NFS root and wanted see if iSCSI would be faster.  So I consulted http://etherboot.org/wiki/sanboot/gentoo_iscsi#method_2use_an_existingworking_gentoo_system and it all looks pretty straightforward but I can't get it working.

The server ('target') is running OmniOS, an OpenSolaris/Illumos derivative.  I think that is working alright because if I follow the instructions for initiating a connection on an already-running Gentoo client ('initiator'), it all works fine.

```

```

```
192.168.1.1:3260,1 iqn.2010-08.org.illumos:02:568f579d-7249-edb4-e9cd-983c97518870

(others similar, omitted for security)
```

```
/dev/sda   /dev/sda1  /dev/sda2  /dev/sda5  /dev/sda6
```

```

Logging in to [iface: iface0, target: iqn.2010-08.org.illumos:02:568f579d-7249-edb4-e9cd-983c97518870, portal: 192.168.1.1,3260]

Login to [iface: iface0, target: iqn.2010-08.org.illumos:02:568f579d-7249-edb4-e9cd-983c97518870, portal: 192.168.1.1,3260] successful.
```

```
/dev/sda   /dev/sda1  /dev/sda2  /dev/sda5  /dev/sda6  /dev/sdb  /dev/sdb1
```

Now the only difference from the instructions referenced above is that the kernel is built with

```
 Device Drivers  --->

  SCSI device support  --->

    [[*]] SCSI device support

      <*> SCSI disk support

    [[*]] SCSI low-level drivers  --->

      <*>   iSCSI Initiator over TCP/IP

    SCSI Transports  --->

      {*} iSCSI Transport Attributes

 Cryptographic options  --->

   [[*]] Cryptographic API

     <*> CRC32c CRC algorithm
```

i.e., iSCSI options built-in, not modules as the article says, because of course this kernel is for iSCSI at boot.

Now I'm using the kernel to boot with NFS root so the networking options are all OK but nevertheless at boot, it doesn't pick up the iSCSI disk so the kernel loads then panics.

```
title Gentoo Linux XFCE

root (hd0,0)

kernel /vmlinuz-3.10.9-gentoo ip=192.168.1.58:192.168.1.1:192.168.1.1:255.255.255.0::eth0:none rw root=/dev/nfs nfsroot=192.168.1.1:/gentoo/xfce,nolock,v3,intr,hard,noacl quiet

title Gentoo Linux XFCE iSCSI

root (hd0,0)

kernel /vmlinuz-3.10.9-gentoo ip=192.168.1.58:192.168.1.1:192.168.1.1:255.255.255.0::eth0:none rw root=/dev/sdb1 iscsi_target=iqn.2010-08.org.illumos:02:568f579d-7249-edb4-e9cd-983c97518870 iscsi_address=192.168.1.1 iscsi_initiatorname=iqn.2005-03.org.open-iscsi:74272459ad8f
```

and that NFS line is the working one so static IP is working correctly.

That stuff is all on a small local boot filesystem on flash storage --- I'm not using TFTP / PXE.

The other deviation from the published instructions is that I'm not using initrd as I don't see why it should be needed or what would go in it.

I've experimented with the boot line, adding real_root=/dev/sdb1, and adding :3260 to the iscsi_address argument.

I stress that the panic occurs when it tries to mount the boot iSCSI disk.  I've already prepared the disk (as the presence of /dev/sdb1 above implies) by mounting it from the running system, then copying everything from a snapshot of the NFS root filesystem, but it isn't getting as far as complaining about init not found or anything like that.

So can anyone suggest what might be going wrong ?

----------

## mounty1

The answer is that iSCSI requires certain libraries to be loaded, so an initrd with busybox and other bits is required.  Run away.

----------

## Eusaphious

 *mounty1 wrote:*   

> The answer is that iSCSI requires certain libraries to be loaded, so an initrd with busybox and other bits is required.  Run away.

 

Making it out to be much more difficult then it needs to be. All that is needed is to install 'genkernel' and run the following to generate the initramfs:

genkernel --install --iscsi initramfs

You will find a initramfs now in your /boot directory. 

This command works even if you don't use genkernel to create the kernel. 

In addition to the kernel options you listed, make sure you select the iscsi_ibft driver as well. Its located at Firmware Drivers -> iSCSI Boot Firmware Table Attributes. 

Also, I found that no matter if I compile the iscsi drivers into the kernel or as modules, the initramfs was still needed - I got kernel panic on boot without it.

----------

