logo       

iSCSI diskless boot/chroot HOWTO: msg#00315

Subject: iSCSI diskless boot/chroot HOWTO
Hobbyists; I am very pleased to provide a complete proof of concept
for iSCSI diskless booting/chroot.

As this is an evolving project, please provide feedback or any questions.

Enjoy!

Bryan D. Black

**Also externally attached in html format.

iSCSI diskless boot/chroot howto

bryan.don.black@xxxxxxxxx   < Last updated: Jan 26, 2006 > version 0.2


Proof of concept includes:
  • server: HP Athlon 64bit 3500+ | (running ietd,ISC dhcp,pxelinux,tftp-hpa)
  • client: DELL Latitude | D610 | (running iSCSI initiator Core)
  • kernel ver 2.6.14.5 , both server & client machines

  • Server Tasks:
  • Setup ISC DHCP
  • Setup Syslinux (for PXELinux) & TFTP-HPA
  • Setup iSCSI Target (ietd enterprise target)

  • Client Tasks:
  • Setup iSCSI initiator (iSCSI initiator Core)
  • Boot time


  • Setup ISC DHCP

    edit /etc/dhcp/dhcpd.conf
    allow booting;
    allow bootp;
    option routers 192.168.1.6;
    option subnet-mask 255.255.255.0;
    ddns-update-style ad-hoc;
    subnet 192.168.1.0 netmask 255.255.255.0 {
       range 192.168.1.111 192.168.55.115;
    }
    group {
     next-server 192.168.1.6;
     filename "pxelinux.0";
     host laptop-eth0 {
          hardware ethernet 00:00:00:00:00:00; (replace with your mac-address)
     }
    

    Setup PXELinux

  • untar syslinux, make && make install
  • untar tftp-hpa, make && make install
  • mkdir -p /tftproot/pxelinux.cfg
  • cp pxelinux.0 /tftproot
  • build a kernel for your client and cp to /tftproot/
  • ** make an initrd and cp to /tftproot
  • note on above: (i will be releasing a very small (25MB) yet complete universal initrd very soon!!)
  • edit /tftproot/pxelinux.cfg/default
    		TIMEOUT 50
    		PROMPT 1
    		LABEL iscsiboot
    		        KERNEL vmlinuzLaptop
    		        APPEND root=/dev/ram initrd=bblinux25M
    		        IPAPPEND 1
    		LABEL disk
    		LOCALBOOT 0
    
  • Start tftpd: /sbin/in.tftpd -l -v -s /tftproot

  • Setup iSCSI Target

  • download ietd (svn export svn://svn.berlios.de/iscsitarget/trunk)
  • cd trunk && make KERNELSRC=/usr/src/linux && make KERNELSRC=/usr/src/linux install
  • make some test disk. ie: dd if=/dev/zero of=/iscsi-diska bs=4096k count=1024
  • configure your new LUN in /etc/ietd.conf
  • 		        Target laptop:diska
            		Lun 0 Path=/iscsi-diska,Type=fileio
    		        Alias dell
    		        DataPDUInOrder Yes
    		        DataSequenceInOrder Yes
    
  • start ietd
  • *Your server/target should be ready, provided ietd,dhcp,in.tftpd is running

    Setup iSCSI initiator Core

    (client side installation notes)

  • download core-iscsi-tools (pub/linux/utils/storage/iscsi/)
  • untar core-iscsi, make initiator KERNEL_DIR=/usr/src/linux && make install
  • untar core-iscsi-tools, make install
  • iSCSI core stack is then loadable via iscsi_initiator_mod.ko,
  • core tools rely upon /etc/sysconfig/initiator

    		CHANNEL="0 2 eth0 192.168.55.6 3260 0"
    
    and /etc/sysconfig/iscsi_device_maps
    		DEVICE="0 0 1 diska"
    

    Boot time

  • Change bios on client to pxeboot before HD
  • at the pxelinux prompt, type iscsiboot (referring to label in pxelinux.cfg/default)
  • after successfully booting, do something like this:

    			/bin/mount / -o rw,remount
    			/bin/mount -t proc none /proc
    			/bin/mount -o sysfs /sys
    			/sbin/ifconfig eth0 192.168.1.92 255.255.255.0
    			
    			cd /dev && /bin/mknod sdb1 b 8 17
    			NAME=$(/sbin/initiator-iname)
    
    			echo "InitiatorName=$NAME" > /etc/initiatorname.iscsi
    			/etc/rc.d/init.d/initiator start
    			/bin/fdisk /dev/sdb # (create partition)
    			/bin/mke2fs /dev/sdb1
    			/bin/mount /dev/sdb1 /laptop:diska
    
    			cp -dpRav /bin /sbin /dev /etc /var /lib /usr /tmp /laptop:diska
    			cd /laptop:diska && mkdir proc && mkdir sys
    			/bin/chroot /laptop:diska /bin/bash
    






    iSCSI diskless boot/chroot howto

    bryan.don.black@xxxxxxxxx   < Last updated: Jan 26, 2006 > version 0.2


    Proof of concept includes:
  • server: HP Athlon 64bit 3500+ | (running ietd,ISC dhcp,pxelinux,tftp-hpa)
  • client: DELL Latitude | D610 | (running iSCSI initiator Core)
  • kernel ver 2.6.14.5 , both server & client machines

  • Server Tasks:
  • Setup ISC DHCP
  • Setup Syslinux (for PXELinux) & TFTP-HPA
  • Setup iSCSI Target (ietd enterprise target)

  • Client Tasks:
  • Setup iSCSI initiator (iSCSI initiator Core)
  • Boot time


  • Setup ISC DHCP

    edit /etc/dhcp/dhcpd.conf
    allow booting;
    allow bootp;
    option routers 192.168.1.6;
    option subnet-mask 255.255.255.0;
    ddns-update-style ad-hoc;
    subnet 192.168.1.0 netmask 255.255.255.0 {
       range 192.168.1.111 192.168.55.115;
    }
    group {
     next-server 192.168.1.6;
     filename "pxelinux.0";
     host laptop-eth0 {
          hardware ethernet 00:00:00:00:00:00; (replace with your mac-address)
     }
    

    Setup PXELinux

  • untar syslinux, make && make install
  • untar tftp-hpa, make && make install
  • mkdir -p /tftproot/pxelinux.cfg
  • cp pxelinux.0 /tftproot
  • build a kernel for your client and cp to /tftproot/
  • ** make an initrd and cp to /tftproot
  • note on above: (i will be releasing a very small (25MB) yet complete universal initrd very soon!!)
  • edit /tftproot/pxelinux.cfg/default
    		TIMEOUT 50
    		PROMPT 1
    		LABEL iscsiboot
    		        KERNEL vmlinuzLaptop
    		        APPEND root=/dev/ram initrd=bblinux25M
    		        IPAPPEND 1
    		LABEL disk
    		LOCALBOOT 0
    
  • Start tftpd: /sbin/in.tftpd -l -v -s /tftproot

  • Setup iSCSI Target

  • download ietd (svn export svn://svn.berlios.de/iscsitarget/trunk)
  • cd trunk && make KERNELSRC=/usr/src/linux && make KERNELSRC=/usr/src/linux install
  • make some test disk. ie: dd if=/dev/zero of=/iscsi-diska bs=4096k count=1024
  • configure your new LUN in /etc/ietd.conf
  • 		        Target laptop:diska
            		Lun 0 Path=/iscsi-diska,Type=fileio
    		        Alias dell
    		        DataPDUInOrder Yes
    		        DataSequenceInOrder Yes
    
  • start ietd
  • *Your server/target should be ready, provided ietd,dhcp,in.tftpd is running

    Setup iSCSI initiator Core

    (client side installation notes)

  • download core-iscsi-tools (pub/linux/utils/storage/iscsi/)
  • untar core-iscsi, make initiator KERNEL_DIR=/usr/src/linux && make install
  • untar core-iscsi-tools, make install
  • iSCSI core stack is then loadable via iscsi_initiator_mod.ko,
  • core tools rely upon /etc/sysconfig/initiator

    		CHANNEL="0 2 eth0 192.168.55.6 3260 0"
    
    and /etc/sysconfig/iscsi_device_maps
    		DEVICE="0 0 1 diska"
    

    Boot time

  • Change bios on client to pxeboot before HD
  • at the pxelinux prompt, type iscsiboot (referring to label in pxelinux.cfg/default)
  • after successfully booting, do something like this:

    			/bin/mount / -o rw,remount
    			/bin/mount -t proc none /proc
    			/bin/mount -o sysfs /sys
    			/sbin/ifconfig eth0 192.168.1.92 255.255.255.0
    			
    			cd /dev && /bin/mknod sdb1 b 8 17
    			NAME=$(/sbin/initiator-iname)
    
    			echo "InitiatorName=$NAME" > /etc/initiatorname.iscsi
    			/etc/rc.d/init.d/initiator start
    			/bin/fdisk /dev/sdb # (create partition)
    			/bin/mke2fs /dev/sdb1
    			/bin/mount /dev/sdb1 /laptop:diska
    
    			cp -dpRav /bin /sbin /dev /etc /var /lib /usr /tmp /laptop:diska
    			cd /laptop:diska && mkdir proc && mkdir sys
    			/bin/chroot /laptop:diska /bin/bash
    
    <Prev in Thread] Current Thread [Next in Thread>