NFS broken in my system

Today I decided to upgrade the router I use for iot and network backups (WZR-HP-G300NH). It was still running Chaos Calmer so I downloaded and installed 19.07.2
But I realized that NFS support is still broken for my device.

Is there anything to do here besides the downgrading the full system?
I would like to do that (getting nfs packages from 17 repos) but I don't know how.
If so, can someone tell me what was the last known version to work?

Thanks.

How doesn't nfs work for you? It is not generally broken in 19.07.2.

I'm experiencing the same like in:

As I said, NFSv3 is working here with 19.07.2. But I remember faintly, I was missing one package which didn't make it work at first.

Here is my list of installed nfs packages, maybe that helps you:

kmod-fs-nfs - 4.14.171-1 - Kernel module for NFS client support
kmod-fs-nfs-common - 4.14.171-1 - Common NFS filesystem modules
kmod-fs-nfs-common-rpcsec - 4.14.171-1 - Kernel modules for NFS Secure RPC
kmod-fs-nfs-v3 - 4.14.171-1 - Kernel module for NFS v3 client support
kmod-fs-nfs-v4 - 4.14.171-1 - Kernel module for NFS v4 support
kmod-fs-nfsd - 4.14.171-1 - Kernel module for NFS kernel server support
nfs-kernel-server - 2.3.4-3 - Kernel NFS server support
nfs-kernel-server-utils - 2.3.4-3 - NFS server utils
nfs-utils - 2.3.4-3 - Updated mount.nfs command - allows mounting nfs4 volumes
nfs-utils-libs - 2.3.4-3 - Libraries provided by nfs-utils
rpcbind - 1.2.5-4 -

I will try to reinstall 19.07.2 and manually install your list.

But anyways, installing 18.6.2 and using the instructions in post 17 of NFS broken again allowed me to mount the share in my computer.

Before, portmap was not resolved and installed.

Another thing I don't understand is why the disk is completely emptied when I install it. It had put testing contents on it but could be fatal if I had inserted the backup media.

Edit: The disk was not emptied, I misspelled the mount point and mounted a subfolder on the disk that was empty.

Trying to do the install with 19.07.2 and your packages:

root@buffalo:~# cat /etc/exports 
/export *(ro,sync,no_subtree_check,fsid=0)
/export/backup 192.168.10.0/24(rw,sync,no_subtree_check,no_root_squash,nohide) 192.168.0.0/24(rw,sync,no_subtree_check,no_root_squash,nohide) 192.168.50.0/24(rw,sync,no_subtree_check,no_root_squash,nohide)
root@buffalo:~# opkg install nfs-kernel-server
    
Installing nfs-kernel-server (2.3.4-3) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/packages/mips_24kc/packages/nfs-kernel-server_2.3.4-3_mips_24kc.ipk
Installing libwrap (7.6-2) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/packages/mips_24kc/packages/libwrap_7.6-2_mips_24kc.ipk
Installing librt (1.1.24-2) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/targets/ar71xx/generic/packages/librt_1.1.24-2_mips_24kc.ipk
Installing libuuid1 (2.34-1) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/packages/mips_24kc/base/libuuid1_2.34-1_mips_24kc.ipk
Installing libblkid1 (2.34-1) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/packages/mips_24kc/base/libblkid1_2.34-1_mips_24kc.ipk
Installing libtirpc (1.2.5-1) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/packages/mips_24kc/packages/libtirpc_1.2.5-1_mips_24kc.ipk
Installing kmod-fs-nfs-common (4.14.171-1) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/targets/ar71xx/generic/kmods/4.14.171-1-342af9e4f67b3447c53216ab8e3b12a1/kmod-fs-nfs-common_4.14.171-1_mips_24kc.ipk
Installing kmod-fs-exportfs (4.14.171-1) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/targets/ar71xx/generic/kmods/4.14.171-1-342af9e4f67b3447c53216ab8e3b12a1/kmod-fs-exportfs_4.14.171-1_mips_24kc.ipk
Installing kmod-crypto-des (4.14.171-1) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/targets/ar71xx/generic/kmods/4.14.171-1-342af9e4f67b3447c53216ab8e3b12a1/kmod-crypto-des_4.14.171-1_mips_24kc.ipk
Installing kmod-crypto-null (4.14.171-1) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/targets/ar71xx/generic/kmods/4.14.171-1-342af9e4f67b3447c53216ab8e3b12a1/kmod-crypto-null_4.14.171-1_mips_24kc.ipk
Installing kmod-crypto-aead (4.14.171-1) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/targets/ar71xx/generic/kmods/4.14.171-1-342af9e4f67b3447c53216ab8e3b12a1/kmod-crypto-aead_4.14.171-1_mips_24kc.ipk
Installing kmod-crypto-pcompress (4.14.171-1) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/targets/ar71xx/generic/kmods/4.14.171-1-342af9e4f67b3447c53216ab8e3b12a1/kmod-crypto-pcompress_4.14.171-1_mips_24kc.ipk
Installing kmod-crypto-manager (4.14.171-1) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/targets/ar71xx/generic/kmods/4.14.171-1-342af9e4f67b3447c53216ab8e3b12a1/kmod-crypto-manager_4.14.171-1_mips_24kc.ipk
Installing kmod-crypto-cbc (4.14.171-1) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/targets/ar71xx/generic/kmods/4.14.171-1-342af9e4f67b3447c53216ab8e3b12a1/kmod-crypto-cbc_4.14.171-1_mips_24kc.ipk
Installing kmod-crypto-cts (4.14.171-1) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/targets/ar71xx/generic/kmods/4.14.171-1-342af9e4f67b3447c53216ab8e3b12a1/kmod-crypto-cts_4.14.171-1_mips_24kc.ipk
Installing kmod-crypto-md5 (4.14.171-1) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/targets/ar71xx/generic/kmods/4.14.171-1-342af9e4f67b3447c53216ab8e3b12a1/kmod-crypto-md5_4.14.171-1_mips_24kc.ipk
Installing kmod-crypto-sha1 (4.14.171-1) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/targets/ar71xx/generic/kmods/4.14.171-1-342af9e4f67b3447c53216ab8e3b12a1/kmod-crypto-sha1_4.14.171-1_mips_24kc.ipk
Installing kmod-crypto-hmac (4.14.171-1) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/targets/ar71xx/generic/kmods/4.14.171-1-342af9e4f67b3447c53216ab8e3b12a1/kmod-crypto-hmac_4.14.171-1_mips_24kc.ipk
Installing kmod-crypto-ecb (4.14.171-1) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/targets/ar71xx/generic/kmods/4.14.171-1-342af9e4f67b3447c53216ab8e3b12a1/kmod-crypto-ecb_4.14.171-1_mips_24kc.ipk
Installing kmod-fs-nfs-common-rpcsec (4.14.171-1) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/targets/ar71xx/generic/kmods/4.14.171-1-342af9e4f67b3447c53216ab8e3b12a1/kmod-fs-nfs-common-rpcsec_4.14.171-1_mips_24kc.ipk
Installing kmod-fs-nfsd (4.14.171-1) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/targets/ar71xx/generic/kmods/4.14.171-1-342af9e4f67b3447c53216ab8e3b12a1/kmod-fs-nfsd_4.14.171-1_mips_24kc.ipk
Installing kmod-dnsresolver (4.14.171-1) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/targets/ar71xx/generic/kmods/4.14.171-1-342af9e4f67b3447c53216ab8e3b12a1/kmod-dnsresolver_4.14.171-1_mips_24kc.ipk
Installing kmod-fs-nfs (4.14.171-1) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/targets/ar71xx/generic/kmods/4.14.171-1-342af9e4f67b3447c53216ab8e3b12a1/kmod-fs-nfs_4.14.171-1_mips_24kc.ipk
Installing kmod-fs-nfs-v4 (4.14.171-1) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/targets/ar71xx/generic/kmods/4.14.171-1-342af9e4f67b3447c53216ab8e3b12a1/kmod-fs-nfs-v4_4.14.171-1_mips_24kc.ipk
Installing rpcbind (1.2.5-4) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/packages/mips_24kc/packages/rpcbind_1.2.5-4_mips_24kc.ipk
Installing libkeyutils1 (1.6-3) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/packages/mips_24kc/packages/libkeyutils1_1.6-3_mips_24kc.ipk
Installing kmod-dax (4.14.171-1) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/targets/ar71xx/generic/kmods/4.14.171-1-342af9e4f67b3447c53216ab8e3b12a1/kmod-dax_4.14.171-1_mips_24kc.ipk
Installing kmod-dm (4.14.171-1) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/targets/ar71xx/generic/kmods/4.14.171-1-342af9e4f67b3447c53216ab8e3b12a1/kmod-dm_4.14.171-1_mips_24kc.ipk
Installing libdevmapper (2.03.02-2) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/packages/mips_24kc/packages/libdevmapper_2.03.02-2_mips_24kc.ipk
Installing nfs-utils-libs (2.3.4-3) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/packages/mips_24kc/packages/nfs-utils-libs_2.3.4-3_mips_24kc.ipk
Configuring kmod-crypto-null.
Configuring kmod-crypto-aead.
Configuring kmod-crypto-pcompress.
Configuring kmod-crypto-manager.
Configuring kmod-crypto-cts.
Configuring kmod-crypto-md5.
Configuring kmod-fs-nfs-common.
Configuring kmod-fs-exportfs.
Configuring kmod-crypto-des.
Configuring kmod-crypto-cbc.
Configuring kmod-crypto-sha1.
Configuring kmod-crypto-hmac.
Configuring kmod-crypto-ecb.
Configuring kmod-fs-nfs-common-rpcsec.
Configuring kmod-fs-nfsd.
Configuring librt.
Configuring libuuid1.
Configuring kmod-dax.
Configuring kmod-dm.
Configuring libwrap.
Configuring libkeyutils1.
Configuring libblkid1.
Configuring kmod-dnsresolver.
Configuring kmod-fs-nfs.
Configuring kmod-fs-nfs-v4.
Configuring libtirpc.
Configuring rpcbind.
Configuring libdevmapper.
Configuring nfs-utils-libs.
Configuring nfs-kernel-server.
exportfs: /export does not support NFS export
Collected errors:
 * resolve_conffiles: Existing conffile /etc/exports is different from the conffile in the new package. The new conffile will be placed at /etc/exports-opkg.
root@buffalo:~# 
root@buffalo:~# opkg install kmod-fs-nfs-v3 kmod-fs-nfs-v4 nfs-kernel-server-utils nfs-utils nfs-utils-libs rpcbind
Installing kmod-fs-nfs-v3 (4.14.171-1) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/targets/ar71xx/generic/kmods/4.14.171-1-342af9e4f67b3447c53216ab8e3b12a1/kmod-fs-nfs-v3_4.14.171-1_mips_24kc.ipk
Package kmod-fs-nfs-v4 (4.14.171-1) installed in root is up to date.
Installing nfs-kernel-server-utils (2.3.4-3) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/packages/mips_24kc/packages/nfs-kernel-server-utils_2.3.4-3_mips_24kc.ipk
Installing nfs-utils (2.3.4-3) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/packages/mips_24kc/packages/nfs-utils_2.3.4-3_mips_24kc.ipk
Package nfs-utils-libs (2.3.4-3) installed in root is up to date.
Package rpcbind (1.2.5-4) installed in root is up to date.
Configuring nfs-kernel-server-utils.
Configuring kmod-fs-nfs-v3.
Configuring nfs-utils.
root@buffalo:~# /etc/init.d/portmap enable
-ash: /etc/init.d/portmap: not found
root@buffalo:~# /etc/init.d/nfsd enable
root@buffalo:~# /etc/init.d/portmap start
-ash: /etc/init.d/portmap: not found
root@buffalo:~# /etc/init.d/nfsd start
exportfs: /export does not support NFS export
root@buffalo:~# showmount -e
clnt_create: RPC: Unable to receive

In my computer (directly connected and all):

sergio@redcomet:~$ showmount -e 192.168.10.4
clnt_create: RPC: Unable to receive

dmesg

[  715.138419] usb 1-1: new high-speed USB device number 2 using ehci-platform
[  715.341882] usb-storage 1-1:1.0: USB Mass Storage device detected
[  715.349541] scsi host0: usb-storage 1-1:1.0
[  716.409336] scsi 0:0:0:0: Direct-Access     WDC WD32 00BPVT-80JJ5T0        PQ: 0 ANSI: 2 CCS
[  716.422239] sd 0:0:0:0: [sda] 78142806 4096-byte logical blocks: (320 GB/298 GiB)
[  716.430625] sd 0:0:0:0: [sda] Write Protect is off
[  716.435467] sd 0:0:0:0: [sda] Mode Sense: 28 00 00 00
[  716.441885] sd 0:0:0:0: [sda] No Caching mode page found
[  716.447247] sd 0:0:0:0: [sda] Assuming drive cache: write through
[  717.111443]  sda: sda1
[  717.121356] sd 0:0:0:0: [sda] Attached SCSI disk
[  717.485473] EXT4-fs (sda1): recovery complete
[  717.489932] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: 
[  865.780975] do_page_fault(): sending SIGSEGV to modprobe for invalid read access from 77fdb0ac
[  865.789715] epc = 004018d1 in kmodloader[400000+3000]
[  865.794821] ra  = 00401d2f in kmodloader[400000+3000]
[  865.843519] do_page_fault(): sending SIGSEGV to modprobe for invalid read access from 77f3d0ac
[  865.852255] epc = 004018d1 in kmodloader[400000+3000]
[  865.857362] ra  = 00401d2f in kmodloader[400000+3000]
[  875.667194] do_page_fault(): sending SIGSEGV to modprobe for invalid read access from 67f06028
[  875.675937] epc = 77f79ec4 in libc.so[77f06000+98000]
[  875.681078] ra  = 004018fd in kmodloader[400000+3000]
[  875.736371] do_page_fault(): sending SIGSEGV to modprobe for invalid read access from 77f34ff0
[  875.745111] epc = 004018ef in kmodloader[400000+3000]
[  875.750248] ra  = 00401d2f in kmodloader[400000+3000]
[  930.636334] do_page_fault(): sending SIGSEGV to modprobe for invalid read access from 77f5c854
[  930.645086] epc = 004018d1 in kmodloader[400000+3000]
[  930.650212] ra  = 00401d2f in kmodloader[400000+3000]
[  930.721972] do_page_fault(): sending SIGSEGV to modprobe for invalid read access from 77f5c854
[  930.730726] epc = 004018d1 in kmodloader[400000+3000]
[  930.735827] ra  = 00401d2f in kmodloader[400000+3000]
[  956.431288] kmodloader: loading kernel modules from /etc/modules.d/*
[  956.522485] device-mapper: ioctl: 4.37.0-ioctl (2017-09-20) initialised: dm-devel@redhat.com
[  956.547485] Key type dns_resolver registered
[  956.591758] RPC: Registered named UNIX socket transport module.
[  956.597788] RPC: Registered udp transport module.
[  956.602513] RPC: Registered tcp transport module.
[  956.607239] RPC: Registered tcp NFSv4.1 backchannel transport module.
[  956.674083] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[  956.695028] NFS: Registering the id_resolver key type
[  956.700221] Key type id_resolver registered
[  956.704424] Key type id_legacy registered
[  956.711557] kmodloader: done loading kernel modules from /etc/modules.d/*
[  956.846600] kmodloader: loading kernel modules from /etc/modules.d/*
[  956.857033] kmodloader: done loading kernel modules from /etc/modules.d/*
[  957.074852] kmodloader: loading kernel modules from /etc/modules.d/*
[  957.085138] kmodloader: done loading kernel modules from /etc/modules.d/*
[  957.220258] kmodloader: loading kernel modules from /etc/modules.d/*
[  957.230854] kmodloader: done loading kernel modules from /etc/modules.d/*
[  957.365906] kmodloader: loading kernel modules from /etc/modules.d/*
[  957.376333] kmodloader: done loading kernel modules from /etc/modules.d/*
[  957.510944] kmodloader: loading kernel modules from /etc/modules.d/*
[  957.521668] kmodloader: done loading kernel modules from /etc/modules.d/*
[  957.656630] kmodloader: loading kernel modules from /etc/modules.d/*
[  957.666916] kmodloader: done loading kernel modules from /etc/modules.d/*
[  957.803254] kmodloader: loading kernel modules from /etc/modules.d/*
[  957.813613] kmodloader: done loading kernel modules from /etc/modules.d/*
[  957.948598] kmodloader: loading kernel modules from /etc/modules.d/*
[  957.959289] kmodloader: done loading kernel modules from /etc/modules.d/*
[  958.095712] kmodloader: loading kernel modules from /etc/modules.d/*
[  958.106007] kmodloader: done loading kernel modules from /etc/modules.d/*
[  958.241535] kmodloader: loading kernel modules from /etc/modules.d/*
[  958.251815] kmodloader: done loading kernel modules from /etc/modules.d/*
[  958.386824] kmodloader: loading kernel modules from /etc/modules.d/*
[  958.397287] kmodloader: done loading kernel modules from /etc/modules.d/*
[  958.532930] kmodloader: loading kernel modules from /etc/modules.d/*
[  958.543332] kmodloader: done loading kernel modules from /etc/modules.d/*
[  958.678551] kmodloader: loading kernel modules from /etc/modules.d/*
[  958.689215] kmodloader: done loading kernel modules from /etc/modules.d/*
[  959.070294] kmodloader: loading kernel modules from /etc/modules.d/*
[  959.081023] kmodloader: done loading kernel modules from /etc/modules.d/*
[  959.494071] kmodloader: loading kernel modules from /etc/modules.d/*
[  959.511948] kmodloader: done loading kernel modules from /etc/modules.d/*
[  959.792310] kmodloader: loading kernel modules from /etc/modules.d/*
[  959.811931] kmodloader: done loading kernel modules from /etc/modules.d/*
[  960.087294] kmodloader: loading kernel modules from /etc/modules.d/*
[  960.110420] kmodloader: done loading kernel modules from /etc/modules.d/*
[  961.946616] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
[  961.954639] NFSD: starting 10-second grace period (net 804e42d8)
[ 1008.218868] kmodloader: loading kernel modules from /etc/modules.d/*
[ 1008.232853] kmodloader: done loading kernel modules from /etc/modules.d/*

So it seems it's still not working

Edit: The solution for 18.6.2 doesn't work on 19, as it's lacking more dependencies.

switch to nfsv4 not because I know it works but because it's way better and simpler so may have simpler requirements to meet (for example no portmapper required)

Thanks Daniel, can you please share a sample exports file for nfs4?
As you can see I used the mount model of nfs4, as I have on my main NAS, but I may have misunderstood something, because all remote mounts I managed to get working were v3 (in v18.62 with the 17 patch).
Or is there something more to install and configure?

I don't run nfs4 on an OpenWrt device, but here's what's in my /etc/exports on my NAS:

/home   *(rw,sync,sec=krb5p,no_subtree_check)

I have kerberos authentication on all my devices.

The thing is that to really do a nfs4 export, you must do a rebind. So in fstab should appear:
The first mount of the disk f.ex: /dev/sda1 /mnt/backup ext4 defaults etc,etc
And then a rebind: /mnt/backup /export/backup none bind 0 0

But openwrt does not offer the option to do a bind mount (unless manually).
By now for three days I've tried with four different versions and one more almost bricked my device, bc there were half the repos active for the arch and even luci wasn't present.
So... this could be the panacea, but must be on some other devices.

not true... you may be looking at older info on the web. The nfs kernel server just lets you export any directory you want as nfs4.

You are right. I've just checked and it's true. It's the worst of internet that also wrong info is everywhere.

I've seen that I may have two problems there:

One being the firewall, that during my tests I left it as stock. I'm building a dump switch/ap with fs sharing capabilities, so that should be off, as dhcp and dnsmasq.
Also, it has something to do with Ipv6? I removed it altogether.

The other problem may be that I'm trying to access the device through the wan port. I re-installed 18.6.2 and patched nfs and still couldn't mount nfs shares remotely, when I did it in the past days.
It happens that yesterday I moved the device to the rack and connected it to the switch via wan. wan net is bridged so I thought that all would be ok. But no. Just directly connected my pc to the device and being able to mount the share.

So is there something wrong with bridging of nfs listening on a net vs interface? Is not possible to have the services of the device available to the rest of the lan on the main switch?

my net config:

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd51:156e:db2b::/48'

config interface 'lan'
        option type 'bridge'
        option _orig_ifname 'eth0.1 radio0.network1'
        option _orig_bridge 'true'
        option proto 'dhcp'
        option hostname 'buffalo'
        option ifname 'eth0 eth1'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'
        option enable_vlan4k '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '0 1 2 3 5'

Thanks for the help

I don't know much about your device but why is port 4 missing in your switch vlan config. Perhaps that's an issue?

I'm just starting to see that is something wrong there. I was trying to create two different vlans and faced the problem. I'm still trying to understand how interfaces are setup on this device. I'll open a new thread for it. But I may do a factory reset and start from scratch.