Coder Social home page Coder Social logo

Comments (12)

andyneff avatar andyneff commented on May 24, 2024 4

Just an update, I still have the exact same behavior with the new alpine version. So I'm not sure why, but I have to have fsid=0

Summary

Does not work (for version 4 and 3)

  • No fsid, mount as /
  • No fsid mount as /nfs
  • fsid=1, mount as /
  • fsid=1 mount as /nfs
  • fsid=0 mount as /nfs

Works

  • fsid=0 mount as /
NFS_EXPORT_0=/nfs *(rw,insecure,no_subtree_check,fsid=0,no_root_squash)

Sorry if this is all just due to my lack of knowledge in how to set nfs from scratch.

from docker-nfs-server.

andyneff avatar andyneff commented on May 24, 2024 1

I had this exact same problem, only the solution was https://www.cyberciti.biz/faq/mount-nfs4-reason-given-by-server-no-such-file-directory/

Basically I had to give my one mount fsid=0 (non-0 was not working) and then I had to mount it as /, not /nfs (or whatever)

from docker-nfs-server.

ehough avatar ehough commented on May 24, 2024

Thanks for your question. I was able to reproduce this error on my workstation, so it definitely appears to be a bug. I'm working on it now and will report back here once I have a fix.

Did you already succeed mounting the share using the host ip ?

Yes, I have the image running on my personal NAS and I'm able to access it remotely via the host's IP. So I know it works in some cases..

from docker-nfs-server.

ehough avatar ehough commented on May 24, 2024

Have you tried to mount the share from a remote host? i.e. a client that is not 10.2.4.110?

In my testing, the problem seems isolated to the loopback interface; I can mount from remote hosts without issue, but not via localhost. Still trying to gain a better understanding.

from docker-nfs-server.

n1b0r avatar n1b0r commented on May 24, 2024

Yes we did the tests with from local host and from remote hosts with same error.
These are private openstack vm instances.
I will try on physical hosts asap and let you know.

from docker-nfs-server.

ehough avatar ehough commented on May 24, 2024

I did some more testing and had some success. The trick for me was to expose ports 111 and 32767 (in addition to 2049) when trying to mount a share via NFS v3. i.e.

ehough@nas ~ > docker run ... -p 2049:2049 -p 111:111 -p 32767:32767 erichough/nfs-server

And mounting from a separate machine on my LAN:

ehough@blue ~ > sudo mount -v -t nfs -o nfsvers=3,proto=tcp nas:/nfs/htpc-media ./nas
mount.nfs: timeout set for Tue May  8 21:52:18 2018
mount.nfs: trying text-based options 'nfsvers=3,proto=tcp,addr=192.168.1.99'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 192.168.1.99 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=6
mount.nfs: trying 192.168.1.99 prog 100005 vers 3 prot TCP port 32767

Mounting from the Docker host (nas in the example above) works just as well. For NFS v4, you only need to expose port 2049.

Could you try to expose ports 2049, 111 and 32767 to see if that fixes things for you? If you're still having trouble after that, could you paste the logs from your erichough/nfs-server container so I could study the issue further?

from docker-nfs-server.

ehough avatar ehough commented on May 24, 2024

Just checking in. Were you able to get things working? Let us know - thanks!

from docker-nfs-server.

ehough avatar ehough commented on May 24, 2024

Closing due to inactivity, but feel free to re-open.

from docker-nfs-server.

ehough avatar ehough commented on May 24, 2024

@andyneff Could you share a copy of your /etc/exports or any further details of your setup? My understanding is that using the fsid parameter is only required in very rare situations, like when NFS has trouble uniquely identifying the underlying filesystem.

I'd just like to make sure that the README isn't missing any docs that could've helped you.

from docker-nfs-server.

andyneff avatar andyneff commented on May 24, 2024

Disclaimer: I know (little to) nothing about the exports file.

This is my compose file

  nfs:
    depends_on:
      - modprobe
    image: erichough/nfs-server
    ports:
      - '2049:2049'
      # - '2049:2049/udp'
      # - '111:111'
      # - '111:111/udp'
      # - '32765:32765'
      # - '32765:32765/udp'
      # - '32767:32767'
      # - '32767:32767/udp'
    cap_add:
      - SYS_ADMIN
    volumes:
      - type: bind
        source: /tmp/nfs
        target: /nfs
    environment:
      - NFS_EXPORT_0=/nfs *(rw,insecure,no_subtree_check,fsid=0,no_root_squash)

If I did not specify the fsid, I got an error message saying I had to specify the fsid. I read a little about it and first thought "Well, it's not my /, so fsid=1)

nfs_1       | ==================================================================
nfs_1       |       STARTING SERVICES
nfs_1       | ==================================================================
nfs_1       | ----> mounting rpc_pipefs filesystem onto /var/lib/nfs/rpc_pipefs
nfs_1       | mount: rpc_pipefs mounted on /var/lib/nfs/rpc_pipefs.
nfs_1       | ----> mounting nfsd filesystem onto /proc/fs/nfsd
nfs_1       | mount: nfsd mounted on /proc/fs/nfsd.
nfs_1       | ----> starting rpcbind
nfs_1       | ----> exporting filesystem(s)
nfs_1       | exportfs: /nfs requires fsid= for NFS export
nfs_1       | exporting *:/nfs
nfs_1       | ----> 
nfs_1       | ----> ERROR: exportfs failed
nfs_1       | ----> 

Running on Fedora 29

from docker-nfs-server.

ehough avatar ehough commented on May 24, 2024

exportfs: /nfs requires fsid= for NFS export

I've never seen that error before but will research it. Have you tried changing the source from /tmp to something else? Wondering if something like this would also fail:

volumes:
  - type: bind
   source: /home/andyneff/foo
   target: /bar
environment:
  - NFS_EXPORT_0=/bar *(rw,insecure,no_subtree_check,no_root_squash)

I guess I'm just trying to figure out if it's an issue with the filesystem on the host's end or the container's end.

from docker-nfs-server.

andyneff avatar andyneff commented on May 24, 2024
mount | grep /tmp
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,seclabel)

Yes, now that you mention it, when I it on my btrfs, it works

mount | grep /opt
/dev/sdc3 on /opt type btrfs (rw,relatime,seclabel,ssd,space_cache,subvolid=259,subvol=/opt)

Update

However, without fsid=0 (using a /opt dir), I'm back to I can't mount the filesystem.

# Both these fail
> mount -v {server_ip}:/nfs -o "vers=4.2,soft,intr"  /mnt
> mount -v {server_ip}:/ -o "vers=4.2,soft,intr"  /mnt
mount.nfs: timeout set for Thu Jan 31 16:29:30 2019
mount.nfs: trying text-based options 'vers=4.2,soft,intr,addr={server_ip},clientaddr={client_ip}'
mount.nfs: mount(2): No such file or directory
mount.nfs: mounting {server_ip}:/nfs failed, reason given by server: No such file or directory

from docker-nfs-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.