NFS doesn't export filesystem (two manual restarts help)

I have a nfs exported filesystem but after each reboot I have to restart the NFS server twice to make it actually export the filesystem.

First restart always fails with:

Shutting down kernel based NFS server: nfsd statd mountd idmapd                                                        done
Starting kernel based NFS server: idmapdexportfs: Warning: /home/teradisk/Share does not support NFS export.
 mountd statd nfsd sm-notify                                                                                           done

I have googled the issue only to find a mailing list with absolutely no solution (just a bunch of confused people).
NFS server exports fail (‘does not support NFS export’ ??) immediately after reboot; OK after running ‘exportfs -r’ twice. Help? - ReadList.com

I’m going to create a custom service that will restart the NFS server twice upon bootup, but I don’t like this solution. Therefore anyone got any idea what to do with this?

/etc/exports

/home/teradisk/Share    192.168.0.*(fsid=0,crossmnt,ro,root_squash,async,insecure,no_subtree_check)

/etc/fstab

/dev/md5             /home/teradisk       jfs        defaults              1 2

Lot of questions here (only to make clear that we talk the same language):
. which openSUSE (it may not matter much, but it is always nice to know for all who participate here)?
. did you install nfs-kernel-server and yast-nfs-server?
. did you configure the export and start the server using YaST?
. when you did otherwise please explain how.

And to be sure, it only exports correct afterr the third start?

Oh, sorry, I’m not sure how I could omit such obvious stuff:

uname -a

Linux desktop 2.6.31.12-0.2-desktop #1 SMP PREEMPT 2010-03-16 21:25:39 +0100 x86_64 x86_64 x86_64 GNU/Linux

/etc/SuSE-release

openSUSE 11.2 (x86_64)
VERSION = 11.2

Yes, I did install everything, the export actually works, but not by itself (yes, nfsserver is set to autostart and yes it is running after boot) and not after one NFS server restart (needs two).

I’m not sure how I configured the server initially, I think I configured it through Yast but added the export manually.

Thanks for all the info. My opinion is that editing /etc/exports manualy (when done properly :wink: ) shouldn’t be a problem.

Now I am starting wild guesses. The fact that in the end it functions means to me that your export is correct. The fact that it only works after the third trial leads me to the idea of a timing problem. When that is correct, it could work at your first restart when you wait a bit longer. Did you ever test/experience this?

I’ve got exactly the same problem.
After a reboot (to runlevel 5) the client cannot mount the filesystem (permission denied).
Even if you wait more than an hour.
Nor a minute : adding a “sleep 60” before “/usr/sbin/exportfs -r” in /etc/init.d/nfsserver don’t help.

After one “exportfs -r” everythings works correctly despite the message :


exportfs -r
exportfs: Warning: /export/home/share does not support NFS export.

Serveur side :


uname -a
Linux matlnx3 2.6.31.12-0.2-default #1 SMP 2010-03-16 21:25:39 +0100 i686 i686 i386 GNU/Linux
grep -v ^# /etc/exports
/export/home/share	@matlnx(rw,sync,subtree_check) @matsun(rw,sync,subtree_check)

Note : /export/home is an ext3 filesystem but i don’t think this is the problem.

Client side :


mount matlnx3:/export/home/share /mnt
mount: matlnx3:/export/home/share failed, reason given by server: Permission denied

Same on more recent clients :


mount matlnx3:/export/home/share /mnt
mount.nfs: access denied by server while mounting matlnx3:/export/home/share

I also suspect some race conditions, or missing dependencies in /etc/init.d/nfsserver but
haven’t find anything until now.

Here’s a line from my working NFS server config:


glosscomputer@GjLzelF:~> cat /etc/exports
/disk/Data      *(rw,root_squash,sync,no_subtree_check)

Like you can see, there’s “no_subtree_check” instead of “subtree_check” , change that and see if it starts normally.
How did you configure the NFS server? If not done so already, configure it through Yast - Network Services - NFS server. If you don’t see that item, install “yast2-nfs-server”, restart Yast and it will be there.

Also, check that user exist on both systems with same numeric UID.

Moving “/usr/sbin/exportfs -r” after the startup of rpc.mountd in /etc/init.d/nfsserver make things work.


diff -c nfsserver nfsserver.orig
*** nfsserver	Tue Jul 13 14:54:03 2010
--- nfsserver.orig	Tue Jul 13 14:58:15 2010
***************
*** 198,203 ****
--- 198,205 ----
            }
  	  echo $IDMAPD_BIN > $IDMAPD_SERVER_STATE
        fi
+       # exportfs
+       /usr/sbin/exportfs -r
        # rpc.mountd
        echo -n " mountd"
        if  -n "$MOUNTD_PORT" ] ; then
***************
*** 208,215 ****
            rc_status -v
            rc_exit
        }
-       # exportfs
-       /usr/sbin/exportfs -r
        # rpc.statd
        echo -n " statd"
        startproc /usr/sbin/rpc.statd --no-notify || {
--- 210,215 ----

Certainly not the solution, but…

Like you can see, there’s “no_subtree_check” instead of “subtree_check” , change that and see if it starts normally.

I need subtree_check options. /export/home is the filesystem. /export/home/share is the directory i want to export. And there is things in /export/home i don’t want to export (despite the name /export). But i still try (without the correction in /etc/init.d/nfsserver above) and the problem stay the same.

How did you configure the NFS server?

Manually.

If not done so already, configure it through Yast - Network Services - NFS server. If you don’t see that item, install “yast2-nfs-server”, restart Yast and it will be there.

I install yast2-nfs-server and reconfigured the nfs server using yast. Reboot –> Same problem (without the correction in /etc/init.d/nfsserver above).

Ok, I know that it’s been a while since this problem was reported, but still I created an account because I had the same issue and I want to help others to resolve it. (even in my very stupid case)

My problem was that once NFS setup was complete at my server, when I reboot the machine, NFS services started ok but without be able to connect from the clients. But if I run the “exportfs -a” and then tried to mount the shared directory on the clients, worked perfect.

So, I did a little google research and found out that /etc/exports it’s only a “read” file to /var/lib/nfs/etab. So, when you run “exportfs -a” the content of /etc/exports really goes to /var/lib/nfs/etab.-

I reboot my server and read the /var/lib/nfs/etab file, it was empty. When I run the exportfs -a and lookted again, it was ok with all the info of /etc/exports.-

Then, a colleague see domething that I just overlook. He run a “systemctl status nfs” and in the bottom he reads “Jul 19 16:53:01 xxxxx.cl exportfs[1083]: exportfs: Failed to resolve xxxxx.cl”…

O.o…
And that’s all. We edited “/etc"hosts” file to add the clients and after that is working perfect.

Best Regards.

Welcome to the forums econtardo. It is nice that you wanted to help others, but you’re responding to a very old thread (and systemd wasn’t in use back then). Much can change over the years. For this reason, an reviewed how to is probably the best option in circumstances like these. So, please do so if you feel you have information of value to others.

https://forums.opensuse.org/forumdisplay.php/783-Unreviewed-How-To-and-FAQ

You can always reference a thread if you feel it is relevant, but you’re probably just best to rewrite a basic standalone “how to”.

I’ll close this thread.