24.3. Configuring an Exported File System for Diskless Clients


Prerequisites

Procedure

  1. 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 /etc/exports Configuration File”.
  2. 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 utility:
      # 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 rsync.
      • Replace exported-root-directory with the path to the exported file system.
    • To install Red Hat Enterprise Linux to the exported location, use the yum utility with the --installroot option:
      # 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

  1. Select the kernel that diskless clients should use (vmlinuz-kernel-version) and copy it to the tftp boot directory:
    # cp /boot/vmlinuz-kernel-version /var/lib/tftpboot/
  2. Create the initrd (that is, initramfs-kernel-version.img) with NFS support:
    # dracut --add nfs initramfs-kernel-version.img kernel-version
  3. Change the initrd's file permissions to 644 using the following command:
    # chmod 644 initramfs-kernel-version.img

    Warning

    If the initrd's file permissions are not changed, the pxelinux.0 boot loader will fail with a "file not found" error.
  4. Copy the resulting initramfs-kernel-version.img into the tftp boot directory as well.
  5. Edit the default boot configuration to use the initrd and 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 /var/lib/tftpboot/pxelinux.cfg/default file:
    default rhel7
    
    label rhel7
      kernel vmlinuz-kernel-version
      append initrd=initramfs-kernel-version.img root=nfs:server-ip:/exported/root/directory rw
    Replace server-ip with the IP address of the host machine on which the tftp and DHCP services reside.
The NFS share is now ready for exporting to diskless clients. These clients can boot over the network via PXE.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.