Mount extern NFS filesystem

1. You need to install nfs-command package as follows (open terminal and type the following command):

$ sudo apt-get update
$ sudo apt-get install nfs-common

2. See The List Of All remote shares

$ showmount -e server-Ip-address
$ showmount -e 10.25.1.132

Sample outputs from my 10.25.1.132 NFS server:

Export list for basil:

/volume1/Photo     *
/volume1/Video     *
/volume1/NetBackup 10.25.1.*
/volume1/Music     10.25.1.*

3. Mount Shared Directory

Now mount /Music directory as follows:

$ sudo mkdir /mnt
$ sudo mkdir /mnt/Basil
$ sudo mkdir /mnt/Basil/Music
$ sudo mount -o soft,intr,rsize=8192,wsize=8192 10.25.1.132:/volume1/Music /mnt
$ df -h

Output from df command

Filesystem                   Size  Used Avail Use% Mounted on
/dev/mapper/ubuntu--vg-root   24G  6.0G   16G  28% /
none                         4.0K     0  4.0K   0% /sys/fs/cgroup
udev                         4.1G  4.0K  4.1G   1% /dev
tmpfs                        824M  800K  824M   1% /run
none                         5.0M     0  5.0M   0% /run/lock
none                         4.1G  160K  4.1G   1% /run/shm
none                         100M   56K  100M   1% /run/user
/dev/sda1                    228M   30M  187M  14% /boot
10.25.1.132:/volume1/Music   7.2T  3.8T  3.4T  53% /mnt/Basil/Music

4. How Do I Mount NFS Automatically After Reboot?

Edit /etc/fstab, enter:

$ sudo vi /etc/fstab

Append the following line:

10.25.1.132:/volume1/Music  /mnt/Basil/Music noauto,soft,intr,rsize=8192,wsize=8192

Save and close the file.

5. How Do I Remove Mounted NFS Directory (unmount NFS)?

Type the following command:

$ cd
$ sudo umount /nfs
$ df -h

Leave a Reply