Ir al contenido
  • +31 653-919-302
Cafayate.Net
  • 0
  • 0
  • Inicia sesión
  • Nederlands English (US) Español (AR)
  • Contáctanos
  • Inicio
  • Blog
  • Empleos
  • Contáctanos
Cafayate.Net
  • 0
  • 0
    • Inicio
    • Blog
    • Empleos
    • Contáctanos
  • +31 653-919-302
  • Nederlands English (US) Español (AR)
  • Inicia sesión
  • Contáctanos

Setup NFS server on ubuntu 14.04

  • Todos los blogs
  • Tech Blog
  • Setup NFS server on ubuntu 14.04
  • 5 de marzo de 2021 por
    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.

     

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

    Diseñado para empresas

    Somos un equipo de personas apasionadas cuyo objetivo es mejorar la vida de todos a través de productos revolucionarios. Creamos grandes productos para resolver sus problemas empresariales. Nuestros productos están diseñados para pequeñas y medianas empresas dispuestas a optimizar su rendimiento.

    Contáctenos

    Plantexel
    Pedernera
    Salta Capital 
    Argenina

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