1

**see imp update at bottom of orig. question.

not sure how to unexport only the 'world' mountable share? I have a NFS server which had a share with world-mountable permissions. To make it mountable only by the clients on a subnet i added the share to /etc/exports, which was empty before. I am not sure how the folder was shared before?? I put the entry in /etc/exports and shared again, but it is still showing world mountable share available.

before:

[root@nfsServer ~]# exportfs -v
/export/home    <world>(rw,wdelay,no_root_squash,no_subtree_check)

# ls -l /var/lib/nfs/xtab
-rw-r--r-- 1 root root 0 Dec 15  2009 /var/lib/nfs/xtab

# ls -l /proc/fs/nfs
-r--r--r-- 1 root root 0 May  2 00:41 exports

change:

added following line to /etc/exports (which was empty before)

/export/home    192.168.253.0/24(rw,wdelay,no_root_squash,no_subtree_check)

then re-export folders:
# exportfs -ra

after:

[root@nfsServer ~]# exportfs -v
/export/home    192.168.253.0/24(rw,wdelay,no_root_squash,no_subtree_check)
/export/home    <world>(rw,wdelay,no_root_squash,no_subtree_check)

# cat /etc/exports
/export/home    192.168.253.0/24(rw,wdelay,no_root_squash,no_subtree_check)

# ls -l /var/lib/nfs/xtab
-rw-r--r-- 1 root root 0 Dec 15  2009 /var/lib/nfs/xtab

# ls -l /proc/fs/nfs
-r--r--r-- 1 root root 0 May  2 00:41 exports


[root@nfsServer ~]# ls -ltr /proc/fs/nfsd
total 0
-rw------- 1 root root 0 Mar  1  2017 versions
-rw------- 1 root root 0 Mar  1  2017 threads
-rw------- 1 root root 0 Mar  1  2017 portlist
-rw------- 1 root root 0 Mar  1  2017 nfsv4recoverydir
-rw------- 1 root root 0 Mar  1  2017 nfsv4leasetime
-rw------- 1 root root 0 Mar  1  2017 filehandle
-r--r--r-- 1 root root 0 Mar  1  2017 exports
[root@nfsServer ~]# cd /proc/fs/nfsd
[root@nfsServer nfsd]# cat exports
# Version 1.1
# Path Client(Flags) # IPs
/export/home    *,192.168.253.0/24(rw,no_root_squash,sync,wdelay,no_subtree_check)

# cat versions
+2 +3 -4

Note that it has * added in front of the /etc/exports entry. I want to know where is the "*" entry coming from and how to get rid of it. All help is appreciated.

system: Red Hat Enterprise Linux Server release 5.5 (Tikanga) 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux

*IMP: sorry i missed to clarify that this is NFS running on VCS HA on redhat 5.5. so when i restart nfs, i get err:

# service nfs stop
Shutting down NFS mountd:                                  [  OK  ]
Shutting down NFS daemon:                                  [  OK  ]
Shutting down NFS quotas:                                  [  OK  ]
Shutting down NFS services:                                [  OK  ]

# service nfs start
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS daemon:                                       [FAILED]

# service nfs start
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS daemon:                                       [FAILED]

but when you check...

#  service nfs status
rpc.mountd (pid 24103) is running...
nfsd (pid 24052 24051 24050 24049 24048 24047 24046 24045) is running...
rpc.rquotad (pid 22872 20490 19133) is running...

I figured that in VCS main.cf this line sets up the 'nfs' share: but i am not sure how to add subnet restriction to it...

Share share_home (
        Options = "rw, no_root_squash"
        PathName = "/export/home"
        )

Thanks. Raj

rajeev
  • 225
  • 2
  • 13

1 Answers1

2

Before you begin, unmount the share on the client machines.

After, run exportfs -ua and then delete the contents of /etc/exports and restart the nfs service.

Removing the entry from /etc/export stops it from being exported again should the service be restarted afterwards.

Nasir Riley
  • 10,665
  • 2
  • 18
  • 27
  • sorry i missed one very important piece of info. The server is a VCS cluster, and it has NFS service running on floating IP in the cluster. (That floating IP fact has no effect on my ask, but i just mentioned.) – rajeev May 02 '18 at 16:57
  • when i try to stop/restart nfs the nfs daemon gives err.... i will add to orignal question for formatting etc. – rajeev May 02 '18 at 16:59
  • @rajeev I don't see any errors where you stopped or started the `nfs` service. It says that it stopped and started successfully. If you want to remove the export then why do you need to add a subnet for it? – Nasir Riley May 02 '18 at 18:20
  • starting NFS daemon - FAILED. is the err Also I was thinking to remove these and add thru /etc/exports, but that will not work. I will have to somehow change this config to export only to clients on a given subnet. – rajeev May 03 '18 at 00:01
  • @rajeev Where does it say that on your edits? Have you checked the logs? – Nasir Riley May 03 '18 at 00:18