NFS (Network File System) is a distributed file system protocol that allows you to share directories and files over a network. In this guide, we will walk through the steps to set up an NFS mount on Rocky Linux 8.

Step 1: Install NFS Utilities

Start by ensuring your system is up to date and install the necessary NFS utilities:

sudo dnf update -y
sudo dnf install -y nfs-utils

Step 2: Configure the NFS Server

If you haven't already set up an NFS server, you'll need to configure it. Create a directory to share:

sudo mkdir -p /mnt/nfs_share

Add some test files to the shared directory:

echo "Hello NFS" | sudo tee /mnt/nfs_share/test.txt

Step 3: Edit the Exports File

Edit the /etc/exports file to define the shared directory and its permissions:

sudo nano /etc/exports

Add the following line:

/mnt/nfs_share *(rw,sync,no_root_squash)

This configuration allows all clients to mount the directory with read and write permissions.

Step 4: Start and Enable the NFS Service

Start the NFS service and enable it to run at startup:

sudo systemctl start nfs-server
sudo systemctl enable nfs-server

Step 5: Set Up the NFS Client

On the client machine, install the NFS utilities:

sudo dnf install -y nfs-utils

Create a mount point on the client machine:

sudo mkdir -p /mnt/nfs_client

Step 6: Mount the NFS Share

Mount the NFS share using the following command, replacing server_ip with the IP address of your NFS server:

sudo mount -t nfs server_ip:/mnt/nfs_share /mnt/nfs_client

Step 7: Verify the Mount

Check if the NFS share is mounted successfully:

df -h

You should see the NFS mount listed in the output.

Step 8: Configure Automatic Mounting at Boot

To ensure the NFS share mounts automatically at boot, add the following line to the /etc/fstab file on the client machine:

server_ip:/mnt/nfs_share /mnt/nfs_client nfs defaults 0 0

Conclusion

You have successfully set up an NFS mount on Rocky Linux 8. This allows you to share files across your network easily.

If you're looking for a reliable hosting solution for your NFS server, consider using Windows VPS UK. With Windows VPS, you can efficiently host your applications and ensure high performance. Whether you need VPS UK Windows or Windows Virtual Private Servers, you'll find a solution that fits your requirements.

For larger deployments or enterprise needs, explore Windows Virtual Dedicated Server Hosting or Virtual Private Server Hosting Windows. Whether you're located in the UK, Italy, or elsewhere, Windows VPS Italy and UK VPS Windows offer reliable hosting options. Visit Windows VPS Hosting UK to discover the best hosting solutions for your file sharing needs.

Was this answer helpful? 0 Users Found This Useful (0 Votes)