NFSv4 shares with option `-vers=4.0` are not mounted: mount(nfs): no hosts available
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
autofs (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Cosmic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
* Specifying NFS v4 works, but using subversion fails.
To make it worse v4.2 is considered not v4 at all which is not what
users expect or need. If then your server does not support v4 the
mount fails.
* This is fixed upstream for a while, backport the patch from there to at
lest the latest LTS (older ones are unlikely to suddenly need version
4.x).
[Test Case]
* This is a bit tricky you need a NFS server that is "less tolerant" liek
the one reported in comment #5. If you have such a server set up
configure your exports following [1] (or similar)
I usually place a file called "testfile" in that export to check if it
exists, feel free to do similarly.
* Then on the client side install autofs and follow [2]
The summary of those steps is:
- you need the autofs4 kernel module which is in linux-modules-extra
so install that if you don't have it.
- configure your autofs.master to use a nfs mount for example
$ echo "/nfs/ /etc/auto.nfs" | sudo tee -a /etc/auto.master
$ sudo mkdir -p /nfs/testmount
$ echo "testmount -fstype=
$ ll /nfs/testmount/
-rw-r--r-- 1 root root 0 Mar 1 10:43 /nfs/testmount/
Without the fix it will fail to mount and "/nfs/testmount" will be an
empty unmoutned directory.
With the fix you will see the mount working
(from mount output)
192.
(rw,
proto=
clientaddr
[1]: https:/
[2]: https:/
[Regression Potential]
* The change is minimal and just changes from a full string match to a
prefix match. In theory that could make configurations which today
specify 4.2 (and silently fail doing so as this is broken) then
"suddenly" really use v4 which it currently does not always do.
v4.2 currently is mounted as v4 and after the change will be mounted as
v4.2 as specified - but that is the fix and not so much a regression.
[Other Info]
* n/a
---
With Ubuntu 18.10 and autofs 5.1.2-4ubuntu1, mounting NFSv4 shares does not work. Directly mounting them with `mount.nfs` works.
```
Feb 28 18:08:30 nfsclient automount[22978]: expire_proc: exp_proc = 131147807650128 path /home_mariux
Feb 28 18:08:30 nfsclient automount[22978]: expire_cleanup: got thid 131147807650128 path /home_mariux stat 0
Feb 28 18:08:30 nfsclient automount[22978]: expire_cleanup: sigchld: exp 131147807650128 finished, switching from 2 to 1
Feb 28 18:08:30 nfsclient automount[22978]: st_ready: st_ready(): state = 2 path /home_mariux
Feb 28 18:08:32 nfsclient automount[22978]: handle_packet: type = 3
Feb 28 18:08:32 nfsclient automount[22978]: handle_
Feb 28 18:08:32 nfsclient automount[22978]: attempting to mount entry /home_mariux/joey
Feb 28 18:08:32 nfsclient automount[22978]: lookup_mount: lookup(file): looking up joey
Feb 28 18:08:32 nfsclient automount[22978]: lookup_mount: lookup(file): joey -> claptrap:
Feb 28 18:08:32 nfsclient automount[22978]: parse_mount: parse(sun): expanded entry: claptrap:
Feb 28 18:08:32 nfsclient automount[22978]: parse_mount: parse(sun): gathered options: nosuid
Feb 28 18:08:32 nfsclient automount[22978]: parse_mount: parse(sun): dequote(
Feb 28 18:08:32 nfsclient automount[22978]: parse_mount: parse(sun): core of entry: options=nosuid, loc=claptrap:
Feb 28 18:08:32 nfsclient automount[22978]: sun_mount: parse(sun): mounting root /home_mariux, mountpoint joey, what claptrap:
Feb 28 18:08:32 nfsclient automount[22978]: mount_mount: mount(nfs): root=/home_mariux name=joey what=claptrap:
Feb 28 18:08:32 nfsclient automount[22978]: mount_mount: mount(nfs): nfs options="nosuid", nobind=0, nosymlink=0, ro=0
Feb 28 18:08:32 nfsclient automount[22978]: get_nfs_info: called with host claptrap(
Feb 28 18:08:32 nfsclient automount[22978]: get_nfs_info: called with host claptrap(
Feb 28 18:08:32 nfsclient automount[22978]: mount(nfs): no hosts available
Feb 28 18:08:32 nfsclient automount[22978]: dev_ioctl_
Feb 28 18:08:32 nfsclient automount[22978]: failed to mount /home_mariux/joey
Feb 28 18:08:32 nfsclient automount[22978]: st_readmap: state 1 path /home_mariux
Feb 28 18:08:32 nfsclient automount[22978]: handle_packet: type = 3
Feb 28 18:08:32 nfsclient automount[22978]: handle_
Feb 28 18:08:32 nfsclient automount[22978]: dev_ioctl_
Feb 28 18:08:32 nfsclient automount[22978]: re-reading map for /home_mariux
Feb 28 18:08:32 nfsclient automount[22978]: lookup_
Feb 28 18:08:32 nfsclient automount[22978]: do_init: parse(sun): init gathered global options: nosuid
Feb 28 18:08:32 nfsclient automount[22978]: st_ready: st_ready(): state = 4 path /home_mariux
```
Related branches
- Andreas Hasenack: Needs Fixing
- Canonical Server Core Reviewers: Pending requested
- Canonical Server: Pending requested
-
Diff: 132 lines (+104/-0) (has conflicts)4 files modifieddebian/changelog (+11/-0)
debian/patches/lp1680224-fix-double-quoting-in-auto_smb.patch (+26/-0)
debian/patches/lp1680224-fix-offset-mount-location-multiple-expa.patch (+62/-0)
debian/patches/series (+5/-0)
- Andreas Hasenack: Approve
- Canonical Server: Pending requested
- git-ubuntu developers: Pending requested
-
Diff: 72 lines (+50/-0)3 files modifieddebian/changelog (+7/-0)
debian/patches/autofs-5.1.3-handle-additional-nfs-versions-in-mount.patch (+42/-0)
debian/patches/series (+1/-0)
- Andreas Hasenack: Approve
- Canonical Server packageset reviewers: Pending requested
- Canonical Server: Pending requested
-
Diff: 72 lines (+50/-0)3 files modifieddebian/changelog (+7/-0)
debian/patches/autofs-5.1.3-handle-additional-nfs-versions-in-mount.patch (+42/-0)
debian/patches/series (+1/-0)
- Andreas Hasenack: Approve
- Canonical Server: Pending requested
- git-ubuntu developers: Pending requested
-
Diff: 72 lines (+50/-0)3 files modifieddebian/changelog (+7/-0)
debian/patches/autofs-5.1.3-handle-additional-nfs-versions-in-mount.patch (+42/-0)
debian/patches/series (+1/-0)
summary: |
- NFSv4 shares are not mounted: mount(nfs): no hosts available + NFSv4 shares with option `-vers=4.0` are not mounted: mount(nfs): no + hosts available |
Changed in autofs (Ubuntu Bionic): | |
status: | Confirmed → In Progress |
Changed in autofs (Ubuntu Cosmic): | |
status: | Confirmed → In Progress |
I was following https:/ /help.ubuntu. com/community/ SettingUpNFSHow To in two KVM machines using 18.10 /wiki.ubuntuuse rs.de/Autofs/
and then https:/
(note you need linux-generic to get autofs4 module)
In exports I have users/testmount 192.168. 122.0/24( rw,insecure, no_subtree_ check,async) users/testmount users/testmount /testfile
/export/
$ sudo mkdir -p /export/
$ sudo touch /export/
After that in my case I can mount it like: 122.55: /export/ users/testmount /mnt
sudo mount -v -t nfs 192.168.
Now trying that via automount: nfs,rw, retry=0 192.168. 122.55: /export/ users/testmount " | sudo tee -a /etc/auto.nfs testfile testfile
$ echo "/nfs/ /etc/auto.nfs" | sudo tee -a /etc/auto.master
$ sudo mkdir -p /nfs/testmount
$ echo "testmount -fstype=
$ ll /nfs/testmount/
-rw-r--r-- 1 root root 0 Mar 1 10:43 /nfs/testmount/
The mount works just fine and it is v4 (from mount) 122.55: /export/ users/testmount on /nfs/testmount type nfs4 (rw,relatime, vers=4. 2,rsize= 65536,wsize= 65536,namlen= 255,hard, proto=tcp, timeo=600, retrans= 2,sec=sys, clientaddr= 192.168. 122.226, local_lock= none,addr= 192.168. 122.55)
192.168.
It must be something to your local configuration that is different.
I have to ask you to try setting up two clean VMs as well and then modifying the config I used to step by step to match yours.
That should either reveal which change broke your case.
Or you'll end up with a step by step howto that developers can follow to further debug your case.