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

If you have any questions or problems regarding this article and want help within 24 Hours? Ask Now

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.

Receive Your Free Complimentary eBook NOW! -

Download Free Linux eBooks

Advanced Bash-Scripting Guide
Linux Bible
A Newbie's Getting Started Guide to Linux
Ubuntu Linux Toolbox: 1000+ Commands

50 Responses

  1. Freddy says:

    Hi, great post. This helped me a lot. I’ll appreciate if you would explain what is the best file-system choice when shared resource is mounting on client in their different contexts. I’ll appreciate that. Thanks in advance!!!

  2. Shouvik says:

    Hi all,

    Can we have a tutorial on “Mounting NFS Share using Autofs”???

    Even we can use ‘_netdev’ instead of ‘defaults’ in fstab configuration, to avoid Boot Time Delay.

    Example:

    192.168.0.100:/nfsshare /mnt nfs defaults 0 0

    May replaced with

    192.168.0.100:/nfsshare /mnt nfs _netdev 0 0

    Regards,
    Shouvik

  3. Axeron says:

    Hi, thanks for the wiki, only keep in mind that in the last version of Ubuntu, nfs-utils and nfs-utils-lib are no longer available.

  4. Mohammad hadi Tabarzad says:

    that was useful!
    Thanks.

  5. Michael says:

    There is a typo in the /etc/fstab configuration section
    192.168.0.100:/nfsshare /mnt nfs defauls 0 0
    should be
    192.168.0.100:/nfsshare /mnt nfs defaults 0 0

  6. k says:

    Difference Between NFS and Samba???

  7. BABU B says:

    This website Really very help full to me to configure the NFS server & Client. Thanks

  8. abdul khan says:

    Hi, i am configured squid proxy (Transparent proxy)on centos server ,but never show https request log in /var/log/squid

  9. Dave says:

    OK, needing to do a silly RSYNC across two Centos 6.5 servers has seemed to be more problematic with NFS than it used to be with Ubuntu. Security over convenience, I suppose.

    Server:
    #sudo yum install nfs* -y
    #sudo nano /etc/exports
    add your export, in my case:
    /mnt/data 192.168.2.0/24(rw,sync,no_root_squash,no_subtree_check)
    #sudo nano /etc/sysconfig/iptables
    (add the following below the “*filter*, make sure to adjust IP)
    -A INPUT -s 192.168.2.0/24 -m state –state NEW -p udp –dport 111 -j ACCEPT
    -A INPUT -s 192.168.2.0/24 -m state –state NEW -p tcp –dport 111 -j ACCEPT
    -A INPUT -s 192.168.2.0/24 -m state –state NEW -p tcp –dport 2049 -j ACCEPT
    -A INPUT -s 192.168.2.0/24 -m state –state NEW -p tcp –dport 32803 -j ACCEPT
    -A INPUT -s 192.168.2.0/24 -m state –state NEW -p udp –dport 32769 -j ACCEPT
    -A INPUT -s 192.168.2.0/24 -m state –state NEW -p tcp –dport 892 -j ACCEPT
    -A INPUT -s 192.168.2.0/24 -m state –state NEW -p udp –dport 892 -j ACCEPT
    -A INPUT -s 192.168.2.0/24 -m state –state NEW -p tcp –dport 875 -j ACCEPT
    -A INPUT -s 192.168.2.0/24 -m state –state NEW -p udp –dport 875 -j ACCEPT
    -A INPUT -s 192.168.2.0/24 -m state –state NEW -p tcp –dport 662 -j ACCEPT
    -A INPUT -s 192.168.2.0/24 -m state –state NEW -p udp –dport 662 -j ACCEPT

    #sudo service iptables restart
    #sudo service nfs restart

    Centos client:
    #sudo yum install nfs* -y
    make sure you can ping the shares

  10. Dave N says:

    On Fedora 19, had to use the firewall GUI to set these to “public”, then everything worked:

    mountd
    nfs
    rpc-bind

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Join Over 80000+ Linux Users
  1. 53,676
  2. 2,838
  3. 20,639

Enter your email to get latest Linux Howto's