Current status: Two new directories i.e. sys1 and sys2 created.
-location: /nfstpboot/sys1  and /nfstpboot/sys2
-Using rsync command system files were copied into sys1. After that from sys1 we copied root into sys2 directory.
-we successfully created diskless environmet for client computers. See below for details about the procedure.
-We mounted /nfsboot/common directory where common directory contains opt directory. See (Mount /nfsboot/sys1/opt) at the bottom of this page for details.

Current problem: How can we manage main directories nicely under /nfsboot/common, i.e. /usr and /opt, so that they can be shared for many client machines?

We want to make a diskless computing system so that we need a PXE Server. PXE stands for "Pre-boot eXecution Environment". PXE is a special extension of services provided by the Dynamic Host Configuration Protocol (DHCP). It uses a Trivial File Transfer Protocol (TFTP) server to provide minimal boot to a network client. Let's try to configure it!


* Small subnet for testing DHCP [#f0142583]

**What we need [#pe839496]
- A computer with linux operating system to be configured as a server. Here we use Fedora Linux. This computer should have at least two network interface cards (NIC). One of the cards will be used to connect the server with client.
- Computer that acts as a client. For a checking purpose we need this computer to have SSH facility (it does not matter to use Windows or Linux).
- Network hub and cables.

**Checking [#r1faf503]
***Network setting [#j7b294ed]
- Turn on the hub, connect a network cable from Fedora Linux computer (PXE server) to the hub (e.g. to channel 1)
-Note: From now we will address this Fedora Linux machine as PXE Server although it is not configured yet as PXE server.
- Connect again a network cable from the client computer (Windows/Linux) to the hub (e.g. to channel 2).
- Open Network configuration on PXE server using root privilege (i.e login or su as root). We should set network interface card that has been connected to the hub.
- Assuming the network card is eth8, select this card then Click on Edit and set the following:
-- IP Address:
-- Subnet Mask:
--After that activate this NIC if it is not activated yet.
- PXE server has a local IP address eth9 by DHCP (to flex)
- On the client computer, set the IP Address by statically to be:
-- IP Address:
-- Subnet Mask:
-- gateway (specified by dhcpd.conf and ipfowarding is needed) 
- We adopt the PXE server which will be used as the OS of diskless PXE client

***SSH check [#tad4148a]
- Open SSH software on client computer, for example, Putty or any command line software:
 ssh username@
- If username is "nugraha" and hostname of server is "rsaito-necPC", we must get the following line after succesfully login:
it means that we can access the server from the client.

* Setting for the PXE server machine [#fea55b57]

** SElinux should be in permissive mode. [#e2317643]

- edit /etc/sysconfig/selinux

** Install DHCP and TFTP Server etc [#s9d399d8]
- Install dhcp, syslinux, tftp-server, nfs-utils, system-config-netboot(su root)
 # yum install dhcp syslinux  tftp-server nfs-utils system-config-netboot
- Check if the software is nicely installed
 # rpm -qa | grep syslinux
-- If we can see name + version, then ok. If not, yum install again.

** DHCP Configuration [#b4fdd07c]

- Edit /etc/dhcpd.conf. The following is a configuration for a network that uses:
-- addressing
-- Dynamic address will be provided between and
-- DHCP server (next server) at IP address
 allow booting;
 allow bootp;
 ddns-update-style interim;
 ignore client-updates;
 subnet netmask {
	  option subnet-mask;
	  option broadcast-address;
	  range dynamic-bootp;
 host trytube1 {                           # hostname
               hardware ethernet 00:30:48:d4:a9:7c; # MAC address of NIC
               fixed-address; # corresponding IP address
               filename "/linux-install/pxelinux.0";
 host trytube2 {                           # hostname
               hardware ethernet 00:30:48:d4:a9:44; # MAC address of NIC
               fixed-address; # corresponding IP address
               filename "/linux-install/pxelinux.0";
 class "pxeclients" {
       match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
       filename "/linux-install/pxelinux.0";
Warning: Do not use the IP address of PXE-Client within the range 200-240.
-- Turn on dhcpd
 # /sbin/service dhcpd restart
 # chkconfig dhcpd on
 (the last line is for activating dhcp on booting process)

-- Check if the dhcp server can work. 
--- Open a client computer which is connected to server
--- Set the TCP/IP to dynamically set for IP address. 
--- Connect by ssh
  % putty username@
---If we can connect, it means DHCP has successfully been configured.
  % ipconfig -a
--- Please keep Mac Address of the client PC, in this case 00-21-70-c9-e7-de (another Dell PC). 

** TFTP Configuration [#nfd5db55]

- Edit /etc/xinetd.d/tftp of the PXE server machine
 # default: off
 # description: The tftp server serves files using the trivial file transfer \
 #       protocol.  The tftp protocol is often used to boot diskless \
 #       workstations, download configuration files to network-aware printers, \
 #       and to start the installation process for some operating systems.
 service tftp
        disable                 = no
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -s /tftpboot
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4

- (1) disable = no, and (2) server_args = -s /tftpboot should be changed.
- Possible problems: (1) tftp does not work, (2) tftp does not find the files.
- tftpd is running under the xinetd. We restart xinetd
 # service xinetd restart

** NFS configuration [#r08426e2]

*** Copy system data for booting [#v32daf81]
- We will make file systems /nfsboot 
 # mkdir /nfsboot/sys1
 # mkdir /nfsboot/sys2

- rsync will be used for copying the files. 
 # rsync -v -a \
 --exclude='/proc/*' --exclude='/sys/*' --exclude='/dev/*'\
 --exclude='/media/*'   --exclude='/tmp/*' --exclude='/misc/*'\
 --exclude='/nfsboot/*' / /nfsboot/sys1/root

- Do the same thing for other machine.

- 10GB files (10min) are needed. The file system will be used as NFS files.

*** Firewall and starting NFS [#u8bca647]
- NFS hosts is PXE server ( 
- Edit /etc/exports

- Edit /etc/sysconfig/nfs
-- uncomment MOUNTD_PORT
 # Port rpc.mountd should listen on.

- Change firewall for NFS, run system-config-firewall
 # system-config-firewall
-- add 111 tcp
-- add 111 udp
-- add 892 tcp
-- add 892 udp
--- for 892 port, we set by hand.

- Start nfs
 # service nfs restart
 # cd /etc/rc5.d/
 # mv K20nfs S20nfs
 # ./S20nfs restart
 Shutting down NFS mountd:                                  [  OK  ]
 Shutting down NFS daemon:                                  [  OK  ]
 Shutting down NFS quotas:                                  [  OK  ]
 Shutting down NFS services:                                [  OK  ]
 Starting NFS services:                                     [  OK  ]
 Starting NFS quotas:                                       [  OK  ]
 Starting NFS daemon:                                       [  OK  ]
 Starting NFS mountd:                                       [  OK  ]
 # ./S20nfs status
 rpc.mountd (pid 12153) is running...
 nfsd (pid 12150 12149 12148 12147 12146 12145 12144 12143) is running...
 rpc.rquotad (pid 12138) is running...

- 'K' in 'K20nfs' means that file does not run by default, then we change into 'S'.

** Netboot [#nd1b2b49]

- Files directory is made automatically by 
 # system-config-netboot

- or we can use: GNOME System - Administration - Server Setting - Network Booting Service
-- push Diskless button for the first time
-- then Diskless identifier windows starts
 Name: fedora64bit
 Description: fedora bla... bla... bla...

-- NFS information:
 directory /nfsboot

-- Select a newer Kernel.
-- Automatically it will generate /tftpboot/linux-install/fedora64bit/ and
--- /tftpboot/linux-install/fedora64bit/initrd.img
--- /tftpboot/linux-install/fedora64bit/vmliuz
-- New windows appears
 IP address/subnet:  <- we use subnet information for checking
 operating system: fedora64bit
 Other part should be as it is.

-- /nfsboot/snapshot/ will be generated automatically.

--- FFFFFF00 ( file is generated as above.
 # cd /tftpboot/linux-install/pxelinux.cfg
 # mv default
 # ln -s FFFFFF00 01-00-21-70-c9-e7-de

--- when default exists, PXE client first try to read this.
--- 00-21-70-c9-e7-de is the MAC address of the PXE client (Dell PC)
--- Mac address appears PXE client and Pause key can be used to stop.
--- PXE try to read 01-00-21-70-c9-e7-de the file first.
-- An important thing is to put "01-" at the beginning of the name.
--- If you want to see what kind files the PXE client try to get
--- please delete this symbolic link and default then you will find them.

* Set PXE client [#j2d1c71b]

- Start BIOS and select BOOT.
- Select Network boot (no submenu exist).
- Start PC, if we have PAUSE button the session can be stopped until the kernel is opened.
* Mount /nfsboot/sys1/opt [#taa17fd7]
 # mkdir /mnt/common
 # mkdir /nfsboot/common
 # mv /nfsboot/sys1/root/opt  /nfsboot/common
 # mount -t nfs  /mnt/common
- as opt directory is moved so make a symbolic link with the following statement:
 # ln -s /nfsboot/common/opt   /nfsboot/sys1/root 
 # cd /mnt/test
* MAC addresses of PXE Server and Clients [#a12c788a]
- 00:30:48:d4:a9:44 (sys1, client)
- 00:30:48:d4:a9:7c (sys2 client)
- 00:30:48:d4:a9:0a  (PXE Server)
- 00:21:70:c9:e7:de  (Dell machine, English OS)

* Problem and Solution [#g4d63e01]
- P: extracting initrd.img
--S: gunzip < initrd.img | cpio -i --make-directories

Front page   New List of pages Search Recent changes   Help   RSS of recent changes