PXE boot of Debian, Ubuntu and Memtest

Step-by-Step descriptions of how to do things.
Post Reply
User avatar
^rooker
Site Admin
Posts: 1483
Joined: Fri Aug 29, 2003 8:39 pm

PXE boot of Debian, Ubuntu and Memtest

Post by ^rooker »

Since I've now been reading tons of PXE/netboot information on the web, I'm totally surprised about how many, cryptical und mostly uncomprehensible docs exist about Debian PXE Netboot install.

Most of them are even contradictive, as they apply to a mixed set of Debian versions, and different conditions.
Blablabla... I'm just a bit annoyed by the fact, that I couldn't figure out how to netboot the Debian installer, but fetch the files from an NFS-mounted Squeeze 6.0.3 ISO file. hmpf.

However, here are a few informations, I've figured out during the process:
*) ISO files mounted on the TFTP server, show up empty over NFS
I've mounted my Ubuntu .iso files, according to Falco Timme's Multiboot PXE HowTo. I've also configured NFS to share the folder with the mounted ISOs.

I've tripple-checked: The ISOs were mounted fine and accessible, but when accessing it over NFS, the mount point folder was empty.
Thanks to a forum message from the user thorbjørn on linuxquestions.org, I've added "crossmnt" as option to my /etc/exports entry for the ISO mountpoint share:

Here's what worked for me:

Code: Select all

/var/lib/tftpboot/iso-images/ *(ro,sync,no_wdelay,insecure_locks,no_root_squash,insecure,no_subtree_check,crossmnt)
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
User avatar
^rooker
Site Admin
Posts: 1483
Joined: Fri Aug 29, 2003 8:39 pm

Re: PXE boot of Debian, Ubuntu and Memtest

Post by ^rooker »

Additional information about the 2 different modes of running tFTP (inetd, tftpd) can be found on Christian Schneider's page "HOWTO setup a small server".
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
User avatar
^rooker
Site Admin
Posts: 1483
Joined: Fri Aug 29, 2003 8:39 pm

Re: PXE boot of Debian, Ubuntu and Memtest

Post by ^rooker »

Here's a small script for mass-mounting several ISOs:

Code: Select all

# Iterates through all foldernames in the current directory and mounts
# ISO images that match these foldernames.

ISO_MASK="../ISOs/%s.iso"

echo "Mounting ISOs..."
for MOUNT_POINT in `ls -d *`; do
    if [ ! -d "$MOUNT_POINT" ]; then
        # Not a folder.
        continue
    fi

    DIR_NAME="$(basename $MOUNT_POINT)"
    ISO_FILE=$(printf "$ISO_MASK" $MOUNT_POINT)

    if [ ! -s "$ISO_FILE" ]; then
        echo "ERROR: Unable to find '$ISO_FILE'."
        continue
    fi

    echo "Mounting ISO: $ISO_FILE"
    mount -o loop $ISO_FILE $MOUNT_POINT
done
The script iterates through all directories in the current folder (=mountpoints), takes their name and looks for a corresponding ISO matching that name.
Modify the "ISO_MASK" string to match your ISO file position.
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
User avatar
^rooker
Site Admin
Posts: 1483
Joined: Fri Aug 29, 2003 8:39 pm

Re: PXE boot of Debian, Ubuntu and Memtest

Post by ^rooker »

My link collection regarding PXE boot:
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
User avatar
^rooker
Site Admin
Posts: 1483
Joined: Fri Aug 29, 2003 8:39 pm

pxelinux.cfg/default example

Post by ^rooker »

I thought it might also be a good idea to post my working pxelinux.cfg/default as an example:

Code: Select all

DEFAULT menu.c32
PROMPT 0
TIMEOUT 300
ONTIMEOUT localboot

MENU TITLE ^Rooker's Network Boot Paradise

LABEL localboot
    MENU LABEL Local ^HDD
    LOCALBOOT 0

LABEL memtest
   MENU LABEL memtest86+ (v4.20)
   KERNEL memtest/memtest86+_v4

LABEL memtest_new
   MENU LABEL memtest86+ (v5.01)
   KERNEL memtest/memtest86+_v5

MENU SEPARATOR

LABEL video_linux_64
    MENU LABEL Linux Video Workstation (64bit)
    KERNEL systems/video_linux-amd64/boot/netboot/vmlinuz-3.2.0-38-generic
    APPEND root=/dev/nfs nfsroot=192.168.200.11:/srv/tftp/systems/video_linux-amd64 initrd=systems/video_linux-amd64/boot/netboot/initrd.img-3.2.0-38-generic ip=dhcp rw

MENU SEPARATOR

LABEL xubuntu_desktop-precise_32
    MENU LABEL Xubuntu Live (12.04.2 32bit)
    KERNEL iso-mounted/xubuntu-12.04.2-desktop-i386/casper/vmlinuz
    APPEND root=/dev/nfs boot=casper netboot=nfs nfsroot=192.168.200.11:/srv/tftp/iso-mounted/xubuntu-12.04.2-desktop-i386 initrd=iso-mounted/xubuntu-12.04.2-desktop-i386/casper/initrd.lz splash --

LABEL xubuntu_desktop-precise_64
    MENU LABEL ^Xubuntu Live (12.04.2 64bit)
    KERNEL iso-mounted/xubuntu-12.04.2-desktop-amd64/casper/vmlinuz
    APPEND root=/dev/nfs boot=casper netboot=nfs nfsroot=192.168.200.11:/srv/tftp/iso-mounted/xubuntu-12.04.2-desktop-amd64 initrd=iso-mounted/xubuntu-12.04.2-desktop-amd64/casper/initrd.lz splash --

LABEL xubuntu_desktop-raring_64
    MENU LABEL Xubuntu Live (13.04 64bit)
    KERNEL iso-mounted/xubuntu-13.04-desktop-amd64/casper/vmlinuz
    APPEND root=/dev/nfs boot=casper netboot=nfs nfsroot=192.168.200.11:/srv/tftp/iso-mounted/xubuntu-13.04-desktop-amd64 initrd=iso-mounted/xubuntu-13.04-desktop-amd64/casper/initrd.lz splash --

MENU SEPARATOR

LABEL ultimate_boot_cd-527
    MENU LABEL Ultimate Boot CD (v5.2.7)
    KERNEL menu.c32
    APPEND iso-mounted/UltimateBootCD-ubcd527/ubcd/menus/syslinux/main.cfg
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
Post Reply