6

I am trying to mount a folder workspace from server to the client over NFS. For this I bind the folder to an /export by adding the following in my /etc/fstab on server:

/home   /export none    bind

Then I add the following lines in my /etc/exports on my server:

/export     *(ro,sync,no_subtree_check,insecure,fsid=0) 
/export/workspace   *(rw,sync,no_subtree_check,insecure,nohide) 

I load the exportfs file, and restart the nfs-kernel-server:

# exportfs -vr
# service nfs-kernel-server restart

I now go to my client and check which folders can be exported:

# showmount -e 192.168.145.131
Export list fo 192.168.145.131:
/export/workspace *
/export           *

But when I try mounting the folder, I get the following error:

$ sudo mount -t nfs4 192.168.145.131:/workspace nfs/ -v
mount.nfs4: timeout set for Sat Apr 19 19:16:51 2014
mount.nfs4: trying text-based options 'addr=192.168.145.131,clientaddr=192.168.145.128'
mount.nfs4: mount(2): No such device
mount.nfs4: No such device

I have also tried mounting /export/workspace and /home/workspace but that gives me the same error. I have tried loading the NFS module using modprobe on both client and server, but the module is loaded on both client and server.

dawud
  • 15,096
  • 3
  • 42
  • 61
Shehbaz Jaffer
  • 181
  • 1
  • 1
  • 6
  • What is in the logs on the NFS server? Also don't waste your time trying to use exports that don't exist! – Michael Hampton Apr 20 '14 at 15:29
  • Thanks @MichaelHampton for your reply. The logs only showed me the same error: `no such device`. The problem lied with my kernel config file. see the details below. – Shehbaz Jaffer Apr 20 '14 at 19:25

3 Answers3

2

Solved the problem after 3 days!!

I tried mounting the nfs4 server folder from a client with a newer Kernel version (3.8). I was able to do so. So I copied the configuration file /boot/configure-3.8-generic file to my /usr/src/.config, and enabled the option Filesystems -> Network File Systems -> NFS3 client load as module and NFS4 client load as module.

compiled my kernel again, created initrd image, updated grub, and now I am able to mount the server folder from my 2.6 kernel client also!

Shehbaz Jaffer
  • 181
  • 1
  • 1
  • 6
2

I met the error mount.nfs4: No such device after a system upgrade, and later it was solved by a reboot.

It seems that the problem is that the old kernel module directory /usr/lib/modules/$(uname -r)/ is deleted after the system upgrade, which causes a failure loading the module for nfs things.

golopot
  • 172
  • 7
0

I had the same problem on Xen virtual host when I was using Ubuntu 14.04 on host providing a-too-old kernel to the virtual machine running Ubuntu 18.04, and which didn't have the /lib/modules/ for the older kernel.

I updated the kernel (to boot) to match the version (modules available) inside the virtual host, and now the kernel module loads ok, as other have found out, too.

PHZ.fi-Pharazon
  • 261
  • 1
  • 10