# [SOLVED] NFSv4 Module Loading Issues

## Jon Wilder

Hi. I had NFS working on my systems under NFSv3. I decided to change over to NFSv4. I recompiled the server and client kernels with the appropriate settings.

As far as I can tell, everything on the server side is working fine. However, I cannot get the NFS module to load on the client side.

Upon executing modprobe nfs, I get the following -

```

jon@Jon-PC ~ $ sudo modprobe nfs

modprobe: ERROR: could not insert 'nfs': Exec format error

```

Here are my client side kernel settings -

```

--- Network File Systems                                                                               

     <M>   NFS client support                                                                               

     < >    NFS client support for NFS version 2                                                           

     <M>   NFS client support for NFS version 3                                                           

     [ ]    NFS client support for the NFSv3 ACL protocol extension                                      

     <M>   NFS client support for NFS version 4                                                           

     [ ]    Provide swap over NFS support                                                                   

     [*]   NFS client support for NFSv4.1                                                                    

     [*]   NFS client support for NFSv4.2

```

What could be the issue?Last edited by Jon Wilder on Sun Sep 27, 2015 3:32 am; edited 1 time in total

----------

## Buffoon

Your kernel version does not match the module version.

----------

## Jon Wilder

According to modinfo, the versions appear to match my kernel version (I'm running kernel 4.2.0-gentoo-r1) -

```

jon@Jon-PC /usr/src/linux $ modinfo nfs

filename:       /lib/modules/4.2.0-gentoo-r1/kernel/fs/nfs/nfs.ko

license:        GPL

author:         Olaf Kirch <okir@monad.swb.de>

alias:          nfs4

alias:          fs-nfs4

alias:          fs-nfs

depends:        lockd,sunrpc

intree:         Y

vermagic:       4.2.0-gentoo-r1 SMP mod_unload 

parm:           callback_tcpport:portnr

parm:           nfs_idmap_cache_timeout:int

parm:           nfs4_disable_idmapping:Turn off NFSv4 idmapping when using 'sec=sys' (bool)

parm:           max_session_slots:Maximum number of outstanding NFSv4.1 requests the client will negotiate (ushort)

parm:           send_implementation_id:Send implementation ID with NFSv4.1 exchange_id (ushort)

parm:           nfs4_unique_id:nfs_client_id4 uniquifier string (string)

parm:           recover_lost_locks:If the server reports that a lock might be lost, try to recover it risking data corruption. (bool)

parm:           enable_ino64:bool

parm:           nfs_access_max_cachesize:NFS access maximum total cache length (ulong)

jon@Jon-PC /usr/src/linux $ modinfo nfsv4

filename:       /lib/modules/4.2.0-gentoo-r1/kernel/fs/nfs/nfsv4.ko

license:        GPL

depends:        nfs,sunrpc

intree:         Y

vermagic:       4.2.0-gentoo-r1 SMP mod_unload 

jon@Jon-PC /usr/src/linux $ modinfo nfsv3

filename:       /lib/modules/4.2.0-gentoo-r1/kernel/fs/nfs/nfsv3.ko

license:        GPL

depends:        nfs,sunrpc,lockd

intree:         Y

vermagic:       4.2.0-gentoo-r1 SMP mod_unload 

jon@Jon-PC /usr/src/linux $ 

```

----------

## Buffoon

uname -a will tell you the kernel version. Although I think modinfo probably runs it, too. 

I've never seen exec format error for any other reason than version mismatch.

----------

## Jon Wilder

Instead I did uname -r -s -v to shorten it up a bit. But it also returns 4.2.0-gentoo-r1 -

```

jon@Jon-PC /usr/src/linux $ uname -s -r -v

Linux 4.2.0-gentoo-r1 #1 SMP Sat Sep 19 22:21:10 PDT 2015

```

----------

## Buffoon

I'm out of ideas, the last thing I'd try is to mount the boot partition and copy over the kernel image again to be 100% sure the kernel and modules are from same build.

----------

## Jon Wilder

OK...your last post got me thinking. I recompiled the kernel + modules_install, mounted /boot, then make install.

Then I realized...

I just recently rebuilt my entire Gentoo installation onto a new drive. However, I still had my old drive hooked up. Both drives are formatted GPT with the boot partitions named as "boot".

In /etc/fstab, instead of the /dev/sdx convention, I used the partition names instead.

So when I executed sudo mount /boot, it was mounting the boot partition on my old Gentoo drive instead of on the new one. Hence the new kernel was being copied to the old Gentoo's boot partition and not the new Gentoo boot partition.

So I executed sudo mount /dev/sda2 /boot, then ran make install and rebooted the system. The NFS modules are now autoloading and the NFS mount points are also mounting on boot as well.

Thanks for the help.

----------

