nslu:pxebootserver

no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


nslu:pxebootserver [2009/11/27 17:54] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== PXE Booting from NSLU2 ======
  
 +Wouldn't it be great if you could boot up a machine entirely from the network!  This is particular useful if you wish to
 +  * Run diskless [[http://www.plop.at/en/ploplinux.html|Plop Linux]]
 +  * Perform a Symantec GHOST backup
 +
 +I will show the basics of how setup PXE, DHCP, a DOS network boot image and PloP linux.
 +
 +===== Our Setup =====
 +This is the configuration of our environment: 
 +  * We're working with a small network 192.168.1.0/24
 +  * We'll allow all local machines to boot and get an IP address via DHCP from the range 196.168.1.100 - 192.168.1.150
 +  * Our "boot-server" is the host "herman" with default IP address 192.168.1.77
 +  * Our "dhcp-server" is a linksys WRT54g running DD-WRT v23 sp2
 +
 +===== Software install =====
 +
 +Install the following software (once again, an internet connection is required):
 +<code>
 + ipkg install xinetd
 + ipkg install tftp-hpa (the tfptd server)
 +        </code>
 +
 +Check that /opt/etc/xinetd.conf has the following:
 +<code>
 +defaults
 +{
 +        only_from      = localhost 192.168.1.0/24
 +        instances      = 60
 +        log_type       = SYSLOG authpriv info
 +        log_on_success = HOST PID
 +        log_on_failure = HOST
 +        cps            = 25 30
 +}
 +
 +includedir /opt/etc/xinetd.d
 +</code>
 +
 +
 +Also check that /opt/etc/xinetd.d/tftp looks like this:
 +
 +<code>
 +service tftp
 +{
 +        flags = REUSE
 +        socket_type = dgram
 +        protocol = udp
 +        instances = 30
 +        wait = yes
 +        user = root
 +        server = /opt/sbin/in.tftpd
 +        server_args = -vt 30 -c -s /opt/tftpboot
 +        cps = 100 2
 +        log_on_success = HOST PID
 +        log_on_failure = HOST
 +        disable = no
 +}
 +</code>
 +At first, the default setup only allows overwriting existing files so the -c option has to be added to server_args as shown above. The last server_args option (-s /opt/tftpboot) in the tftp file insures that all files will be deposited on the /opt/tftpboot directory so you don't have to specify where to put your files or remember which directory you put them in later.
 +
 +
 +
 +===== Setting up the TFTPBOOT area =====
 +
 +We will now setup the /opt/tftpboot directory.  The finish product will look like this:
 +<code>
 +-bash-3.2# cd /opt/tftpboot
 +-bash-3.2# ls -lR
 +-rw-r--r-- 1 root  root         269 Apr 13 09:02 display.msg
 +-rw-r--r-- 1 root  root       23540 Aug 16  2004 memdisk
 +-rw-r--r-- 1 root  root       94356 Nov 11  2004 memtest
 +-rw-r--r-- 1 root  root       14646 Apr 10 10:30 pxelinux.0
 +-rw-r--r-- 1 root  root     1474560 Apr 12 19:46 unet.img
 +
 +pxelinux.cfg:
 +total 4
 +-rw-r--r-- 1 root root 580 Apr 13 09:06 default
 +</code>
 +
 +First we will create the PXE boot directory pxelinux.cfg
 +<code>
 +-bash-3.2# mkdir pxelinux.cfg
 +-bash-3.2# chmod 755 pxelinux.cfg
 +</code>
 +
 +Into this directory will be place the following contents named **default**
 +<code>
 +timeout 0
 +prompt 1
 +display display.msg
 +
 +label localdisk
 +        localboot 0
 +
 +label unet
 +        KERNEL memdisk
 +        APPEND initrd=unet.img keeppxe
 +
 +label memtest
 +        KERNEL memtest
 +</code>
 +
 +The **keeppxe** option allows the usage of the 3com UNDI driver.
 +
 +Make sure you take note of the permission that these file have.  If they are not others and group readable TFTP will not be able to access them.
 +
 +Create the following display text 
 +<code>
 +      ***** PXE Boot Menu *****
 +
 +localdisk - Normal boot from local disk
 +unet      - PCDOS7 Universal Network boot
 +memtest   - Memory test
 +
 +
 +
 +</code>
 +Take the entire contents here including the trailing <CR/LF> sequences.  We do this so that the **boot:** prompt will appear several lines down from our display text.
 +
 +Into the /opt/tftpboot directory place the following images:
 +  * {{nslu:pxelinux.0}} - from the [[http://syslinux.zytor.com/pxe.php|SYSLINUX]] distribution
 +  * {{nslu:memdisk}} - allows booting legacy operating systems via PXE. See [[http://syslinux.zytor.com/memdisk.php|MEMDISK]].
 +  * {{nslu:memtest}} - PXE bootable [[http://www.memtest.org/|memtest]]
 +  * {{nslu:unet.img}} - prebuilt PCDOS 7 [[http://www.netbootdisk.com/|Universal TCP/IP network boot disk]]
 +
 +You can take a peek inside these .IMG files on the NSLU by doing the following.  You'll need two additional modules if these are not already installed.
 +<code>
 +ipkg install kernel-module-isofs
 +ipkg install kernel-module-loop
 +
 +mkdir floppy
 +mount -o loop unet.img floppy
 +</code>
 +
 +==== Universal TCP/IP Boot disk ====
 +
 +If you want to build your own Universal TCP/IP boot disk then I suggest you start by creating a PCDOS7 floppy in a Virtual floppy drive and go from there.
 +
 +  * {{nslu:pcdos700.zip}} - PC DOS creation
 +  * {{nslu:vfd21-080206.zip}} - Virtual floppy drive
 +  * [[http://www.winimage.com/winimage.htm|WinImage]] - may also come in handy.
 +
 +===== DHCP =====
 +
 +Personally I use the dnsmasq package to provide DHCP services upon my LAN, since this is small and simple and provides other useful abilities, setting up PXE booting with dnsmasq just requires the addition of the following line.  This done via the "Administration (Level 1 TAB) >  Services (Level 2 TAB)" and entering the following into the "Additional DNS Options" textbox.
 +<code>
 +dhcp-boot=pxelinux.0,herman,192.168.1.77
 +</code>
 +(Again we've setup the filename along with the name and IP address of the TFTP server which is "herman" / 192.168.1.77 in this example)
 +
 +
 +===== BOOTING UNET =====
 +
 +The PXE boot process.  The PXE boot menu has purposely not been display by making sure we have the wrong attributes on the display.msg file.
 +
 +{{nslu:pxeboot.png}}
 +
 +PXE Boot message.  A Ctrl-L at the beginning of the file ensure the screen is blanked before display.  The Colour has been added by wrapping field like so:
 +<code>
 +^L^O0e      ***** PXE Boot Menu *****^O07
 +
 +^O0elocaldisk^O07 - Normal boot from local disk
 +^O0eunet^O07      - PCDOS7 Universal Network boot
 +</code>
 +
 +{{nslu:pxeboot-menu.png}}
 +
 +Booting the {{nslu:unet.img}} image
 +
 +{{nslu:unet.png}}
 +
 +==== GHOST ====
 +
 +So now we have DOS being remotely transfer via PXE firing up ghost is easy.  We create a new network share an on this share we put a copy of ghost.
 +<code>
 +N:\> NET USE G: \\192.168.1.77\backup
 +N:\> G:
 +G:\> GHOST
 +</code>
 +Given the G: drive is visible to GHOST we can now perform network backup and restores.
 +
 +{{nslu:ghost.png}}
 +
 +====== Plop Linux ======
 +
 +Installing and configuring PLOP Linux requires only a few changes to what we already have in place.
 +
 +Construct a new PXE menu boot up screen: **/opt/tftpboot/display.msg**
 +<code>
 +^L^O0e      ***** PXE Boot Menu *****^O07
 +
 +^O0elocaldisk^O07 - Normal boot from local disk
 +^O0eunet^O07      - PCDOS7 Universal Network boot
 +^O0memtest^O07    - Memory test
 +^O0plop^O07       - PloP Linux
 +</code>
 +
 +{{nslu:plop-menu.png}}
 +
 +An additional entry in our PXE linux configuration file **/opt/tpftpboot/pxelinux.cfg/default**
 +<code>
 +label plop
 +        kernel ploplinux/bzimage
 +        append initrd=ploplinux/initrfs.gz vga=0 nfsmount=192.168.1.77:/opt/tftpboot/ploplinux
 +</code>
 +
 +Into the **/opt/tftpboot** directory we expand the {{ploplinux.tgz}} archive.
 +<code>
 +# cd /opt/tftpboot
 +# tar zxf ploplinux.tgz
 +</code>
 +
 +Make sure we have NFS installed on the NSLU
 +<code>
 +# ipkg install nfs-utils
 +</code>
 +
 +Modify the /etc/exports file to make the /opt/tftpboot/ploplinux directory available
 +<code>
 +/opt/tftpboot/ploplinux 192.168.1.0/255.255.255.0(ro,no_subtree_check)
 +</code>
 +
 +After making this change make it current
 +<code>
 +# exportfs -a
 +# showmount -e
 +Export list for herman:
 +/opt/tftpboot/ploplinux 192.168.1.0/255.255.255.0
 +</code>
 +
 +**BOOT IT UP**
 +
 +{{nslu:plop.png}}
 +
 +====== See Also ======
 +  * http://rom-o-matic.net/
 +  * http://www.bootdisk.com/bootdisk.htm
 +  * http://www.netbootdisk.com/
 +{{tag>nslu2}}
  • nslu/pxebootserver.txt
  • Last modified: 2009/11/27 17:54
  • by 127.0.0.1