How to Setup NFS (Network File System) on RHEL/CentOS/Fedora and Debian/Ubuntu

Best Affordable Linux and WordPress Services For Your Business
Outsource Your Linux and WordPress Project and Get it Promptly Completed Remotely and Delivered Online.

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Tarunika Shrivastava

I am a linux server admin and love to play with Linux and all other distributions of it. I am working as System Engineer with a Web Hosting Company.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

121 Responses

  1. Sai Prasad Manchikanti says:

    Thank you for the article. I think you need to add the line “run exportfs -a command” after creating a entry in /etc/exports file without running that command shares wont be accessible from clients.

  2. Ghata Saxena says:


    I have mounted directory from windows server to Linux server. When I run mount -a on Linux server, it gives error:

    mount.nfs: /directory_name is busy or already mounted.

    I want to know the root cause for this. I know this can be solved by unmounting that directory and mounting again but what is the root cause?

  3. RL says:

    This information is spread out in so many places across the web, so thank you for this concise write-up.

    I got this up and running except I’m unable to permanently mount the export directory so that my client automatically loads it. I did something bad to fstab and my computer (R Pi) would not boot. Had no choice but to reformat it.

    Got it to work fine by manually mounting, so I know I’m close…thanks for any pointers!

  4. Leonard Mbibi says:

    First, I thank you for your lessons, they’re one of the best.

    In preparation for the LFCS exam, knowing that some commands are deprecated and some files changed, for example:

    [[email protected] ~]# /etc/init.d/portmap start
    [[email protected] ~]# /etc/init.d/nfs start
    [[email protected] ~]# chkconfig --level 35 portmap on
    [[email protected] ~]# chkconfig --level 35 nfs on

    These are not available in latest Centos 7.

    Does one has a choice of the version of Linux machine to use in the exam? As I am new to Linux, I am only conversant with latest commands.


  5. Jim Fecteau says:

    Excellent summary of the topic. Thank you!

  6. jagan says:

    clnt_create: RPC: Program not registered (how to solve)

  7. Gautam says:

    Thank you so much for sharing article and easy to understand and helpful.

  8. Zafar says:

    Hi Tarunika,

    Thanks for such a nice article on NFS server and client. It will help the readers to resolve NFS related issue.

    Best Regards

  9. Dinesh Kumar says:

    Hi ,

    Thank you for sharing this article, very helpful 

  10. sivakrishna says:

    Hi ,

    Thank you for sharing this article, very helpful ,

    when we are mounting with rw permissions in client side, can we restrict root/normal user to delete this nfs shared folders from client side.

    My Export config in server side

    /files   (rw,all_squash,anonuid=99,anongid=99)

    Mounting with below command

    mount -t nfs -o rw   ipaddresss:/files/frontend_shared /fe_shared/

    please advise.


Got something to say? Join the discussion.

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.