Rooot.net

  • Increase font size
  • Default font size
  • Decrease font size
To err is human--and to blame it on a computer is even more so.
Home Geek stuff Linux Install debian with PXE boot

Install debian with PXE boot

Installing a new OS may be difficult on machines with no CD/DVD (like Portégé 2000 from toshiba or Asus's EeePc). Hopefully those PC supports boot over network. It is called PXE (Preboot Execution Environment). To boot a computer with PXE you'll need a machine with a DHCP server and a TFTP server.

Here is a simple way to setup a PXE boot server.

Install TFTP server

The TFTP server will be used to transfer OS images to the client machine.

~$ apt-get install tftpd-hpa

You don't have to start the TFTP server. On debian, the 69 UDP port is handled by inetd. Any connection received on this port with start a in.tftpd process. Because we're not going to use the TFTP server very often we'll keep that behavior.

Updating DHCP

It is now necessary to edit the DHCP server configuration to add the TFTP server address to each IP attribution. If you don't have a DHCP server you can install dnsmasq, available on both Debian and OpenWRT. Edit the /etc/dnsmasq.conf file to add these lines:

# pxe boot options
dhcp-boot=pxelinux.0,architect,192.168.12.2

Here I installed the TFTP server on a host named "architect" with the IP "192.168.12.2". Don't forget to restart the dnsmasq server to apply your changes:

~$ /etc/init.d/dnsmasq restart

Boot system creation

Create a file /var/lib/tftpboot/pxelinux.cfg/default. It will hold boot configuration used by all machines booting with PXE. You can setup a specific configuration for some machines using their MAC address: replace the "default" file with the hexadecimal representation of the machine MAC address (exemple: "001E8CC84372").

~$ mkdir /var/lib/tftpboot/pxelinux.cfg
~$ cat > /var/lib/tftpboot/pxelinux.cfg/default << EOF
DISPLAY boot.txt
DEFAULT etch_i386_install

LABEL etch_i386_install
kernel debian/etch/i386/linux
append vga=normal initrd=debian/etch/i386/initrd.gz  --
LABEL etch_i386_rescue
kernel debian/etch/i386/linux
append vga=normal initrd=debian/etch/i386/initrd.gz  rescue/enable=true --

PROMPT 1
TIMEOUT 0

EOF

This configuration will display the boot.txt file at startup to let user choose a startup option.

~$ cat > /var/lib/tftpboot/boot.txt << EOF
===================
== PXE Boot Menu ==
===================

etch_i386_install
etch_i386_rescue
EOF

Now we just have to add the files needed for system startup into the folder debian/etc/i386 as described in the configuration file.

~$ cd /var/lib/tftpboot
~$ wget http://ftp.fr.debian.org/debian/dists/etch/main/installer-i386/current/images/netboot/debian-installer/i386/pxelinux.0
~$ mkdir -p /var/lib/tftpboot/debian/etch/i386
~$ cd /var/lib/tftpboot/debian/etch/i386
~$ wget http://ftp.fr.debian.org/debian/dists/etch/main/installer-i386/current/images/netboot/debian-installer/i386/linux
~$ wget http://ftp.fr.debian.org/debian/dists/etch/main/installer-i386/current/images/netboot/debian-installer/i386/initrd.gz

Allright! To test it you can now boot a machine using PXE: if everything runs OK you just have to type "etch_i386_install" after the boot menu shows up to start a new debian installation.

Source: http://www.debian-administration.org/articles/478

Comments
Add New Search
Write comment
Name:
Email:
 
Website:
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
 
Please input the anti-spam code that you can read in the image.

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."