Lesson 6

Date: 2/22/2017
Network File System (NFS)
Linux System Administration


Exercise: NFS server configuration
  • Install NFS server packages on master VM by following the instructions below.
    apt-get install rpcbind nfs-common nfs-kernel-server 
    
    Create a directory to export:
    mkdir -p /NFS/home
    
    Create a new user with home directory in /NFS/home:
    /usr/sbin/groupadd -g 666 edward
    /usr/sbin/useradd -m -s /bin/bash -u 666 -g 666 -d /NFS/home/edward edward
    
    Copy some files from /etc into directory /NFS/home/edward and give them ownership "edward":
    cp /etc/hosts /NFS/home/edward
    cp /etc/nsswitch.conf /NFS/home/edward
    chown edward:edward /NFS/home/edward/*
    
    Then
    cp /etc/securetty /NFS/home/edward 
    
    and live it with root ownreship.
    Modify file /etc/exports to include the following entry
    /NFS/home  n01(rw)
    
    Make sure host n01 is reachable from master:
    ping -c 2  n01
    
    Start rpcbind and all the NFSv3 and NFSv4 related services:
    systemctl restart rpcbind
    systemctl restart rpc-statd
    systemctl restart nfs-kernel-server
    
    Make sure the services are running by executing command rpcinfo:
    rpcinfo -p
    
    You should see the following:
       program vers proto   port  service
        100000    4   tcp    111  portmapper
        100000    3   tcp    111  portmapper
        100000    2   tcp    111  portmapper
        100000    4   udp    111  portmapper
        100000    3   udp    111  portmapper
        100000    2   udp    111  portmapper
        100003    2   tcp   2049  nfs
        100003    3   tcp   2049  nfs
        100003    4   tcp   2049  nfs
        100227    2   tcp   2049
        100227    3   tcp   2049
        100003    2   udp   2049  nfs
        100003    3   udp   2049  nfs
        100003    4   udp   2049  nfs
        100227    2   udp   2049
        100227    3   udp   2049
        100021    1   udp  57277  nlockmgr
        100021    3   udp  57277  nlockmgr
        100021    4   udp  57277  nlockmgr
        100021    1   tcp  47349  nlockmgr
        100021    3   tcp  47349  nlockmgr
        100021    4   tcp  47349  nlockmgr
        100005    1   udp  42346  mountd
        100005    1   tcp  56213  mountd
        100005    2   udp  55259  mountd
        100005    2   tcp  50545  mountd
        100005    3   udp  57750  mountd
        100005    3   tcp  56222  mountd
        100024    1   udp  40010  status
        100024    1   tcp  36849  status
    




  • Take me to the Course Website