Diskless boot

The Linux SCSI Target Wiki

Jump to: navigation, search

iSCSI is an ideal protocol for diskless boot. Here's a HOWTO describing how to set that up.

Contents

Client

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.1.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)
}
  • Untar and install
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 copy it to /tftproot/
  • Make an initrd and copy it to /tftproot
  • 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
tar zxvf tftp-hpa-0.41.tar.gz
cd tftp-hpa-0.41
./configure
make
make install
  • And finally start the tftpd:
/sbin/in.tftpd -l -v -s /tftproot

Server

wget http://linux-iscsi.org/iscsiboot/server-scripts/pxeserver-setup.sh

Boot time

After successfully booting, do something along these lines:

/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

If this is a new installation, partition and create a file system, then copy minimal files to your new disk

/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
/bin/chroot /laptop:diska /bin/bash

See also

External links

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
Google AdSense