Derwynd's Weblog

Derwynd's Weblog

Steps for installing Linux over Network with PXE and tftpboot setup – Centos

Steps for installing Linux over Network with PXE and tftpboot setup - Centos

To setup a NFS server containing the CentOS4 customized distro and then booting via
a PXE bootrom on the client side to get the required info for installing the OS via

Step 1: DHCP server setup
- Install the dhcp server rpms

- Create the /etc/dhcpd.conf file.  Following is the configuration given below

ddns-update-style none;
ignore client-updates;
allow booting;
allow bootp;

subnet netmask {

option routers        ;
option subnet-mask    ;
option broadcast-address;
option domain-name              “”;
option domain-name-servers;
option time-offset              -18000; # Eastern Standard Time
range dynamic-bootp;
default-lease-time 21600;
max-lease-time 43200;

class “pxeclients” {
match if substring(option vendor-class-identifier, 0, 9) = “PXEClient”;
filename “linux-install/pxelinux.0″;

- chkconfig –level 2345 dhcpd on
- service dhcpd restart

STEP 3: Configure NFS server

- I have copied the base dir of the Distro (ie CD 1 and in the RPM folder all rpms of remaining cd 2,3,4…) to /data dir.  I my case i called it
“custom-install” dir
- Edit /etc/exports and add the following line
/data/custom-install        *(rw,sync,no_root_squash)
- service nfs restart
- service portmap restart

For Security related purpose edit /etc/hosts.allow and /etc/hosts/deny to limit the
connection to specific ip addresses

STEP 4: Configure TFTP server
- Install the syslinux, redhat-config-netboot, and tftp-server rpms
- Enable the tftp server in /etc/xinetd.d/tftp and changing the “disable” line from
“yes” to “no.”
- chkconfig –level 345 tftp on
- service xinetd restart
- Next step is to copy the files necessary to start the installation to the tftp
server so they can be found when the client requests them. The tftp server is
usually the same server as the network server exporting the installation tree.

- Type system-config-netboot on the command prompt
- 1st time when u start, select “Network Install” from the First Time Druid

select Configure => Network Installation from the pulldown menu, and then click Add.

Enter the following in the fields:

- Operating system identifier - CentOS4

Provides a unique name using one word to identify the Linux version and variant. It
is used as the directory name in the /tftpboot/linux-install/ directory.

- Description - CentOS4 install

- Select Protocol for installation - NFS

- Kickstart - nfs: - Path to your kickstart

- Server IP address - - Where UR NFS is residing

- Location - /data/custom-install

-  After clicking OK, the initrd.img and vmlinuz files necessary to boot the
installation program are transfered from images/pxeboot/ in the provided
installation tree to /tftpboot/linux-install//  on the tftp server

= CentOS4 - Given above

- The Directory /tftpboot/linux-install/CentOS4 contains 3 files


- Contents of the ks.cfg as as follows
#use NFS installation media
nfs –server –dir /data/custom-install

In this way you can create a Menu for installation of different linux OSes by
specifying a diff  and pointing to different dirs.

Using the command line tool to do the above using pxeos

pxeos -a -i “” -p  -D 0 -s -L
-k  -K

Substitue the respective values

STEP 4: Editing the default tftpboot server files

Edit the /tftpboot/linux-install/pxelinux.cfg/default file and do the required
changes as show below:

default centos
timeout 100
prompt 1
display msgs/boot.msg
F1 msgs/boot.msg
F2 msgs/general.msg
F3 msgs/expert.msg
F4 msgs/param.msg
F5 msgs/rescue.msg
F7 msgs/snake.msg

label centos
kernel CentOS4/vmlinuz
append initrd=CentOS4/initrd.img ramdisk_size=7000

STEP 5: Editing the main ks.cfg for installation

In the main ks.cfg of the distro change the install method to NFS


In /data/custom-install/ks.cfg

nfs –server –dir /data/custom-install

STEP 6: Checking for the installation

Boot the PXE enabled client machine and check if the client get the IP via DHCP and
present a menu for installation

November 10, 2008 - Posted by | Uncategorized

Sorry, the comment form is closed at this time.

%d bloggers like this: