# mount refuses to mount NFS filesystems

## Malvineous

Hi all,

I rebooted my Gentoo box last night and since then I haven't been able to mount any NFS shares.  It keeps failing with some bogus error:

```
$ mount gnosticus:/mnt/scratch /mnt/scratch

mount: wrong fs type, bad option, bad superblock on gnosticus:/mnt/scratch,

       missing codepage or other error

       In some cases useful info is found in syslog - try

       dmesg | tail  or so
```

I wondered whether it was trying to mount NFSv4, so if I force version two or three the message changes:

```
$ mount gnosticus:/mnt/scratch /mnt/scratch -o vers=3

mount: block device gnosticus:/mnt/scratch is write-protected, mounting read-only

mount: cannot mount block device gnosticus:/mnt/scratch read-only

```

I've got no idea what the problem is, as I can't mount shares from any of my LAN servers with exactly the same error.  According to wireshark, 'mount' doesn't even try to contact the server, and this is verified by the fact that I can put whatever I want as the host name:

```
$ mount yousuck:/blah /mnt/scratch

mount: wrong fs type, bad option, bad superblock on yousuck:/blah,

       missing codepage or other error

       In some cases useful info is found in syslog - try

       dmesg | tail  or so
```

No log files tell me anything, and I had NFS compiled in but I've just recompiled the kernel putting NFS as modules but it made no difference.

```
$ strace mount gnosticus:/mnt/scratch /mnt/scratch

...

stat("gnosticus:/mnt/scratch", 0x7fff59a49340) = -1 ENOENT (No such file or directory)

stat("/sbin/mount.nfs", 0x7fff59a48f00) = -1 ENOENT (No such file or directory)

rt_sigprocmask(SIG_BLOCK, ~[TRAP SEGV RTMIN RT_1], NULL, 8) = 0

stat("/sbin/mount.nfs", 0x7fff59a48ee0) = -1 ENOENT (No such file or directory)

mount("gnosticus:/mnt/scratch", "/mnt/scratch", "nfs"..., MS_MGC_VAL, NULL) = -1 EINVAL (Invalid argument)

rt_sigprocmask(SIG_UNBLOCK, ~[TRAP SEGV RTMIN RT_1], NULL, 8) = 0

...

$ strace mount gnosticus:/mnt/scratch /mnt/scratch -o vers=3

...

stat("gnosticus:/mnt/scratch", 0x7fff5d950220) = -1 ENOENT (No such file or directory)

stat("/sbin/mount.nfs", 0x7fff5d94fde0) = -1 ENOENT (No such file or directory)

rt_sigprocmask(SIG_BLOCK, ~[TRAP SEGV RTMIN RT_1], NULL, 8) = 0

stat("/sbin/mount.nfs", 0x7fff5d94fdc0) = -1 ENOENT (No such file or directory)

mount("gnosticus:/mnt/scratch", "/mnt/scratch", "nfs"..., MS_MGC_VAL, "vers=3"...) = -1 EACCES (Permission denied)

rt_sigprocmask(SIG_UNBLOCK, ~[TRAP SEGV RTMIN RT_1], NULL, 8) = 0

...

```

Any ideas?  I'm stuck.

----------

## schachti

 *Malvineous wrote:*   

> 
> 
> I've got no idea what the problem is, as I can't mount shares from any of my LAN servers with exactly the same error.  According to wireshark, 'mount' doesn't even try to contact the server, and this is verified by the fact that I can put whatever I want as the host name:
> 
> 

 

Does it work if you use the IP address instead of the hostname? Maybe it's a problem with the name resolution...

----------

## Malvineous

Aargh!  After hours of fiddling I finally emerged an updated version of nfs-utils and the problem went away!  It seems to be working fine now.

It wasn't working when I used an IP address either, and in fact using "localhost" or "127.0.0.1" wouldn't even let me mount shares from the local machine (but remote systems could mount my local shares fine.)  The rest of the network (+Internet) access on the machine is fine.

No idea what the problem was, but perhaps it was a bug that just took a while to show itself, and had already been fixed.

----------

## cpwins

I had the same problem: suddenly I couldn't mount NFS drives anymore. I noticed net-fs/nfs-utils wasn't installed anymore, so I added the "NFS" useflag and then did "emerge -auDN world --with-bdeps=y"

----------

## hifi

Yep same here. /sbin/mount.nfs disapeared. How the F*!? could this happen?

And portage on nfs, haha .... thank good a second machine with working mount.nfs exists ...

----------

## dbc

I just did an --update system and picked up about 39 packages.  NFS no longer mounts, mount.nfs missing in action.  Not sure which package broke, but something is bad.  will try to re emerge nfs-utils.

----------

## dbc

Yup.  Had to unmerge the libgssapi to unblock nfs-utils, and emege --update nfs-utils.  /sbin/mount.nfs raised from the dead.  Whodunnit?

----------

