2.2. Installing Red Hat Enterprise Linux for Real Time Using Diskless Boot
Diskless booting allows a system administrator to deploy a large number of compute nodes without having to configure an equal number of local storage devices. This section provides instructions on how to set up a remote diskless system using an NFS filesystem mounted by a PXE booting client. Perform the following procedure on an existing installation of Red Hat Enterprise Linux for Real Time.
- Install the following packages required to set up a basic remote diskless system booted over PXE:
yum install tftp-server xinetd dhcp syslinux dracut-network
~]# yum install tftp-server xinetd dhcp syslinux dracut-networkCopy to Clipboard Copied! Toggle word wrap Toggle overflow Important
- Ensure that the NFS and DHCP services are properly configured and started.
- Firewall rules which have been predefined by system-config-firewall can block tftp traffic and prevent the clients from booting. It is necessary to adjust the firewall rules on the server.
- Enable the tftp service to allow PXE booting via the network. To do so, edit the
/etc/xinetd.d/tftpfile and set theDisabledparameter toNo. - Copy
/usr/share/syslinux/pxelinux.0to the tftp root directory in/var/lib/tftpboot/:cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
~]# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create a
pxelinux.cfgdirectory inside the tftp root directory:mkdir -p /var/lib/tftpboot/pxelinux.cfg/
~]# mkdir -p /var/lib/tftpboot/pxelinux.cfg/Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Configure firewall rules to allow tftp traffic. Using a text editor, add the following line to
/etc/hosts.allow:tftpd: .hostname.com
tftpd: .hostname.comCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace .hostname.com with the domain name of the target clients on which the installations will be performed. For more information on firewall rules refer to the man page forhosts_access. - Restore the SELinux context on the tftp server. To provide the necessary files via the tftp protocol for PXE boot, run the following command:
restorecon -R /var/lib/tftpboot
~]# restorecon -R /var/lib/tftpbootCopy to Clipboard Copied! Toggle word wrap Toggle overflow - To enable PXE booting on the DHCP server, add the following configuration to
/etc/dhcp/dhcpd.conf:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace server-ip with the IP address of the host machine on which the tftp and DHCP services reside. - The root directory of the exported file system (used by diskless clients in the network) is shared via NFS. Configure the NFS service to export the root directory by adding it to the
/etc/exportsfile in the following format:/exported/root/directory hostname.com(rw,sync,no_root_squash)
/exported/root/directory hostname.com(rw,sync,no_root_squash)Copy to Clipboard Copied! Toggle word wrap Toggle overflow The example configuration exports the directory /export/root/directory to all hosts on the hostname.com network withread-writepermissions. Thesyncoption ensures that the NFS server will not reply to requests before changes made by previous requests are written to disk. Theno_root_squashoption enables the NFS server to connect to the client with root privileges. - To accommodate completely diskless clients, the root directory should contain a complete Red Hat Enterprise Linux for Real Time installation. You can synchronize this with a running system via rsync. Run:
rsync -a -e ssh --exclude='/proc/*' --exclude='/sys/*' hostname.com:/ /exported/root/directory
~]# rsync -a -e ssh --exclude='/proc/*' --exclude='/sys/*' hostname.com:/ /exported/root/directoryCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace hostname.com with the hostname of the running system with which to synchronize via rsync. The /exported/root/directory is the path to the exported file system. - Add the following configuration to the exported file system's
/etc/fstabfile:none /tmp tmpfs defaults 0 0 tmpfs /dev/shm tmpfs defaults 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0
none /tmp tmpfs defaults 0 0 tmpfs /dev/shm tmpfs defaults 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Select the kernel that diskless clients should use (
vmlinuz-rt-kernel-version) and copy it to the tftpboot directory:cp /boot/vmlinuz-rt-kernel-version /var/lib/tftpboot/
~]# cp /boot/vmlinuz-rt-kernel-version /var/lib/tftpboot/Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create the
initramfsdisk image (i.e.initramfs-rt-kernel-version.img) with network support:dracut -a "network nfs" initramfs-rt-kernel-version.img rt-kernel-version
~]# dracut -a "network nfs" initramfs-rt-kernel-version.img rt-kernel-versionCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Copy the
initramfsdisk image to the tftpboot directory:cp initramfs-rt-kernel-version.img /var/lib/tftpboot/
~]# cp initramfs-rt-kernel-version.img /var/lib/tftpboot/Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Edit the default boot configuration to use the
initramfsdisk image and Realtime kernel inside/var/lib/tftpboot. This configuration instructs the diskless client to mount the exported file system (/exported/root/directory) as read-write. To do this, configure/var/lib/tftpboot/pxelinux.cfg/defaultwith the following:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace server-ip with the IP address of the host machine on which the exported NFS root partition resides.
The NFS share is now ready for exporting to diskless clients. These clients can boot Red Hat Enterprise Linux for Real Time over the network via PXE.
Important
You must disable SELinux on diskless clients which use NFS as the root file system. Add
SELINUX=disabled to the /etc/selinux/config file, or add selinux=0 on the kernel command line when booting the client.
For more information on setting up remote diskless systems, see the Storage Administration Guide.