Skip to content
Bots!
Bots!
  • About
    • Myself
    • আমার দোয়া
  • Bookmarks
    • Bookmarks
    • My OCI Bookmarks
    • Useful Proxmox Commands & Links
    • Learning Nano
    • Useful Sites
    • Useful Virtualbox Command
    • Useful MySQL Command
    • Useful Linux Command
    • BTT-CAS
  • Resources
    • Webinar on Cloud Adoption for Project Managers
  • Photos
  • Videos
  • Downloads
Bots!

NFS Server and Client on CentOS

Rumi, September 9, 2015

Assumptions:

NFS Server IP: 172.16.5.100
NFS Client Node1: 172.16.5.101
NFS Client Node2: 172.16.5.102
NFS Client Node3: 172.16.5.103
NFS Client Node4: 172.16.5.104

On the NFS Server & All Client machine as well:

yum install nfs-utils nfs-utils-lib

Edit the exports file that shows what to share and with whom. So run:nano /etc/exports

In my scenerio it was-

/share 172.16.5.101(rw,sync,no_root_squash,no_subtree_check)
/share 172.16.5.102(rw,sync,no_root_squash,no_subtree_check)
/share 172.16.5.103(rw,sync,no_root_squash,no_subtree_check)
/share 172.16.5.104(rw,sync,no_root_squash,no_subtree_check)

Apply the changes-

exportfs -a or /usr/sbin/exportfs -a

With a Restart of NFS Kernel Service-

/etc/init.d/nfs-kernel-server restart

The showmount command will tell you that all went well–for example,

root@share:~# showmount -e
 Export list for share:
 /share 172.16.5.101
 root@share:~#

On the Client Nodes:

We’re going to have to mount the remote shares, so let’s create some mount points. We’ll use the traditional /mnt as a starting point and create a directory called nfs under it to keep our shares consolidated.

The actual directories will correspond with their location on the host server. We can create each directory, and the necessary parent directories, by typing this:

mkdir -p /www

Now that we have some place to put our remote shares, we can mount them by addressing our host server, which in this guide is 1.2.3.4, like this:

mount 172.16.5.100:/share /www

These should mount the shares from our host computer onto our client machine. We can double check this by looking at the available disk space on our client server:

root@psc1:~# df -h
 Filesystem Size Used Avail Use% Mounted on
 /dev/sda1 323M 145M 162M 48% /
 tmpfs 1007M 0 1007M 0% /lib/init/rw
 udev 1002M 128K 1002M 1% /dev
 tmpfs 1007M 0 1007M 0% /dev/shm
 /dev/sda9 2.8G 69M 2.6G 3% /home
 /dev/sda8 234M 6.1M 216M 3% /tmp
 /dev/sda5 2.8G 520M 2.1G 20% /usr
 /dev/sda6 1.4G 173M 1.2G 14% /var
 172.16.5.100:/share 323M 145M 162M 48% /www

As you can see at the bottom, only one of our shares has shown up. This is because both of the shares that we exported are on the same filesystem on the remote server, meaning that they share the same pool of storage. In order for the Avail and Use% columns to remain accurate, only one share may be added into the calculations.

If you want to see all of the NFS shares that you have mounted, you can type:

mount -t nfs
root@psc1:~# mount -t nfs
 172.16.5.100:/share on /www type nfs (rw,addr=172.16.5.100)

Now it’s time to add fstab entry so that the mount becomes permanent even after rebooting-

nano /etc/fstab
172.16.5.100:/share /www nfs auto 0 0

Done!

Source:

https://www.howtoforge.com/setting-up-an-nfs-server-and-client-on-centos-6.3

NFS Server and Client on Debian 6/7

Administrations Configurations (Linux) CentOSNFS

Post navigation

Previous post
Next post

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Myself…

Hi, I am Hasan T. Emdad Rumi, an IT Project Manager & Consultant, Virtualization & Cloud Savvyfrom Dhaka, Bangladesh. I have prior experience in managing numerous local and international projects in the area of Telco VAS & NMC, National Data Center & PKI Naitonal Root and CA Infrastructure. Also engaged with several Offshore Software Development Team.

Worked with Orascom Telecom-Banglalink, Network Elites as VAS partner, BTRC, BTT (Turkey) , Mango Teleservices Limited and Access to Informaiton (A2I-UNDP)

Currently working at Oracle Corporation as Principal Technology Solution and Cloud Architect.

You can reach me [h.t.emdad at gmail.com] and I will be delighted to exchange my views.

Tags

Apache Bind Cacti CentOS CentOS 6 CentOS 7 Debain Debian Debian 10 Debian 11 Debian 12 DKIM Docker endian icinga iptables Jitsi LAMP Letsencrypt Linux Munin MySQL Nagios Nextcloud NFS nginx pfsense php Postfix powerdns Proxmox RDP squid SSH SSL Ubuntu Ubuntu 16 Ubuntu 18 Ubuntu 20 Varnish virtualbox vpn Webmin XCP-NG zimbra

Topics

Recent Posts

  • Install Jitsi on Ubuntu 22.04 / 22.10 April 30, 2025
  • Key Lessons in life April 26, 2025
  • Create Proxmox Backup Server (PBS) on Debian 12 April 19, 2025
  • Add Physical Drive in Proxmox VM Guest April 19, 2025
  • Mount a drive permanently with fstab in Linux April 16, 2025
  • Proxmox 1:1 NAT routing March 30, 2025
  • Installation steps of WSL – Windows Subsystem for Linux March 8, 2025
  • Enabling Nested Virtualization In Proxmox March 8, 2025
  • How to Modify/Change console/SSH login banner for Proxmox Virtual Environment (Proxmox VE / PVE) March 3, 2025
  • Install Proxmox Backup Server on Debian 12 February 12, 2025

Archives

Top Posts & Pages

  • Install Jitsi on Ubuntu 22.04 / 22.10
©2025 Bots! | WordPress Theme by SuperbThemes