# [solved] Unable to start NFS service

## aahjnnot

I'm making my first foray into the joys of Gentoo with a Raspberry Pi 2, and I've already learned loads of dark secrets about Linux that had remained hidden after a decade of using Ubuntu.  I'm loving the fine-grained control that Gentoo gives me over my dainty little machine.

Unfortunately, I'm stumbling with NFS4. I've emerged nfs-utils, but the NFS service won't start.

```
# service nfs start

 * Caching service dependencies ...                                       [ ok ]

 * Starting NFS mountd ...                                                [ ok ]

 * Starting NFS daemon ...

rpc.nfsd: Unable to access /proc/fs/nfsd errno 2 (No such file or directory).

Please try, as root, 'mount -t nfsd nfsd /proc/fs/nfsd' and then restart rpc.nfsd to correct the problem                                                  [ !! ]

 * Starting NFS smnotify ...                                              [ ok ]

 * ERROR: nfs failed to start
```

The suggested solution doesn't help:

```
# mount -t nfsd nfsd /proc/fs/nfsd

mount: unknown filesystem type 'nfsd'

```

I don't have a file called /etc/init.d/rpc.nfsd, so I'm not sure how to restart rpc.nfsd, but I'm fairly confident it wouldn't work given that the system seems blissfully unaware that NFS exists as a filesystem type. Should I have an rpc.nfsd service? It's not something I have on my Ubuntu boxes.

Googling the error suggests that there might be a problem with kernel support for NFS. I'm using a pre-compiled kernel so I don't know for sure what options were used when it was compiled. However, /proc/config - which I understand should tell me the compilation options used - gives a reassuring output:

```
# zcat /proc/config.gz | grep NFS

CONFIG_KERNFS=y

CONFIG_NFS_FS=y

CONFIG_NFS_V2=y

CONFIG_NFS_V3=y

CONFIG_NFS_V3_ACL=y

CONFIG_NFS_V4=y

CONFIG_NFS_SWAP=y

# CONFIG_NFS_V4_1 is not set

CONFIG_ROOT_NFS=y

CONFIG_NFS_FSCACHE=y

# CONFIG_NFS_USE_LEGACY_DNS is not set

CONFIG_NFS_USE_KERNEL_DNS=y

CONFIG_NFSD=m

CONFIG_NFSD_V2_ACL=y

CONFIG_NFSD_V3=y

CONFIG_NFSD_V3_ACL=y

CONFIG_NFSD_V4=y

# CONFIG_NFSD_FAULT_INJECTION is not set

CONFIG_NFS_ACL_SUPPORT=y

CONFIG_NFS_COMMON=y
```

Where do I go next?Last edited by aahjnnot on Mon Feb 16, 2015 7:42 pm; edited 1 time in total

----------

## krinn

To provide nfsd you need CONFIG_NFSD set in kernel

```
CONFIG_NFSD=m 
```

Tell you it is there, but set as module

It mean, as soon as you modprobe nfsd, module is loaded ; once load nfsd is there and the mount command should succeed.

the rpc.nfsd is the named of the deamon, the deamon is start by your service provider (that's unfamiliar to me, so i would say systemd). It mean redo your service nfs start after you have load the module

----------

## aahjnnot

 *krinn wrote:*   

> It mean, as soon as you modprobe nfsd, module is loaded ; once load nfsd is there and the mount command should succeed.
> 
> the rpc.nfsd is the named of the deamon, the deamon is start by your service provider (that's unfamiliar to me, so i would say systemd). It mean redo your service nfs start after you have load the module

 

Thanks, krinn. I hadn't realised what the 'm' stood for.

It seems that I have a problem persuading the kernel to load the required module:

```
modprobe -v nfsd

lsmod
```

Neither command gives me any output. I apparently have no kernel modules loaded (highly unusual I would have thought, but maybe the custom kernel for the Raspberry Pi doesn't make use of much modules as it is a tightly defined hardware platform?), but no error message is given when I try to force the loading of the nfsd module and dmesg shows no results at all.

Attempting to start the NFS service still gives me the same error.

----------

## krinn

I don't know systemd at all, but it is possible this eating spider has also eat modprobe and use its own modules handling.

You can see your modules for your current kernel version there: cd /lib/modules/`uname -r`

If the module is there, and modprobe doesn't gave you any answer, it might be because modprobe isn't modprobe  :Smile: 

Next if it is that, you have to read doc to get howto handle your modules with it, or wait for someone knowing systemd coming to help you.

(you could also try insmod instead of modprobe, but insmod doesn't handle module dependencies, but if nfsd has none, you'll be fine)Last edited by krinn on Mon Feb 16, 2015 12:08 pm; edited 1 time in total

----------

## Irre

I have these services started:

```
localhost ~ # rc-config show

Status of init scripts in runlevel "default"

  dbus                      [started]

  gpm                       [started]

  local                     [started]

  netmount                  [started]

  nfs                       [started]

  nfsclient                 [started]

  nfsmount                  [started]

  ntp-client                [started]

  samba                     [started]

  sshd                      [started]

  vixie-cron                [started]
```

And config:

```
localhost ~ # cat /etc/exports

# /etc/exports: NFS file systems being exported.  See exports(5).

/export                 *(rw,fsid=0,no_subtree_check)

/export/distfiles       *(rw,nohide,insecure,no_subtree_check,no_root_squash)

/export/portage         *(rw,nohide,insecure,no_subtree_check,no_root_squash)

/export/linux-src       *(rw,nohide,insecure,no_subtree_check,no_root_squash)

/export/sda-backup      *(rw,nohide,insecure,no_subtree_check,no_root_squash)

/export/sdb-backup      *(rw,nohide,insecure,no_subtree_check,no_root_squash)

localhost ~ # zcat /proc/config.gz | grep NFS

CONFIG_KERNFS=y

CONFIG_NFS_FS=y

CONFIG_NFS_V2=y

CONFIG_NFS_V3=y

CONFIG_NFS_V3_ACL=y

CONFIG_NFS_V4=y

# CONFIG_NFS_SWAP is not set

CONFIG_NFS_V4_1=y

# CONFIG_NFS_V4_2 is not set

CONFIG_PNFS_FILE_LAYOUT=y

CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org"

# CONFIG_NFS_V4_1_MIGRATION is not set

CONFIG_ROOT_NFS=y

CONFIG_NFS_FSCACHE=y

# CONFIG_NFS_USE_LEGACY_DNS is not set

CONFIG_NFS_USE_KERNEL_DNS=y

CONFIG_NFSD=m

CONFIG_NFSD_V2_ACL=y

CONFIG_NFSD_V3=y

CONFIG_NFSD_V3_ACL=y

CONFIG_NFSD_V4=y

# CONFIG_NFSD_FAULT_INJECTION is not set

CONFIG_NFS_ACL_SUPPORT=y

CONFIG_NFS_COMMON=y

```

----------

## John R. Graham

 *krinn wrote:*   

> I don't know systemd at all, ...

 Just FYI:

```
hal ~ # equery belongs `which service`

 * Searching for /sbin/service ... 

sys-apps/openrc-0.13.9 (/sbin/service -> /sbin/openrc)

sys-apps/openrc-0.13.9 (/sbin/openrc)
```

It's just a wrapper. "service x start" is equivalent to "/etc/init.d/x start".

- John

----------

## krinn

Should migrate to newer openrc one day then  :Smile: 

Did they bork modprobe or something?

edit: lol never use it, but indeed even older openrc version have that service tools  :Very Happy: Last edited by krinn on Mon Feb 16, 2015 12:21 pm; edited 2 times in total

----------

## aahjnnot

 *krinn wrote:*   

> I don't know systemd at all, but it is possible this eating spider has also eat modprobe and use its own modules handling.
> 
> You can see your modules for your current kernel version there: cd /lib/modules/`uname -r`
> 
> If the module is there, and modprobe doesn't gave you any answer, it might be because modprobe isn't modprobe 
> ...

 

I obviously have some problem with loading modules.

```
cd /lib/modules/`uname -r`

-bash: cd: /lib/modules/3.18.6-v7+: No such file or directory

ls 

```

Even the parent folder /lib/modules is missing, and the command 'insmod nfsd' gives an error saying that there is no such file or directory.

Where does /lib/modules come from? Do I need to manually symlink it somewhere?

----------

## krinn

when you build the kernel the modules are store in /lib/modules/kernel-version

so if you have a kernel without its modules, you have an incomplete kernel.

as nfsd is build as module, you cannot use it without the module of course, so no nfs until you have the module or a kernel with nfsd build-in.

----------

## aahjnnot

 *krinn wrote:*   

> when you build the kernel the modules are store in /lib/modules/kernel-version
> 
> so if you have a kernel without its modules, you have an incomplete kernel.
> 
> as nfsd is build as module, you cannot use it without the module of course, so no nfs until you have the module or a kernel with nfsd build-in.

 

Odd! I wonder what else might be missing...

But perhaps this presents me with an opportunity to learn the joys of kernel compilation. It will take a while on a Pi, though!

----------

## krinn

 *aahjnnot wrote:*   

> It will take a while on a Pi, though!

 

It is something another computer can do for the Pi.

----------

## aahjnnot

 *krinn wrote:*   

>  *aahjnnot wrote:*   It will take a while on a Pi, though! 
> 
> It is something another computer can do for the Pi.

 

You forget that I'm a beginner with Gentoo!

The trouble is that all of the guides that I've seen assume the availability of another box with Gentoo, but all of my other hardware runs Ubuntu. I'm sure it's possible to set things up to cross-compile across distros or at least to have a Gentoo VM on a powerful PC, but, for now, I think that patiently watching some scrolling text might be the safest solution. I'm feeling quite proud of what I've achieved so far - particularly my network authentication with SSSD, Kerberos and LDAP - so I don't want to tempt fate at this point.

I will learn to do it one day, though   :Smile: 

----------

## krinn

I never said you need a Gentoo to build a kernel for a gentoo. You can even do it with Windows.

But it's just easier with a linux, and it's just easier with a gentoo (that is like ubuntu but per its usage must have the tools to build something, gcc, headers...), while ubuntu (i'm not sure it is or not) may need additional package to have the compiler.

But if your ubuntu is ready for compiling stuff, you're good to go.

So everything is easier with a gentoo because you must have a gcc to run a gentoo, and so gcc is always there. But any ubuntu can use gcc too  :Wink: 

And you don't need cross-compile or anything, nor need to install a gentoo. Per example, you could just run a livecd (a gentoo one, 32bits version) from another computer to build the kernel.

No cross-compilation, no gentoo install, but still you are able to build the kernel for your pi with the power of that computer.

It is no different than your ubuntu computers, as i suppose you don't use a kernel you have built with them, but the one gave by ubuntu ; and this kernel was build by the ubuntu compile farm, not by any of your computers.

----------

## krinn

 *krinn wrote:*   

> No cross-compilation, no gentoo install, but still you are able to build the kernel for your pi with the power of that computer.

 

sorry was thinking about 32b vs 64b issue, of course i realize later pi use arm cpu, and cross-compile is need then if other computers aren't arm.

----------

## aahjnnot

So my kernel compiled in a little under two hours. NFS now starts.

Thanks for the help, guys.

----------

