Skip to main content

Connect a Node to NFS Server

  1. Install NFS Client Utilities (if not already installed): Ensure that NFS client utilities are installed on the client node. Install them if needed:

    sudo apt update
    sudo apt install nfs-common
    
  2. Mount NFS Share: Create a directory on the client node where you want to mount the NFS share (e.g., /mnt/nfs_client):

    sudo mkdir -p /mnt/nfs_client
    
  3. Mount the NFS Share: Mount the NFS share from the server to the client directory:

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

    Replace server_ip with the IP address of your NFS server.

  4. Verify Mount: Check that the NFS share is mounted correctly:

    mount | grep nfs
    
  5. Automount NFS Share (Optional): If you want the NFS share to be mounted automatically on boot, you can add an entry to /etc/fstab on the client node:

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

    Save the file and run:

    sudo mount -a
    

Testing the NFS Mount

  • Create a file on the NFS share from the client node to ensure read and write permissions are correctly set up:

    echo "Test file" | sudo tee /mnt/nfs_client/test.txt
    
  • Check if the file appears on the NFS server at /mnt/nfs_share.

By following these steps, you should be able to connect another node (client) to your NFS server and access shared directories. Adjust the IP addresses, paths, and configuration options (rw, sync, etc.) according to your specific setup and security requirements.