24.3. Configuring an Exported File System for Diskless Clients
- Install the necessary packages. See Chapter 24, Setting up a Remote Diskless System
- Configure the
tftpservice. See Section 24.1, “Configuring a tftp Service for Diskless Clients”.
- Configure DHCP. See Section 24.2, “Configuring DHCP for Diskless Clients”.
- 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
/etc/exports. For instructions on how to do so, see the Section 8.6.1, “The
- To accommodate completely diskless clients, the root directory should contain a complete Red Hat Enterprise Linux installation. You can either clone an existing installation or install a new base system:
- To synchronize with a running system, use the
#rsync -a -e ssh --exclude='/proc/*' --exclude='/sys/*' \ hostname.com:/exported-root-directory
- Replace hostname.com with the hostname of the running system with which to synchronize via
- Replace exported-root-directory with the path to the exported file system.
- To install Red Hat Enterprise Linux to the exported location, use the
yumutility with the
#yum install @Base kernel dracut-network nfs-utils \ --installroot=exported-root-directory --releasever=/
The file system to be exported still needs to be configured further before it can be used by diskless clients. To do this, perform the following procedure:
Procedure 24.2. Configure File System
- Select the kernel that diskless clients should use (
vmlinuz-kernel-version) and copy it to the
cp /boot/vmlinuz-kernel-version /var/lib/tftpboot/
- Create the
initramfs-kernel-version.img) with NFS support:
dracut --add nfs initramfs-kernel-version.img kernel-version
- Change the initrd's file permissions to 644 using the following command:
chmod 644 initramfs-kernel-version.img
WarningIf the initrd's file permissions are not changed, the
pxelinux.0boot loader will fail with a "file not found" error.
- Copy the resulting
tftpboot directory as well.
- Edit the default boot configuration to use the
initrdand kernel in the
/var/lib/tftpboot/directory. This configuration should instruct the diskless client's root to mount the exported file system (
/exported/root/directory) as read-write. Add the following configuration in the
default rhel7 label rhel7 kernel vmlinuz-kernel-version append initrd=initramfs-kernel-version.img root=nfs:server-ip:/exported/root/directory rwReplace
server-ipwith the IP address of the host machine on which the
tftpand DHCP services reside.
The NFS share is now ready for exporting to diskless clients. These clients can boot over the network via PXE.