# NFS server not available - Something missing?



## blueh2o (Jun 5, 2011)

I'm trying to export a directory from a FreeBSD box to a Linux box, and I can't seem to get any of the NFS services to start.  When I try to start nfs I get:


```
nfsd: NFS server is not available
```

but I thought nfsd *was* the NFS server.. It's not available to itself?

Starting / stopping various services (nfsd, nfsserver, rpcbind, mountd) produces no output, and neither does "status."  Something's missing but I'm not sure what.

System is running FreeBSD 7.1-RELEASE #2: Sat Apr 25 01:52:46 UTC 2009


----------



## Kiiski (Jun 5, 2011)

Hi

 Have you configured the /etc/exports file? 
Maybe you have read instructions in handbook, but here's the link:

http://docs.freebsd.org/doc/7.1-RELEASE/usr/share/doc/en_US.ISO8859-1/books/handbook/network-nfs.html

Hope this helps.


----------



## blueh2o (Jun 5, 2011)

I have configured exports, yes.  rpcbind is running, mountd and nfsd won't start.


```
chronos# nfsd -u -t -n 4
nfsd: NFS server is not available
chronos# /etc/rc.d/mountd onereload
mountd not running? (check /var/run/mountd.pid).
chronos# /etc/rc.d/mountd start
chronos# /etc/rc.d/mountd onereload
mountd not running? (check /var/run/mountd.pid).
chronos# mountd -r
mountd: NFS server is not available or loadable
```

/var/run/mountd.pid, rpcbind.lock, and rpcbind.sock are present and 0 bytes.

I have in rc.conf:


```
rpcbind_enable="YES"
nfs_server_enable="YES"
mountd_flags="-r"
```

This is a very minimal installation, I wonder if there could be some package missing?


----------



## SirDice (Jun 6, 2011)

blueh2o said:
			
		

> This is a very minimal installation, I wonder if there could be some package missing?


It's all part of the base OS.

Have a look in /var/log/messages. There may be some clues as to why it's not working.


----------



## blueh2o (Jun 6, 2011)

I have:

```
Jun  6 11:43:51 chronos root: /etc/rc.d/nfsserver: WARNING: Unable to load kernel module nfsserver
Jun  6 11:43:52 chronos kernel: kldload: /boot/kernel/kernel.orig: Unsupported file type
Jun  6 11:43:52 chronos root: /etc/rc: WARNING: Unable to force mountd. It may already be running.
```
Why should it be doing anything with kernel.orig, anyway?


----------



## SirDice (Jun 7, 2011)

Did you add things to /boot/loader.conf? Or edited /boot/defaults/loader.conf?


----------



## Kiiski (Jun 7, 2011)

Just a quick check, you have not compiled your own kernel?


----------



## blueh2o (Jun 9, 2011)

/boot/loader.conf:

```
# -- sysinstall generated deltas -- #
console="comconsole"
hw.ata.ata_dma="0"
```
In /boot/defaults/loader.conf there was 
	
	



```
nfsserver_load="NO"
```
 and I changed this to YES but it was no help.

Yes, this is a custom kernel with precision timing compiled in for NTP.  But I certainly didn't remove any code for nfs!


----------



## blueh2o (Jun 9, 2011)

OK, so I got the mount to work.  Everything seems to come down to this: kldload can't load module nfsserver.  So I tried going in to /boot/kernel and run *kldload nfsserver.ko* - that worked.  then re-start nfsserver mountd, etc.  Now I am able to export things.  So can someone explain to me why nfsserver.ko isn't being loaded automatically?


----------



## SirDice (Jun 10, 2011)

blueh2o said:
			
		

> In /boot/defaults/loader.conf there was
> 
> 
> 
> ...


NEVER edit /boot/defaults/loader.conf! 
That was the reason I asked about it, as it's possible *module_path* was changed.


----------



## blueh2o (Jun 10, 2011)

Yeah yeah yeah.. don't edit it I know.. I'm getting desperate.  So, module_path is /boot/modules, which is an empty directory.  Man page says:


```
FILES
     /boot/kernel  directory containing loadable modules.  Modules must have
                   an extension of .ko.
```
So why is it set to /boot/modules? And why does *kldload nfsserver* find nothing while *kldload nfsserver.ko* works fine? Would anyone care to explain that?


----------



## blueh2o (Jun 10, 2011)

OK so, I'll try to do this better..

kldconfig(8) says:


```
FILES
     /boot/kernel, /boot/modules, /modules
             The default module search path used by the kernel.
```
and *kldconfig -r* returns 
	
	



```
/boot/kernel;/boot/modules
```
so why isn't /boot/kernel/nfsserver.ko getting located?

Wow, it took me 10 times as long to write that, please tell me I did OK?


----------



## blueh2o (Jun 11, 2011)

So, it appears the module became corrupted somehow.  So far it's the only one I've found, but I re-compiled it and re-installed it, and now it is loading at boot.


----------

