Diskless boot
The Linux SCSI Target Wiki
![]() |
This article needs a review and may need a cleanup or additional content. Please help improve this article to meet our quality standards. (12/1/2010) |
iSCSI is an ideal protocol for diskless boot. Here's a HOWTO describing how to set that up.
Contents |
Client
- Download and setup Core-iSCSI and the Core-iSCSI-Tools (the test system was setup wih Linux kernel 2.6.14.5)
- Setup ISC DHCP (
dhcp-4.2.0.tar.gz
) - 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.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) }
- Setup PXELinux (
syslinux-4.03.tar.bz2
)
- 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
:
- Build a kernel for your client and copy it to
TIMEOUT 50 PROMPT 1 LABEL iscsiboot KERNEL vmlinuzLaptop APPEND root=/dev/ram initrd=bblinux25M IPAPPEND 1 LABEL disk LOCALBOOT 0
- Setup TFTP-HPA (
tftp-hpa-0.41.tar.gz
):
- Setup TFTP-HPA (
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
- Setup an LinuxIO and some test disk.
- Setup a PXE server (this includes ISC DHCP, syslinux and TFTP-HPA):
wget http://linux-iscsi.org/iscsiboot/server-scripts/pxeserver-setup.sh
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 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
- And, lastly:
/bin/chroot /laptop:diska /bin/bash
See also
External links
- Diskless server installation (iSCSI boot install)
- iSCSI-boot-admin
- iSCSI RPM repostory
- Etherboot