How To Configure PXE Boot on CentOS 5

By | 03/21/2009

The other day I blogged about how to extract the kernel and ramdisk from the DBAN downloadable image.  These two files would be useful in the situation where you might want to PXE (network) boot a machine and have it wiped.  (Something like this may be common prior to dispositioning a machine at work, or before you give an old machine away.)  Whatever your reasons might be, I thought I would outline the steps that I have taken to install and configure PXE on a CentOS 5 installation.

Installation

yum install tftp-server

DBAN Configuration

After following my previous instructions on how to extract the DBAN PXE images, copy the two files (kernel.bzi and initrd.gz) to the /tftpboot/ directory.

mkdir -p /tftpboot/dban
cp kernel.bzi /tftpboot/
cp initrd.gz /tftpboot/

PXE Configuration

You’ll also need to configure the PXE system to know what to launch/run when a specific command is given at boot.  In this case we’ll only have the DBAN option, which we could run by using the ‘dban’ command:

/tftpboot/pxelinux.cfg/default

display msgs/boot.msg
prompt 1
## dban
label dban
kernel dban/kernel.bzi
append load_ramdisk=1 initrd=dban/initrd.gz root=/dev/ram0 init=/rc quiet nuke=”dwipe” –autonuke –method dodshort”

The first line in that file, “display” tells it to display a file as a menu prompt at boot time.  The second step in this section is creating that menu prompt:

/tftpboot/msgs/boot.msg

**WARNING** TYPE ‘dban’ TO AUTO-WIPE THE PXE BOOTED MACHINE.  **WARNING**

Start The Service

Now that we have everything configured we’ll go ahead and start the service:

service xinetd restart

2 thoughts on “How To Configure PXE Boot on CentOS 5

  1. Nathan

    Hey, just came across this and wanted to let you know I am going to be trying to use it to setup a PXE boot DBAN environment for an office I am closing in a month. I will let you know how it goes. I guess the only mod I can imagine making at the moment is offering the menu choice to boot locally.

    Also, I really like your WordPress theme. It puts mine MT theme to shame, literally.

    – Nathan

    Reply
  2. andrew

    Dear Zelut,

    I like your method to wipe disk on PXE. Now, Im following your method, and stuck in PXE configuration.
    I m new user for linux,
    1. How to configure “pxelinux.cfg/default”?
    2. The clients cant get boot image, what cause this problem?
    3. Could you make easy steps data wipe on PXE, from the basic for FC4.

    Thanks for your assistance

    Reply

Leave a Reply to Nathan Cancel reply

Your email address will not be published. Required fields are marked *