Issue with NFS mount

Hi Community,
The directory /iso from the FreeBSD server has been mounted to a Rhel server. I mounted the directory about a month and a half ago. It has been working. Yesterday I created a new directory /share and wanted to replace /iso with /share. I removed /iso from /etc/exports file and added /share and restarted nfsd service. When I run command "showmount -a 192.168.1.1" from rhel server, it didn't show the /share directory, I just see "All mount points on 192.168.1.1:". I restarted rpcbind, mountd and nfsd, but still it's now showing the directory. I switched it back to /iso and restarted the service, still did not show any mount point from the real, even though I ran the same command on the FreeBSD server and got the same result. I am trying to figure out what I am doing wrong. Here are the /etc/rc.conf file content:

Code:
1 # NFS Share
  2 rpcbind_enable="YES"
  3 nfs_server_enable="YES"
  4 nfsV4_server_enable="YES"
  5 nfsuserd_enable="YES"
  6 mountd_enable="YES"

and here is /etc/exports file content.
Code:
1 #/share -alldirs -maproot=root -network 192.168.1.0/24
  2 /iso    -alldirs        -maproot=root -network 192.168.1.0/24

Appreciate your help!
 
What version has the FreeBSD machine?

Here are the /etc/rc.conf file content:

Code:
1 # NFS Share
2 rpcbind_enable="YES"
3 nfs_server_enable="YES"
4 nfsV4_server_enable="YES"
5 nfsuserd_enable="YES"
6 mountd_enable="YES"
With the line numbers this looks copy&paste from a editor/pager opened file, so I assume it is copied as is.

4 nfsV4_server_enable="YES"
"V" should be in lowercase.

When I run command "showmount -a 192.168.1.1" from rhel server
Run showmount(8) with the -e option, not -a option. You can run it on the FreeBSD NFS server as showmount -e
 
Thanks all.
I figured I had a typo with the directory name. I was able to make it work.
Is it possible to add multiple directories in the export file? For example, if I want to add /share (will be mounted to server a) and /iso (will be mounted to server b). I tried adding like below and running showmount -e and got the output "Exports list on localhost:"
/share /iso -alldirs -maproot=root -network 192.168.1.0/24
I also tried adding a separate entry, and it only showed the mount point, which is added to the top. How can I add multiple directories to be mounted?
Thanks,
 
Is it possible to add multiple directories in the export file?
Yes, it's possible.

If all exported directories are on the same file system, and they should be accessible to all clients on the same subnet, the directory paths can be in one line.

If the directories are on separate file systems, exported directories must be set in separate lines.

/etc/exports
Code:
#  /share  /iso  on the same file system, shared on the same subnet
/share  /iso  -network 192.168.1.0/24

#  /share  /iso  on the same file system, shared on different subnets
/share  /iso  -network 192.168.1.0/24
/share  /iso  -network 192.168.8.0/24

# /share /iso  on different file systems, shared on the same subnet
/share   -network 192.168.1.0/24
/iso     -network 192.168.1.0/24

#  /share  /iso  on different file systems, shared on different subnets
/share   -network 192.168.1.0/24
/iso     -network 192.168.1.0/24

/share   -network 192.168.8.0/24
/iso     -network 192.168.8.0/24

If UFS, as long as the exported directories are from the same partition, it counts as the same file system. If the exported directories are from separate partitions, this counts as from two different file systems.

If ZFS, every data set if a separate file system, when all exported directories are from the same data set it counts as from the same file system. If the exported directories are created on different data sets, those count as different file systems.

Most important, when using /etc/exports, every time the file is edited, the mount daemon must be restarted to re-read the exports file: service mountd restart

If mountd is not enabled in rc.conf (it's not required, the daemon is force stared by nfsd): service mountd onerestart

When nfsv4_server_enable="YES", make sure there is a V4: line set.

See exports(5) for details and examples.
 
Back
Top