Skip to Content
  • +31 653-919-302
Cafayate.Net
  • 0
  • 0
  • Sign in
  • Nederlands English (US) Español (AR)
  • Contact Us
  • Home
  • Blog
  • Jobs
  • Contact us
Cafayate.Net
  • 0
  • 0
    • Home
    • Blog
    • Jobs
    • Contact us
  • +31 653-919-302
  • Nederlands English (US) Español (AR)
  • Sign in
  • Contact Us

Setup NFS server on ubuntu 14.04

  • All Blogs
  • Tech Blog
  • Setup NFS server on ubuntu 14.04
  • March 5, 2021 by
    Administrator

     

    NFS ( Network file systems ) is used to share files with other computers over the network.
    It is mainly used for centralized home folders. This article explains, how to setup NFS server on ubuntu 14.04 . also explains about mounting nfs shares on client machines (Centos and ubuntu).

    Setup NFS server on ubuntu 14.04

    Step 1 » Update the repositories.
    sudo apt-get update
    Step 2 » Install nfs server package by typing the command.
    sudo apt-get install nfs-kernel-server
    Step 3 » Make directory you want to share with other computers.
    sudo mkdir /shome
    Step 4 » Here /etc/exports is the main config file for NFS.
    See the below examples and add share directories to the config file based on your requirement.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    #Share access to all networks
    /shome        *(rw,sync,no_root_squash)
    #Share access to particular network
    /shome1       192.168.1.1/24(rw,sync,no_root_squash)
    #Share access to particular host
    /shome2       host.example.com(rw,sync,no_root_squash)
    /shome3       192.168.1.200(rw,sync,no_root_squash)
    #Share access to all hosts in particular domain
    /shome4       *.krizna.com(rw,sync,no_root_squash)

    Step 5 » Start service by the below command.
    sudo /etc/init.d/nfs-kernel-server start
    Step 6 » Now check the NFS share status.
    krizna@leela:~$ sudo exportfs -u
    /shome1 192.168.1.1/24
    /shome2 192.168.1.200
    /shome3 *.krizna.com
    /shome world

    That’s it .. NSF server config is over .. Continue for Client setup.

    Ubuntu – Client

    Step 1 » Install nfs client and dependencies .
    sudo apt-get install nfs-common rpcbind
    Step 2 » Create a directory /rhome .
    sudo mkdir /rhome
    Step 3 » Mount the remote share /shome on local directory /rhome.
    sudo mount 192.168.1.10:/shome /rhome
    add the following line in /etc/fstab file for permanent mount.
    192.168.1.10:/shome /rhome nfs rw,sync,hard,intr 0 0
    Step 4 » Check the mounted share directory using mount command.
    krizna@client:~$ mount
    rpc_pipefs on /run/rpc_pipefs type rpc_pipefs (rw)
    192.168.1.10:/shome on /rhome type nfs (rw,vers=4,addr=192.168.1.10,clientaddr=192.168.1.201)

    Now local rhome is remote NFS directory . whatever data copied to that folder will be stored in remote directory /shome.

    Centos – Client

    The below steps can be used on REDHAT and Fedora .
    Step 1 » Install nfs client and dependencies
    yum install nfs-utils nfs-utils-lib
    Step 2 » Create a directory /rhome .
    mkdir /rhome
    Step 3 » Mount remote NFS share directory shome on rhome local directory.
    mount 192.168.1.10:/shome /rhome
    add the following line in /etc/fstab file for permanent mount.
    192.168.1.10:/shome/ /rhome/ nfs rw,sync,hard,intr 0 0
    File will looks like

    1
    2
    3
    4
    devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
    sysfs                   /sys                    sysfs   defaults        0 0
    proc                    /proc                   proc    defaults        0 0
    192.168.1.10:/shome/    /rhome/                nfs     rw,sync,hard,intr 0 0

    Step 4 » Check the mount status by the below command.
    [root@client ~]# mount
    sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
    nfsd on /proc/fs/nfsd type nfsd (rw)
    192.168.1.10:/shome on /rhome type nfs (rw,vers=4,addr=192.168.1.10,clientaddr=192.168.1.200)

    Now local rhome is remote NFS directory . whatever data copied to that folder will be stored in remote directory /shome.

     

    in Tech Blog
    Install Virtualmin, Nginx 1.10, PHP 7, MySQL 5.7 on Ubuntu 16.04 Server

    Designed for companies

    We are a team of passionate people whose goal is to improve everyone's life through disruptive products. We build great products to solve your business problems. Our products are designed for small to medium size companies willing to optimize their performance.

    Get in touch

    Plantexel
    Pedernera
    Salta Capital 
    Argenina

    • +31 653-919-302
    • [email protected]
    Follow us
    Copyright © Plantexel
    Nederlands | English (US) | Español (AR)