NFS client under WSL - mount.nfs: No such device

2020-08-09 17:35发布

问题:

I am getting the following error trying to mount a nfs export.

sudo mount 192.168.1.175:/mnt/nas /mnt/c/nas
mount.nfs: No such device

Any ideas on how to fix this?

回答1:

The error indicates the nfs kernel modules are not loaded correctly and also verify the exported path "/mnt/nas" exists on sever "192.168.1.175" or not.



回答2:

first of all,we understand nfs is one of tctp/ip protocol, so one client and one server are needed, So our purpose is sharing a dir on windows or wsl to a another linux, that means the windows or wsl is a server, all you guys are right about wsl nfs, it doesnt work if we use the wsl nfs inside, we can make a another nfs server on windows instead of wsl, and configure the share dirs right which we can find the dirs on wsl, e.g. /mnt/d/WORK/tftpserverDir, after that we can mount successfully. those are tips of me:

  1. make a nfs server on windows I dowwnload from this:

    https://www.hanewin.net/nfs-e.htm

  2. configure the shared dir in exports file

    D:\WORK\tftpserverDir -name:nfsroot -umask:000 -public -mapall:0

  3. mount the share dirs on your dst linux

mount -t nfs -o nolock -o tcp -o rsize=32768,wsize=32768 172.10.10.80:/nfsroot /sdcard/mnt