0

I have 2 VMs, both running debian buster. One is a test VM, the other my production file server. On both I installed the nfs server package through "apt install". I created a share on the test VM called nfs under /mnt/nfs. This folder is owned by nobody:nogroup. In my exports file I have the following content:

/mnt/nfs *(rw,sync,no_subtree_check,no_root_squash,no_all_squash,insecure)

There is no volume or harddrive attached to this "mountpoint" it is just a directory. When I mount this folder on another machine through sudo mount -t nfs testVM:/mnt/nfs /mnt/disk the volume is mounted as NFS4!!!!! This is what I want and it is awesome. (obviously the "other" machine contains the nfs-common package so I can mount the share in the first place)

Now to my issue. On my production file server, on which the same packages are installed, there are 6 volumes (raid partitions) mounted. They are managed by the host (proxmox virtualization environment) and passed through to the VM. I added which folder I wanted to share in the exports file and exported these folders through exportfs -rav. As an example, I have shared the following folder:

/srv/test *(rw,sync,no_subtree_check,no_root_squash,no_all_squash,insecure)

Which was supposed to be a test to see if I share a folder without anything attached externally what would happen. Unfortunately that does not work and every time I am trying to mount an nfs share as NFS4 the mount reverts back to NFS3.

Whatever I am trying nothing gets mounted to any other VM or any other machine, for that matter, as an NFS4 share. Everything is just shared as NFS3, which I don't want as NFS4 supports additional features that I need in order to make other stuff work in my network (especially file locking).

Does anybody have any ideas why I am unable to us a NFS4 from my test machine but not from my production file server?

6
  • How do you try to mount the share from your production server? Have you tried adding an explicit version while mounting (-o vers=4.2) and what is the result?
    – Sethos II
    Jun 25, 2021 at 11:46
  • @SethosII sorry for my late reply and thanks for yours. I tried to mount a share just now with sudo mount -t nfs -o vers=4.2 and sudo mount.nfs -o vers=4.2. Obviously I used a mount that existed but I am getting the error mount.nfs: mounting <IP>:/mnt/path failed, reason given by server: No such file or directory.
    – realShadow
    Jun 29, 2021 at 1:28
  • Ok, try with just <SERVER IP>:/path without /mnt. Sadly there is no way to list available NFS exports on the client with NFS4. Before NFS4 you could use showmount -e <SERVER IP>. But the No such file or directory points to something with the path and if I remember correctly NFS4 changed the way how paths are shown to the clients.
    – Sethos II
    Jun 29, 2021 at 17:17
  • @SethosII But how should that work? the /mnt is part of the path. The share is at /mnt/volume6/kubedata.
    – realShadow
    Jun 29, 2021 at 17:48
  • NFS4 has a concept of a root for the exports. Depending on where this is set you need to leave out the preceeding path. See fsid in the manpage of exports. You could test to set fsid=0 as an option to your export and mount with IP:/ without any path as it will use the exported directory with fsid=0 as the root.
    – Sethos II
    Jul 15, 2021 at 7:48

0

You must log in to answer this question.

Browse other questions tagged .