Configure NFS in linux

Configure NFS in linux

What is NFS?

Network File System (NFS) is a networking protocol for distributed file sharing. A file system defines the way data in the form of files is stored and retrieved from storage devices, such as hard disk drives, solid-state drives and tape drives. NFS is a network file sharing protocol that defines the way files are stored and retrieved from storage devices across networks.

Network File System (NFS) is used by UNIX/LINUX clients for file access. NFS uses port 2049.

How to Configure NFS?

In Master Node

  1. yum install nfs-utils
  2. systemctl start nfs-server rpcbind
  3. systemctl enable nfs-server rpcbind
  4. mkdir /mnt/sharedoc
  5. chmod 777 /mnt/sharedoc/
  6. vim /etc/exports
    1. /mnt/sharedoc 192.168.0.0/16(rw,sync,no_root_squash)    # shown in fig 2
  7. exportfs -r
  8. firewall-cmd --permanent --add-service=mountd
  9. firewall-cmd --permanent --add-service=rpc-bind
  10. firewall-cmd --permanent --add-service=nfs
  11. firewall-cmd --reload




In Client Node

  1. yum install nfs-utils


  1. showmount -e 192.168.76.xxx  #it will show mount location, change xxx with your master's ip address
  2. mkdir /mnt/nfsdrive
  3. mount 192.168.76.xxx:/mnt/sharedoc /mnt/nfsdrive/
  4. df -h


    • Related Articles

    • What is Boot Process in Linux OS.

      Boot Process in Linux OS. Have you ever wondered what happens behind the scenes from the time you press the power button until the Linux login prompt appears? Press the power button on your system, and after few moments you see the Linux login ...
    • How to Partition, Format, and Mount Secondary Drives in Linux - Manual Drive Configuration (MDC)

      Introduction This guide provides detailed instructions on how to manually configure secondary drives in a Linux system, including partitioning, formatting, and mounting the drives. Warning Performing these steps on an existing primary drive or a ...
    • Backup, Snapshot, and Restore Linux installations using Timeshift

      If you mess up (or are going to mess up) some config files or drivers, it is always good to have a fallback point. The de-facto standard for doing this on Linux is Timeshift. Timeshift for Linux is an application that provides functionality similar ...
    • Setup noVNC on Ubuntu 20.04/Gnome 3.36

      VNC (Virtual Network Computing) enables you to control your Linux installation from another computer on the same network, by viewing and interacting with the desktop from the other computer. To learn more about VNC, click here noVNC allows you to ...
    • Set up RAID 0 using mdadm

      Steps to configure RAID 0 in Centos7. Code lsblk yum install -y mdadm mdadm --create --verbose /dev/md0 --level=0 --raid-devices=2 /dev/sdb /dev/sdc mkfs.ext4 /dev/md0 mkdir /mnt/raid0-drive mount /dev/md0 /mnt/raid0-drive df -h Code Summary LSBLK: - ...