Subject: NFS Server Mount Fails While Starting mountd
To: None <netbsd-help@NetBSD.ORG>
From: Anderson, Rachel E <Rachel.Anderson@gd-ais.com>
List: netbsd-help
Date: 12/28/2005 12:08:41
I am attempting to set up an NFS server running under NetBSD. I do not
have X running (nor do I want X running) so I am trying to configure the
NFS server via the command line. This is my first time using NetBSD.

To enable the NFS server, I performed the following steps:

1. In my kernel config file, I enabled the NFS server by un-commenting=20
   "option NFSSERVER" and recompiling the kernel
2. In the /etc/rc.conf file, I added the following lines to enable the
NFS=20
   server on the board:
     rpcbind=3DYES
     mountd=3DYES
     nfs_server=3DYES
     lockd=3DYES
3. Created file /etc/exports and populated it with the following line:
     /export/test -maproot=3Droot 192.168.1.12
     /export/test -maproot=3Droot 192.168.1.13
4. Created folder /export/test to be the folder exported by the board
and=20
   populated it with a folder and two files.
5. Created file /var/db/mountdb


When I boot NetBSD, I see the messages:
   Starting rpcbind.
   Mounting all filesystems...
   Clearing /tmp.
   Checking quotas: done.
   Starting mountd.
   Dec 28 16:58:07 mybox mountd[240]: "/export/test -maproot", line 1:

   Can't export /export/test: Program version wrong
   Dec 28 16:58:07 mybox mountd[240]: "/export/test -maproot", line 2: =20
   Can't export /export/test: Program version wrong
   Dec 28 16:58:07 mybox mountd[240]: "/export/test -maproot", line 3:

   Can't export /export/test: Program version wrong
   Dec 28 16:58:07 mybox mountd[240]: "/export/test -maproot", line 4:

   Can't export /export/test: Program version wrong
   Dec 28 16:58:07 mybox mountd[240]: "/export/test -maproot", line 5:

   Can't export /export/test: Program version wrong
   Starting nfsd.
   Starting lockd.

At the prompt after I log in, I run "ps -aux" and see the nfsd, mountd,
lockd, and rpcbind running.=20

The machine running the NFS server is 192.168.1.13 and the machine
trying to log in is 192.168.1.12.

When I try to perform an NFS mount on the remote machine (mount -t nfs
192.168.1.13:/export/test /test), I get the error message "mount:
192.168.1.13:/export/test failed, reason given by server: Permission
denied".=20

When I try to perform an NFS mount on the local machine (mount -t nfs
192.168.1.13:/export/test /mnt/test), I get the error message
"mount_nfs: can't access /export/test: Permission denied".

I assume this is somehow related to mountd having errors when it starts
up.  The file /var/db/mountdtab is empty and showmount gives only:
   mybox# showmount
   Hosts on localhost:
   mybox#

When I try to start mountd manually using "/usr/sbin/mountd" on the
board, I get the following error messages:
   mybox# /usr/sbin/mountd -d
   Getting export list.
   Got /etc/exports line: "/export/test -maproot=3Droot 192.168.1.14"
   Making new ep fs=3D0xb01,0x70b
   doing opt -maproot=3Droot 192.168.1.14
   got host 192.168.1.14
   mnt unsucc
   Dec 28 15:06:48 mybox mountd[507]: "/export/test -maproot", line 1:
Can't     =20
   export /export/test: Program version wrong
   Got /etc/exports line: "/export/test -maproot=3Droot 192.168.1.12"
   Making new ep fs=3D0xb01,0x70b
   doing opt -maproot=3Droot 192.168.1.12
   got host 192.168.1.12
   mnt unsucc
   Dec 28 15:06:48 mybox mountd[507]: "/export/test -maproot", line 2:
Can't  =20
   export /export/test: Program version wrong
   Got /etc/exports line: "/export/test -maproot=3Droot localhost"
   Making new ep fs=3D0xb01,0x70b
   doing opt -maproot=3Droot localhost
   got host localhost
   got host localhost
   mnt unsucc
   Dec 28 15:06:48 mybox mountd[507]: "/export/test -maproot", line 3:
Can't   =20
   export /export/test: Program version wrong
   Got /etc/exports line: "/export/test -maproot=3Droot 192.168.1.13"
   Making new ep fs=3D0xb01,0x70b
   doing opt -maproot=3Droot 192.168.1.13
   got host 192.168.1.13
   mnt unsucc
   Getting mount list.
   Here we go.
   Dec 28 15:06:48 mybox mountd[507]: "/export/test -maproot", line 4:
Can't=20
   export /export/test: Program version wrong

Is there something I have not configured correctly? Or enabled? I'm not
sure what else to try. Any suggestions are much appreciated.

Thanks.