Not mounting Multiple NFS Share Directories using fstab on RHEL 7












0















Hello everyone i am not able to mount multiple NFS Share Directories using fstab on RHEL 7. Check out my LAB configuration.



I want to ask question using nfs and mounting by fstab only one nfs directory can be mount. if no how to mount multiple directory.



LAB



server.example.com 192.168.2.2/24



client.example.com 192.168.2.1/24



On Server



nfs share folder are
/test1
/test2



Disable firewalld and selinux is in permissive mode on server and client.



On Server



[root@server ~]# yum install nfs-utils
[root@server ~]# systemctl enable rpcbind
[root@server ~]# systemctl start rpcbind
[root@server ~]# systemctl start nfs-server
[root@server ~]# systemctl start nfs-secure


[root@server ~]# mkdir /test1
[root@server ~]# mkdir /test2
[root@server ~]# ls /test*
/test1:

/test2:

[root@server ~]# chmod 777 /test1
[root@server ~]# chmod 777 /test2


[root@server ~]# vim /etc/exports
[root@server ~]# cat /etc/exports
/test1 192.168.2.1(rw,sync,no_root_squash)
/test2 192.168.2.1(rw,sync,no_root_squash)


[root@server ~]# exportfs -r



[root@server ~]# exportfs -v
/test1 192.168.2.1(rw,wdelay,no_root_squash,no_subtree_check,sec=sys,rw,secure,no_root_squash,no_all_squash)
/test2 192.168.2.1(rw,wdelay,no_root_squash,no_subtree_check,sec=sys,rw,secure,no_root_squash,no_all_squash)


[root@server ~]# systemctl stop firewalld.service
[root@server ~]# systemctl disable firewalld.service
[root@server ~]# sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: permissive
Mode from config file: permissive


ON Client



[root@client ~]# systemctl enable rpcbind
[root@client ~]# systemctl start rpcbind

[root@client ~]# setenforce 0
[root@client ~]# vim /etc/sysconfig/selinux
[root@client ~]# sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: permissive
Mode from config file: permissive
[root@client ~]# systemctl stop firewalld
[root@client ~]# systemctl disble firewalld


[root@client ~]# showmount -e 192.168.2.2
Export list for 192.168.2.2:
/test2 192.168.2.1tes
/test1 192.168.2.1

[root@client ~]# mkdir /mnt/nfstest1
[root@client ~]# mkdir /mnt/nfstest2
[root@client ~]# chmod 777 /mnt/nfstest1
[root@client ~]# chmod 777 /mnt/nfstest2


Check fstab file



[root@client ~]# vim /etc/fstab

[root@client ~]# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Wed Apr 26 08:01:03 2017
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=8cfced80-d77a-41a6-a7ee-9b41ebea88b2 / xfs defaults 1 1
UUID=ad9e8442-335f-478c-81af-b77e1ac88549 /boot xfs defaults 1 2
UUID=e55cb2d8-4461-4792-944c-1b76225dd13a /home xfs defaults 1 2
UUID=ffbc9edf-42ce-4d82-af5c-b2ff1cff5a68 /usr xfs defaults 1 2
UUID=556f0e53-bfa3-4639-9d47-ba1c70299393 /var xfs defaults 1 2
UUID=a855e109-f05f-4bfe-bfc9-a06f10d294f1 swap swap defaults 0 0
192.168.2.2:/test1 /mnt/nfstest1 nfs rw,sync 0 0
192.168.2.2:/test2 /mnt/nfstest2 nfs rw,sync 0 0


[root@client ~]# mount -a



df -h show only one nfs directory mounted /mnt/nfstest1



[root@client ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 9.8G 70M 9.7G 1% /
devtmpfs 354M 0 354M 0% /dev
tmpfs 363M 0 363M 0% /dev/shm
tmpfs 363M 5.2M 357M 2% /run
tmpfs 363M 0 363M 0% /sys/fs/cgroup
/dev/sda5 9.8G 2.8G 7.0G 29% /usr
/dev/sda3 9.8G 33M 9.8G 1% /home
/dev/sda1 2.0G 107M 1.9G 6% /boot
/dev/sda6 9.8G 3.8G 6.1G 39% /var
192.168.2.2:/test1 9.8G 71M 9.7G 1% /mnt/nfstest1


but on mount command show both nfs directory



[root@client ~]# mount | grep nfstest*
192.168.2.2:/test1 on /mnt/nfstest1 type nfs4 (rw,relatime,sync,vers=4.0,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.2.1,local_lock=none,addr=192.168.2.2)

192.168.2.2:/test2 on /mnt/nfstest2 type nfs4 (rw,relatime,sync,vers=4.0,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.2.1,local_lock=none,addr=192.168.2.2)


i have reboot



check my status again,again only one nfs share directory is mounted and i.e is /mnt/nfstest2 and /mnt/nfstest1 gone.
why is this happing i have fire Right option in /etc/fstab.
can some one tell me is that right.



login as: root
root@192.168.2.1's password:
Last login: Wed May 10 22:37:20 2017 from 192.168.2.100

[root@client ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 9.8G 70M 9.7G 1% /
devtmpfs 354M 0 354M 0% /dev
tmpfs 363M 0 363M 0% /dev/shm
tmpfs 363M 5.2M 357M 2% /run
tmpfs 363M 0 363M 0% /sys/fs/cgroup
/dev/sda5 9.8G 2.8G 7.0G 29% /usr
/dev/sda1 2.0G 107M 1.9G 6% /boot
/dev/sda3 9.8G 33M 9.8G 1% /home
/dev/sda6 9.8G 3.8G 6.1G 39% /var
192.168.2.2:/test2 9.8G 71M 9.7G 1% /mnt/nfstest2

[root@client ~]# mount | grep nfstest*
192.168.2.2:/test2 on /mnt/nfstest2 type nfs4 (rw,relatime,sync,vers=4.0,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.2.1,local_lock=none,addr=192.168.2.2)

192.168.2.2:/test1 on /mnt/nfstest1 type nfs4 (rw,relatime,sync,vers=4.0,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.2.1,local_lock=none,addr=192.168.2.2)


[root@client ~]# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Wed Apr 26 08:01:03 2017
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=8cfced80-d77a-41a6-a7ee-9b41ebea88b2 / xfs defaults 1 1
UUID=ad9e8442-335f-478c-81af-b77e1ac88549 /boot xfs defaults 1 2
UUID=e55cb2d8-4461-4792-944c-1b76225dd13a /home xfs defaults 1 2
UUID=ffbc9edf-42ce-4d82-af5c-b2ff1cff5a68 /usr xfs defaults 1 2
UUID=556f0e53-bfa3-4639-9d47-ba1c70299393 /var xfs defaults 1 2
UUID=a855e109-f05f-4bfe-bfc9-a06f10d294f1 swap swap defaults 0 0
192.168.2.2:/test1 /mnt/nfstest1 nfs rw,sync 0 0
192.168.2.2:/test2 /mnt/nfstest2 nfs rw,sync 0 0


Here multiple nfs share directory is not mounting at once .
On client /etc/fstab



192.168.2.2:/test1 /mnt/nfstest1 nfs rw,sync 0 0
192.168.2.2:/test2 /mnt/nfstest2 nfs rw,sync 0 0


after fireing mount -a



i am getting /mnt/nfstest1



192.168.2.2:/test1  9.8G   71M  9.7G   1% /mnt/nfstest1 


but after restarting client i am getting vice-versa . WHY



Can some one help me to solve this problem



Note NFS directory are made on single / file system on server.



And mounted on /mnt/test1 and /mnt/test2 on client.



Thank You
Sagar Dalvi










share|improve this question
















bumped to the homepage by Community 9 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    0















    Hello everyone i am not able to mount multiple NFS Share Directories using fstab on RHEL 7. Check out my LAB configuration.



    I want to ask question using nfs and mounting by fstab only one nfs directory can be mount. if no how to mount multiple directory.



    LAB



    server.example.com 192.168.2.2/24



    client.example.com 192.168.2.1/24



    On Server



    nfs share folder are
    /test1
    /test2



    Disable firewalld and selinux is in permissive mode on server and client.



    On Server



    [root@server ~]# yum install nfs-utils
    [root@server ~]# systemctl enable rpcbind
    [root@server ~]# systemctl start rpcbind
    [root@server ~]# systemctl start nfs-server
    [root@server ~]# systemctl start nfs-secure


    [root@server ~]# mkdir /test1
    [root@server ~]# mkdir /test2
    [root@server ~]# ls /test*
    /test1:

    /test2:

    [root@server ~]# chmod 777 /test1
    [root@server ~]# chmod 777 /test2


    [root@server ~]# vim /etc/exports
    [root@server ~]# cat /etc/exports
    /test1 192.168.2.1(rw,sync,no_root_squash)
    /test2 192.168.2.1(rw,sync,no_root_squash)


    [root@server ~]# exportfs -r



    [root@server ~]# exportfs -v
    /test1 192.168.2.1(rw,wdelay,no_root_squash,no_subtree_check,sec=sys,rw,secure,no_root_squash,no_all_squash)
    /test2 192.168.2.1(rw,wdelay,no_root_squash,no_subtree_check,sec=sys,rw,secure,no_root_squash,no_all_squash)


    [root@server ~]# systemctl stop firewalld.service
    [root@server ~]# systemctl disable firewalld.service
    [root@server ~]# sestatus
    SELinux status: enabled
    SELinuxfs mount: /sys/fs/selinux
    SELinux root directory: /etc/selinux
    Loaded policy name: targeted
    Current mode: permissive
    Mode from config file: permissive


    ON Client



    [root@client ~]# systemctl enable rpcbind
    [root@client ~]# systemctl start rpcbind

    [root@client ~]# setenforce 0
    [root@client ~]# vim /etc/sysconfig/selinux
    [root@client ~]# sestatus
    SELinux status: enabled
    SELinuxfs mount: /sys/fs/selinux
    SELinux root directory: /etc/selinux
    Loaded policy name: targeted
    Current mode: permissive
    Mode from config file: permissive
    [root@client ~]# systemctl stop firewalld
    [root@client ~]# systemctl disble firewalld


    [root@client ~]# showmount -e 192.168.2.2
    Export list for 192.168.2.2:
    /test2 192.168.2.1tes
    /test1 192.168.2.1

    [root@client ~]# mkdir /mnt/nfstest1
    [root@client ~]# mkdir /mnt/nfstest2
    [root@client ~]# chmod 777 /mnt/nfstest1
    [root@client ~]# chmod 777 /mnt/nfstest2


    Check fstab file



    [root@client ~]# vim /etc/fstab

    [root@client ~]# cat /etc/fstab

    #
    # /etc/fstab
    # Created by anaconda on Wed Apr 26 08:01:03 2017
    #
    # Accessible filesystems, by reference, are maintained under '/dev/disk'
    # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
    #
    UUID=8cfced80-d77a-41a6-a7ee-9b41ebea88b2 / xfs defaults 1 1
    UUID=ad9e8442-335f-478c-81af-b77e1ac88549 /boot xfs defaults 1 2
    UUID=e55cb2d8-4461-4792-944c-1b76225dd13a /home xfs defaults 1 2
    UUID=ffbc9edf-42ce-4d82-af5c-b2ff1cff5a68 /usr xfs defaults 1 2
    UUID=556f0e53-bfa3-4639-9d47-ba1c70299393 /var xfs defaults 1 2
    UUID=a855e109-f05f-4bfe-bfc9-a06f10d294f1 swap swap defaults 0 0
    192.168.2.2:/test1 /mnt/nfstest1 nfs rw,sync 0 0
    192.168.2.2:/test2 /mnt/nfstest2 nfs rw,sync 0 0


    [root@client ~]# mount -a



    df -h show only one nfs directory mounted /mnt/nfstest1



    [root@client ~]# df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/sda2 9.8G 70M 9.7G 1% /
    devtmpfs 354M 0 354M 0% /dev
    tmpfs 363M 0 363M 0% /dev/shm
    tmpfs 363M 5.2M 357M 2% /run
    tmpfs 363M 0 363M 0% /sys/fs/cgroup
    /dev/sda5 9.8G 2.8G 7.0G 29% /usr
    /dev/sda3 9.8G 33M 9.8G 1% /home
    /dev/sda1 2.0G 107M 1.9G 6% /boot
    /dev/sda6 9.8G 3.8G 6.1G 39% /var
    192.168.2.2:/test1 9.8G 71M 9.7G 1% /mnt/nfstest1


    but on mount command show both nfs directory



    [root@client ~]# mount | grep nfstest*
    192.168.2.2:/test1 on /mnt/nfstest1 type nfs4 (rw,relatime,sync,vers=4.0,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.2.1,local_lock=none,addr=192.168.2.2)

    192.168.2.2:/test2 on /mnt/nfstest2 type nfs4 (rw,relatime,sync,vers=4.0,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.2.1,local_lock=none,addr=192.168.2.2)


    i have reboot



    check my status again,again only one nfs share directory is mounted and i.e is /mnt/nfstest2 and /mnt/nfstest1 gone.
    why is this happing i have fire Right option in /etc/fstab.
    can some one tell me is that right.



    login as: root
    root@192.168.2.1's password:
    Last login: Wed May 10 22:37:20 2017 from 192.168.2.100

    [root@client ~]# df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/sda2 9.8G 70M 9.7G 1% /
    devtmpfs 354M 0 354M 0% /dev
    tmpfs 363M 0 363M 0% /dev/shm
    tmpfs 363M 5.2M 357M 2% /run
    tmpfs 363M 0 363M 0% /sys/fs/cgroup
    /dev/sda5 9.8G 2.8G 7.0G 29% /usr
    /dev/sda1 2.0G 107M 1.9G 6% /boot
    /dev/sda3 9.8G 33M 9.8G 1% /home
    /dev/sda6 9.8G 3.8G 6.1G 39% /var
    192.168.2.2:/test2 9.8G 71M 9.7G 1% /mnt/nfstest2

    [root@client ~]# mount | grep nfstest*
    192.168.2.2:/test2 on /mnt/nfstest2 type nfs4 (rw,relatime,sync,vers=4.0,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.2.1,local_lock=none,addr=192.168.2.2)

    192.168.2.2:/test1 on /mnt/nfstest1 type nfs4 (rw,relatime,sync,vers=4.0,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.2.1,local_lock=none,addr=192.168.2.2)


    [root@client ~]# cat /etc/fstab

    #
    # /etc/fstab
    # Created by anaconda on Wed Apr 26 08:01:03 2017
    #
    # Accessible filesystems, by reference, are maintained under '/dev/disk'
    # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
    #
    UUID=8cfced80-d77a-41a6-a7ee-9b41ebea88b2 / xfs defaults 1 1
    UUID=ad9e8442-335f-478c-81af-b77e1ac88549 /boot xfs defaults 1 2
    UUID=e55cb2d8-4461-4792-944c-1b76225dd13a /home xfs defaults 1 2
    UUID=ffbc9edf-42ce-4d82-af5c-b2ff1cff5a68 /usr xfs defaults 1 2
    UUID=556f0e53-bfa3-4639-9d47-ba1c70299393 /var xfs defaults 1 2
    UUID=a855e109-f05f-4bfe-bfc9-a06f10d294f1 swap swap defaults 0 0
    192.168.2.2:/test1 /mnt/nfstest1 nfs rw,sync 0 0
    192.168.2.2:/test2 /mnt/nfstest2 nfs rw,sync 0 0


    Here multiple nfs share directory is not mounting at once .
    On client /etc/fstab



    192.168.2.2:/test1 /mnt/nfstest1 nfs rw,sync 0 0
    192.168.2.2:/test2 /mnt/nfstest2 nfs rw,sync 0 0


    after fireing mount -a



    i am getting /mnt/nfstest1



    192.168.2.2:/test1  9.8G   71M  9.7G   1% /mnt/nfstest1 


    but after restarting client i am getting vice-versa . WHY



    Can some one help me to solve this problem



    Note NFS directory are made on single / file system on server.



    And mounted on /mnt/test1 and /mnt/test2 on client.



    Thank You
    Sagar Dalvi










    share|improve this question
















    bumped to the homepage by Community 9 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      0












      0








      0








      Hello everyone i am not able to mount multiple NFS Share Directories using fstab on RHEL 7. Check out my LAB configuration.



      I want to ask question using nfs and mounting by fstab only one nfs directory can be mount. if no how to mount multiple directory.



      LAB



      server.example.com 192.168.2.2/24



      client.example.com 192.168.2.1/24



      On Server



      nfs share folder are
      /test1
      /test2



      Disable firewalld and selinux is in permissive mode on server and client.



      On Server



      [root@server ~]# yum install nfs-utils
      [root@server ~]# systemctl enable rpcbind
      [root@server ~]# systemctl start rpcbind
      [root@server ~]# systemctl start nfs-server
      [root@server ~]# systemctl start nfs-secure


      [root@server ~]# mkdir /test1
      [root@server ~]# mkdir /test2
      [root@server ~]# ls /test*
      /test1:

      /test2:

      [root@server ~]# chmod 777 /test1
      [root@server ~]# chmod 777 /test2


      [root@server ~]# vim /etc/exports
      [root@server ~]# cat /etc/exports
      /test1 192.168.2.1(rw,sync,no_root_squash)
      /test2 192.168.2.1(rw,sync,no_root_squash)


      [root@server ~]# exportfs -r



      [root@server ~]# exportfs -v
      /test1 192.168.2.1(rw,wdelay,no_root_squash,no_subtree_check,sec=sys,rw,secure,no_root_squash,no_all_squash)
      /test2 192.168.2.1(rw,wdelay,no_root_squash,no_subtree_check,sec=sys,rw,secure,no_root_squash,no_all_squash)


      [root@server ~]# systemctl stop firewalld.service
      [root@server ~]# systemctl disable firewalld.service
      [root@server ~]# sestatus
      SELinux status: enabled
      SELinuxfs mount: /sys/fs/selinux
      SELinux root directory: /etc/selinux
      Loaded policy name: targeted
      Current mode: permissive
      Mode from config file: permissive


      ON Client



      [root@client ~]# systemctl enable rpcbind
      [root@client ~]# systemctl start rpcbind

      [root@client ~]# setenforce 0
      [root@client ~]# vim /etc/sysconfig/selinux
      [root@client ~]# sestatus
      SELinux status: enabled
      SELinuxfs mount: /sys/fs/selinux
      SELinux root directory: /etc/selinux
      Loaded policy name: targeted
      Current mode: permissive
      Mode from config file: permissive
      [root@client ~]# systemctl stop firewalld
      [root@client ~]# systemctl disble firewalld


      [root@client ~]# showmount -e 192.168.2.2
      Export list for 192.168.2.2:
      /test2 192.168.2.1tes
      /test1 192.168.2.1

      [root@client ~]# mkdir /mnt/nfstest1
      [root@client ~]# mkdir /mnt/nfstest2
      [root@client ~]# chmod 777 /mnt/nfstest1
      [root@client ~]# chmod 777 /mnt/nfstest2


      Check fstab file



      [root@client ~]# vim /etc/fstab

      [root@client ~]# cat /etc/fstab

      #
      # /etc/fstab
      # Created by anaconda on Wed Apr 26 08:01:03 2017
      #
      # Accessible filesystems, by reference, are maintained under '/dev/disk'
      # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
      #
      UUID=8cfced80-d77a-41a6-a7ee-9b41ebea88b2 / xfs defaults 1 1
      UUID=ad9e8442-335f-478c-81af-b77e1ac88549 /boot xfs defaults 1 2
      UUID=e55cb2d8-4461-4792-944c-1b76225dd13a /home xfs defaults 1 2
      UUID=ffbc9edf-42ce-4d82-af5c-b2ff1cff5a68 /usr xfs defaults 1 2
      UUID=556f0e53-bfa3-4639-9d47-ba1c70299393 /var xfs defaults 1 2
      UUID=a855e109-f05f-4bfe-bfc9-a06f10d294f1 swap swap defaults 0 0
      192.168.2.2:/test1 /mnt/nfstest1 nfs rw,sync 0 0
      192.168.2.2:/test2 /mnt/nfstest2 nfs rw,sync 0 0


      [root@client ~]# mount -a



      df -h show only one nfs directory mounted /mnt/nfstest1



      [root@client ~]# df -h
      Filesystem Size Used Avail Use% Mounted on
      /dev/sda2 9.8G 70M 9.7G 1% /
      devtmpfs 354M 0 354M 0% /dev
      tmpfs 363M 0 363M 0% /dev/shm
      tmpfs 363M 5.2M 357M 2% /run
      tmpfs 363M 0 363M 0% /sys/fs/cgroup
      /dev/sda5 9.8G 2.8G 7.0G 29% /usr
      /dev/sda3 9.8G 33M 9.8G 1% /home
      /dev/sda1 2.0G 107M 1.9G 6% /boot
      /dev/sda6 9.8G 3.8G 6.1G 39% /var
      192.168.2.2:/test1 9.8G 71M 9.7G 1% /mnt/nfstest1


      but on mount command show both nfs directory



      [root@client ~]# mount | grep nfstest*
      192.168.2.2:/test1 on /mnt/nfstest1 type nfs4 (rw,relatime,sync,vers=4.0,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.2.1,local_lock=none,addr=192.168.2.2)

      192.168.2.2:/test2 on /mnt/nfstest2 type nfs4 (rw,relatime,sync,vers=4.0,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.2.1,local_lock=none,addr=192.168.2.2)


      i have reboot



      check my status again,again only one nfs share directory is mounted and i.e is /mnt/nfstest2 and /mnt/nfstest1 gone.
      why is this happing i have fire Right option in /etc/fstab.
      can some one tell me is that right.



      login as: root
      root@192.168.2.1's password:
      Last login: Wed May 10 22:37:20 2017 from 192.168.2.100

      [root@client ~]# df -h
      Filesystem Size Used Avail Use% Mounted on
      /dev/sda2 9.8G 70M 9.7G 1% /
      devtmpfs 354M 0 354M 0% /dev
      tmpfs 363M 0 363M 0% /dev/shm
      tmpfs 363M 5.2M 357M 2% /run
      tmpfs 363M 0 363M 0% /sys/fs/cgroup
      /dev/sda5 9.8G 2.8G 7.0G 29% /usr
      /dev/sda1 2.0G 107M 1.9G 6% /boot
      /dev/sda3 9.8G 33M 9.8G 1% /home
      /dev/sda6 9.8G 3.8G 6.1G 39% /var
      192.168.2.2:/test2 9.8G 71M 9.7G 1% /mnt/nfstest2

      [root@client ~]# mount | grep nfstest*
      192.168.2.2:/test2 on /mnt/nfstest2 type nfs4 (rw,relatime,sync,vers=4.0,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.2.1,local_lock=none,addr=192.168.2.2)

      192.168.2.2:/test1 on /mnt/nfstest1 type nfs4 (rw,relatime,sync,vers=4.0,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.2.1,local_lock=none,addr=192.168.2.2)


      [root@client ~]# cat /etc/fstab

      #
      # /etc/fstab
      # Created by anaconda on Wed Apr 26 08:01:03 2017
      #
      # Accessible filesystems, by reference, are maintained under '/dev/disk'
      # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
      #
      UUID=8cfced80-d77a-41a6-a7ee-9b41ebea88b2 / xfs defaults 1 1
      UUID=ad9e8442-335f-478c-81af-b77e1ac88549 /boot xfs defaults 1 2
      UUID=e55cb2d8-4461-4792-944c-1b76225dd13a /home xfs defaults 1 2
      UUID=ffbc9edf-42ce-4d82-af5c-b2ff1cff5a68 /usr xfs defaults 1 2
      UUID=556f0e53-bfa3-4639-9d47-ba1c70299393 /var xfs defaults 1 2
      UUID=a855e109-f05f-4bfe-bfc9-a06f10d294f1 swap swap defaults 0 0
      192.168.2.2:/test1 /mnt/nfstest1 nfs rw,sync 0 0
      192.168.2.2:/test2 /mnt/nfstest2 nfs rw,sync 0 0


      Here multiple nfs share directory is not mounting at once .
      On client /etc/fstab



      192.168.2.2:/test1 /mnt/nfstest1 nfs rw,sync 0 0
      192.168.2.2:/test2 /mnt/nfstest2 nfs rw,sync 0 0


      after fireing mount -a



      i am getting /mnt/nfstest1



      192.168.2.2:/test1  9.8G   71M  9.7G   1% /mnt/nfstest1 


      but after restarting client i am getting vice-versa . WHY



      Can some one help me to solve this problem



      Note NFS directory are made on single / file system on server.



      And mounted on /mnt/test1 and /mnt/test2 on client.



      Thank You
      Sagar Dalvi










      share|improve this question
















      Hello everyone i am not able to mount multiple NFS Share Directories using fstab on RHEL 7. Check out my LAB configuration.



      I want to ask question using nfs and mounting by fstab only one nfs directory can be mount. if no how to mount multiple directory.



      LAB



      server.example.com 192.168.2.2/24



      client.example.com 192.168.2.1/24



      On Server



      nfs share folder are
      /test1
      /test2



      Disable firewalld and selinux is in permissive mode on server and client.



      On Server



      [root@server ~]# yum install nfs-utils
      [root@server ~]# systemctl enable rpcbind
      [root@server ~]# systemctl start rpcbind
      [root@server ~]# systemctl start nfs-server
      [root@server ~]# systemctl start nfs-secure


      [root@server ~]# mkdir /test1
      [root@server ~]# mkdir /test2
      [root@server ~]# ls /test*
      /test1:

      /test2:

      [root@server ~]# chmod 777 /test1
      [root@server ~]# chmod 777 /test2


      [root@server ~]# vim /etc/exports
      [root@server ~]# cat /etc/exports
      /test1 192.168.2.1(rw,sync,no_root_squash)
      /test2 192.168.2.1(rw,sync,no_root_squash)


      [root@server ~]# exportfs -r



      [root@server ~]# exportfs -v
      /test1 192.168.2.1(rw,wdelay,no_root_squash,no_subtree_check,sec=sys,rw,secure,no_root_squash,no_all_squash)
      /test2 192.168.2.1(rw,wdelay,no_root_squash,no_subtree_check,sec=sys,rw,secure,no_root_squash,no_all_squash)


      [root@server ~]# systemctl stop firewalld.service
      [root@server ~]# systemctl disable firewalld.service
      [root@server ~]# sestatus
      SELinux status: enabled
      SELinuxfs mount: /sys/fs/selinux
      SELinux root directory: /etc/selinux
      Loaded policy name: targeted
      Current mode: permissive
      Mode from config file: permissive


      ON Client



      [root@client ~]# systemctl enable rpcbind
      [root@client ~]# systemctl start rpcbind

      [root@client ~]# setenforce 0
      [root@client ~]# vim /etc/sysconfig/selinux
      [root@client ~]# sestatus
      SELinux status: enabled
      SELinuxfs mount: /sys/fs/selinux
      SELinux root directory: /etc/selinux
      Loaded policy name: targeted
      Current mode: permissive
      Mode from config file: permissive
      [root@client ~]# systemctl stop firewalld
      [root@client ~]# systemctl disble firewalld


      [root@client ~]# showmount -e 192.168.2.2
      Export list for 192.168.2.2:
      /test2 192.168.2.1tes
      /test1 192.168.2.1

      [root@client ~]# mkdir /mnt/nfstest1
      [root@client ~]# mkdir /mnt/nfstest2
      [root@client ~]# chmod 777 /mnt/nfstest1
      [root@client ~]# chmod 777 /mnt/nfstest2


      Check fstab file



      [root@client ~]# vim /etc/fstab

      [root@client ~]# cat /etc/fstab

      #
      # /etc/fstab
      # Created by anaconda on Wed Apr 26 08:01:03 2017
      #
      # Accessible filesystems, by reference, are maintained under '/dev/disk'
      # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
      #
      UUID=8cfced80-d77a-41a6-a7ee-9b41ebea88b2 / xfs defaults 1 1
      UUID=ad9e8442-335f-478c-81af-b77e1ac88549 /boot xfs defaults 1 2
      UUID=e55cb2d8-4461-4792-944c-1b76225dd13a /home xfs defaults 1 2
      UUID=ffbc9edf-42ce-4d82-af5c-b2ff1cff5a68 /usr xfs defaults 1 2
      UUID=556f0e53-bfa3-4639-9d47-ba1c70299393 /var xfs defaults 1 2
      UUID=a855e109-f05f-4bfe-bfc9-a06f10d294f1 swap swap defaults 0 0
      192.168.2.2:/test1 /mnt/nfstest1 nfs rw,sync 0 0
      192.168.2.2:/test2 /mnt/nfstest2 nfs rw,sync 0 0


      [root@client ~]# mount -a



      df -h show only one nfs directory mounted /mnt/nfstest1



      [root@client ~]# df -h
      Filesystem Size Used Avail Use% Mounted on
      /dev/sda2 9.8G 70M 9.7G 1% /
      devtmpfs 354M 0 354M 0% /dev
      tmpfs 363M 0 363M 0% /dev/shm
      tmpfs 363M 5.2M 357M 2% /run
      tmpfs 363M 0 363M 0% /sys/fs/cgroup
      /dev/sda5 9.8G 2.8G 7.0G 29% /usr
      /dev/sda3 9.8G 33M 9.8G 1% /home
      /dev/sda1 2.0G 107M 1.9G 6% /boot
      /dev/sda6 9.8G 3.8G 6.1G 39% /var
      192.168.2.2:/test1 9.8G 71M 9.7G 1% /mnt/nfstest1


      but on mount command show both nfs directory



      [root@client ~]# mount | grep nfstest*
      192.168.2.2:/test1 on /mnt/nfstest1 type nfs4 (rw,relatime,sync,vers=4.0,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.2.1,local_lock=none,addr=192.168.2.2)

      192.168.2.2:/test2 on /mnt/nfstest2 type nfs4 (rw,relatime,sync,vers=4.0,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.2.1,local_lock=none,addr=192.168.2.2)


      i have reboot



      check my status again,again only one nfs share directory is mounted and i.e is /mnt/nfstest2 and /mnt/nfstest1 gone.
      why is this happing i have fire Right option in /etc/fstab.
      can some one tell me is that right.



      login as: root
      root@192.168.2.1's password:
      Last login: Wed May 10 22:37:20 2017 from 192.168.2.100

      [root@client ~]# df -h
      Filesystem Size Used Avail Use% Mounted on
      /dev/sda2 9.8G 70M 9.7G 1% /
      devtmpfs 354M 0 354M 0% /dev
      tmpfs 363M 0 363M 0% /dev/shm
      tmpfs 363M 5.2M 357M 2% /run
      tmpfs 363M 0 363M 0% /sys/fs/cgroup
      /dev/sda5 9.8G 2.8G 7.0G 29% /usr
      /dev/sda1 2.0G 107M 1.9G 6% /boot
      /dev/sda3 9.8G 33M 9.8G 1% /home
      /dev/sda6 9.8G 3.8G 6.1G 39% /var
      192.168.2.2:/test2 9.8G 71M 9.7G 1% /mnt/nfstest2

      [root@client ~]# mount | grep nfstest*
      192.168.2.2:/test2 on /mnt/nfstest2 type nfs4 (rw,relatime,sync,vers=4.0,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.2.1,local_lock=none,addr=192.168.2.2)

      192.168.2.2:/test1 on /mnt/nfstest1 type nfs4 (rw,relatime,sync,vers=4.0,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.2.1,local_lock=none,addr=192.168.2.2)


      [root@client ~]# cat /etc/fstab

      #
      # /etc/fstab
      # Created by anaconda on Wed Apr 26 08:01:03 2017
      #
      # Accessible filesystems, by reference, are maintained under '/dev/disk'
      # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
      #
      UUID=8cfced80-d77a-41a6-a7ee-9b41ebea88b2 / xfs defaults 1 1
      UUID=ad9e8442-335f-478c-81af-b77e1ac88549 /boot xfs defaults 1 2
      UUID=e55cb2d8-4461-4792-944c-1b76225dd13a /home xfs defaults 1 2
      UUID=ffbc9edf-42ce-4d82-af5c-b2ff1cff5a68 /usr xfs defaults 1 2
      UUID=556f0e53-bfa3-4639-9d47-ba1c70299393 /var xfs defaults 1 2
      UUID=a855e109-f05f-4bfe-bfc9-a06f10d294f1 swap swap defaults 0 0
      192.168.2.2:/test1 /mnt/nfstest1 nfs rw,sync 0 0
      192.168.2.2:/test2 /mnt/nfstest2 nfs rw,sync 0 0


      Here multiple nfs share directory is not mounting at once .
      On client /etc/fstab



      192.168.2.2:/test1 /mnt/nfstest1 nfs rw,sync 0 0
      192.168.2.2:/test2 /mnt/nfstest2 nfs rw,sync 0 0


      after fireing mount -a



      i am getting /mnt/nfstest1



      192.168.2.2:/test1  9.8G   71M  9.7G   1% /mnt/nfstest1 


      but after restarting client i am getting vice-versa . WHY



      Can some one help me to solve this problem



      Note NFS directory are made on single / file system on server.



      And mounted on /mnt/test1 and /mnt/test2 on client.



      Thank You
      Sagar Dalvi







      rhel nfs fstab






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 28 '17 at 13:00









      Jeff Schaller

      41.2k1056131




      41.2k1056131










      asked May 10 '17 at 19:11









      Sagar DalviSagar Dalvi

      1081210




      1081210





      bumped to the homepage by Community 9 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 9 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          The output of mount should be authoritative. /proc/mounts is the true authority, but mount uses that nowadays, /etc/mtab is just a symlink. You could check those yourself to be sure, if you like. But I think the filesystems are mounted.



          The answer is that df filters out duplicate filesystems, such as bind mounts. (The order these filesystems are mounted in is effectively random, when systemd is used).



          df is somehow able to correctly identify these two directories as being hosted on the same physical filesystem - the space information for them would be identical. If you search the web, you will find this same complaint about df and NFS mounts reported as bugs on multiple Linux distributions.



          The answer from these bugs is that if you want to show all mount points, then you want df -a.






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "106"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f364263%2fnot-mounting-multiple-nfs-share-directories-using-fstab-on-rhel-7%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            The output of mount should be authoritative. /proc/mounts is the true authority, but mount uses that nowadays, /etc/mtab is just a symlink. You could check those yourself to be sure, if you like. But I think the filesystems are mounted.



            The answer is that df filters out duplicate filesystems, such as bind mounts. (The order these filesystems are mounted in is effectively random, when systemd is used).



            df is somehow able to correctly identify these two directories as being hosted on the same physical filesystem - the space information for them would be identical. If you search the web, you will find this same complaint about df and NFS mounts reported as bugs on multiple Linux distributions.



            The answer from these bugs is that if you want to show all mount points, then you want df -a.






            share|improve this answer




























              0














              The output of mount should be authoritative. /proc/mounts is the true authority, but mount uses that nowadays, /etc/mtab is just a symlink. You could check those yourself to be sure, if you like. But I think the filesystems are mounted.



              The answer is that df filters out duplicate filesystems, such as bind mounts. (The order these filesystems are mounted in is effectively random, when systemd is used).



              df is somehow able to correctly identify these two directories as being hosted on the same physical filesystem - the space information for them would be identical. If you search the web, you will find this same complaint about df and NFS mounts reported as bugs on multiple Linux distributions.



              The answer from these bugs is that if you want to show all mount points, then you want df -a.






              share|improve this answer


























                0












                0








                0







                The output of mount should be authoritative. /proc/mounts is the true authority, but mount uses that nowadays, /etc/mtab is just a symlink. You could check those yourself to be sure, if you like. But I think the filesystems are mounted.



                The answer is that df filters out duplicate filesystems, such as bind mounts. (The order these filesystems are mounted in is effectively random, when systemd is used).



                df is somehow able to correctly identify these two directories as being hosted on the same physical filesystem - the space information for them would be identical. If you search the web, you will find this same complaint about df and NFS mounts reported as bugs on multiple Linux distributions.



                The answer from these bugs is that if you want to show all mount points, then you want df -a.






                share|improve this answer













                The output of mount should be authoritative. /proc/mounts is the true authority, but mount uses that nowadays, /etc/mtab is just a symlink. You could check those yourself to be sure, if you like. But I think the filesystems are mounted.



                The answer is that df filters out duplicate filesystems, such as bind mounts. (The order these filesystems are mounted in is effectively random, when systemd is used).



                df is somehow able to correctly identify these two directories as being hosted on the same physical filesystem - the space information for them would be identical. If you search the web, you will find this same complaint about df and NFS mounts reported as bugs on multiple Linux distributions.



                The answer from these bugs is that if you want to show all mount points, then you want df -a.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jun 4 '17 at 15:55









                sourcejedisourcejedi

                24.1k439106




                24.1k439106






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f364263%2fnot-mounting-multiple-nfs-share-directories-using-fstab-on-rhel-7%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Accessing regular linux commands in Huawei's Dopra Linux

                    Can't connect RFCOMM socket: Host is down

                    Kernel panic - not syncing: Fatal Exception in Interrupt