Académique Documents
Professionnel Documents
Culture Documents
The original author asserted that Red Hat plans a fix and to
include a working system-config-netboot in the future, but no
ETA for such a fix was stated. This shouldn't prevent loading
CentOS 4 or 5 machines as the actual diskless clients, but only
meant he had problems using a CentOS 5 as the NFS Diskless
Image Server. Note again, that this is the opinion of the original
author; a later revisor of this page, RussHerrold runs such, with
SElinux labelling fixes on the NFS server side without incident.
This guide will help you setup an NFS server to dish out
diskless clients on your network. This is useful if you want to
bring up workstations quickly, without the hassle of hard drives,
and or worrying about multiple installations along the way.
Some of the commands are from the official Red Hat Docs.
This guide will assume you're creating two different installation
types, a server and a desktop installation.
# mkdir -p /srv/diskless/i386/RHEL4S/root
# mkdir -p /srv/diskless/i386/RHEL4D/root
# vim /etc/exports
/srv/diskless/i386/RHEL4S/root/
*(ro,sync,no_root_squash)
/srv/diskless/i386/RHEL4S/snapshot/
*(rw,sync,no_root_squash)
/srv/diskless/i386/RHEL4D/root/
*(ro,sync,no_root_squash)
/srv/diskless/i386/RHEL4D/snapshot/
*(rw,sync,no_root_squash)
Start the NFS server and verify the NFS shares are ok and start
the service. If NFS services are already running, then reload
them.
Directory Permissions
Hosts
/srv/diskless/i386/RHEL4S/root/ ro
*
/srv/diskless/i386/RHEL4S/snapshot/ rw
*
/srv/diskless/i386/RHEL4D/root/ ro
*
/srv/diskless/i386/RHEL4D/snapshot/ rw
*
# vim /etc/dhcpd.conf
allow booting;
allow bootp;
class "pxeclients" {
match if substring(option vendor-class-identifier, 0, 9) =
"PXEClient";
next-server 192.168.1.20;
filename "linux-install/pxelinux.0";
}
2. Setup tftp
Ensure that xinetd and tftp are installed on the DHCP server.
Install/Configure/Copy an Installation
Next you have to actually install an installation, or use an
existing system from somewhere. For this experiment, I've
installed a fresh basic non-gui load of CentOS 4.6. Completely
setup the host as you wish, because this will be the actual copy
of all the diskless clients in a bit. For my purposes, I've
installed, updated, and copied any local configurations I want or
need on my network to my host. Anything you want customized,
do it now because it's easier to set it up once the right way. A
perfect example of this is if you need third-party RPM packages
installed, go ahead and install them on the host now. The only
package that is required on the host is busybox-anaconda.
1. Netboot Configuration
Head back over to your NFS server now. If you are remotely
accessing the server via SSH, then you must forward X with the
session.
# ssh -X nfs_server
Install the netboot configuration tool if it's not already on the
system, and launch the tool. There are differences between 4.6
and 5.1 during this step. RHEL 5 does not include system-
config-netboot due to technical problems. You can however
install the FC6 binary with a little extra work.
2. Host Configuration
Once the diskless OS environment is setup, you can create and
configure a new host system with the configuration tool. If you
need specifics of what all the parameters are, then check out
the adding hosts section of Red Hat's documenation. In the GUI
tool, select New to start the host creation process.
# vim /srv/diskless/i386/RHEL4S/root/etc/sysconfig/network-
scripts/ifcfg-eth0{1,2,3} (whatever your NIC is)
HWADDR= <--- blank this out
DHCPDHCP_HOSTNAME= <-- blank this out
Now when you boot up the new diskless host, it won't get mad
about the MAC address being different, and it won't have a
hostname. It should only be named localhost. Obviously you
can set the hostname at will.
That's it for adding hosts. You can now repeat this entire
process for each OS environment type. Don't forget if you
create a new OS type, then you're going to want to add a new
directory under NFS to export. Think of it as housing different
OSes, so make the names distinguishable. For my uses, I'm
creating the already mentioned server and desktop installation.
You can use it for anything you want, though. Let's say you
want to create an instance for a very specific task, but don't
have a hard drive for the machine. This allows you to create an
instance on VMware, or any other virtual environment, and
copy that installation over to NFS. Now you can boot it up on
any machine with a PXE network card.
PXE Boot
A note about PXE, which is short for Preboot Execution
Environment. Do a Wikipedia search if you really desire
deeping meanings. In short, the network card's firmware
searches for a PXE redirect, which happily passes this
information along from the DHCP server, which then points it to
your NFS server specified. It then downloads via tftp the boot
file path into memory, and continues to execute it. Ultimately,
you have your OS boot up from memory then.
Once you have the NIC and system ready to go, fire it up and test
it out. You should have it boot to the NIC menu, it might say
something about the MAC address, or about bootp loading. It
should immediately get passed on to your NFS server, and then
boot the Linux image. Now you can go steal all of those hard
drives out of your PCs at work, huh.