What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

NFS mounting issues

pedeb04

Occasional Visitor
When I try to configure backupmon to backup to a Network-NFS I get an error.
My test confige is:
(1) : Test Target Media Type : Network-NFS

(2) : Test Target Username : admin

(3) : Test Target Password : admin

(4) : Test Target NFS Path : 192.168.50.46:/srv/nfsshared

|--- Test NFS Mount Options : nfsvers=3,nolock,_netdev,rsize=8192,wsize=8192

(5) : Test Target Backup Mount Point : /tmp/mnt/testbackups

(6) : Test Target Dir Path : /router/test-backup

(7) : Test CIFS/SMB Version : N/A

My message is bad file descriptor.
I also tried without the NFS Mount options, bad file descriptor
I can mount from the server nfs share from my linux desktop ok.
my server /etc/exports
/srv/nfsshared 192.168.50.0/24(rw,root_squash)

INFO: Backup Target (192.168.50.46) reachable via PING.

INFO: External test drive mount point exists. Found under: /tmp/mnt/testbackups

mount: RPC: Remote system error - Connection timed out

mount: mounting 192.168.50.46:/srv/nfsshared on /tmp/mnt/testbackups failed: Bad file descriptor

WARNING: Unable to mount to external NFS network drive. Retrying...

mount: RPC: Remote system error - Connection timed out

mount: mounting 192.168.50.46:/srv/nfsshared on /tmp/mnt/testbackups failed: Bad file descriptor

WARNING: Unable to mount to external NFS network drive. Retrying...

mount: RPC: Remote system error - Connection timed out

mount: mounting 192.168.50.46:/srv/nfsshared on /tmp/mnt/testbackups failed: Bad file descriptor

WARNING: Unable to mount to external NFS network drive. Retrying...

ERROR: Unable to mount to external NFS network drive [/tmp/mnt/testbackups]. Please check your configuration. Exiting.

Press any key to acknowledge...
 
I am thinking that the root_squash directive on your server might be an issue. The router is trying to connect as user root which your server will change to an anonymous user. If your permissions on the server do not allow for an anonymous user it may be the reason it's failing.

It's just a thought as I'm no expert with NFS.
 
Last edited:
Following up on this while doing some googling, you could try modifying your exports file on your server;

Code:
/srv/nfsshared 192.168.50.0/24(rw,root_squash,anonuid=xxxx,anongid=xxxx)

Where xxxx is the actual uid and gid you want mapped when a root user mounts the share.

The anonuid and anongid directives work alongside the root_squash directive by changing the uid and gid of the anonymous user from the system default uid/gid to the specified uid/gid.
 
I tried changing the exports file on the server to
Code:
/srv/nfsshared 192.168.50.0/24(rw,no_root_squash)
Still error bad file descriptor
Then because I am the owner of /svr/nfsshared ie uid=1000 and gid=1000
I tried the following
Code:
/srv/nfsshared 192.168.50.0/24(rw,root_squash,anonuid=1000,anongid=1000)
Still error bad file descriptor
 
OK, so I played around a bit this morning with this. I had to stop as my daughter is home this week and she remote works, so she needs the internet.

So, first, you have not listed the router or firmware version you are using, can you please add this information to your signature. It does help.

Can you mount the NFS share manually?

Code:
mount -t nfs 192.168.50.46:/srv/nfsshared /tmp/mnt/testbackups -o nfsvers=3,nolock,_netdev,rsize=8192,wsize=8192

On my RTAX86U-Pro, the manual means of setting up an NFS share has changed from my previous RTAX88U. You need create a directory and also start the portmap process.

In the meantime, if you have not done so, from the GUI, go to USB Applications -> NFS Exports, and turn on NFS. That should load the required kernel modules and the mountd daemon, if not already done so.

Also, in your mount statement, you may need to add the option nfsvers=3 as the router does not support NFSv4.

EDITED - I done some more testing, unless you start NFS via the GUI, these are the CLI commands I had to use to mount an NFS drive

@Viktor Jaep - On my RT-AX86U-Pro, it seems that for NFS to work, without turning on NFS in the GUI, you now need to;

1. Create directory /var/lib/nfs -> This is new
2. Load the nfs kernel module as usual (modprobe nfs)
3. Start portmap as user nobody (portmap) -> This is new
3. Then you can start the NFS daemon -> /usr/sbin/mountd -N 2.

Now you should be able to use the NFS share. You should use the nfsvers=3 option as the router does not support NFSv4.
 
Last edited:
I updated my post above (#5)
 
@Viktor Jaep - On my RT-AX86U-Pro, it seems that for NFS to work, without turning on NFS in the GUI, you now need to;

1. Create directory /var/lib/nfs -> This is new
2. Load the nfs kernel module as usual (modprobe nfs)
3. Start portmap as user nobody (portmap) -> This is new
3. Then you can start the NFS daemon -> /usr/sbin/mountd -N 2.

Now you should be able to use the NFS share. You should use the nfsvers=3 option as the router does not support NFSv4.
WAIT WHAT! When did they decide to make this undocumented change!! :P

Thank you for letting me know... I'll get this implemented in BACKUPMON.
 
WAIT WHAT! When did they decide to make this undocumented change!! :P

Thank you for letting me know... I'll get this implemented in BACKUPMON.
The big question is what models are affected. I don't have my AX88U to test anymore.
 
The big question is what models are affected. I don't have my AX88U to test anymore.
I have an AX88U... but I don't have an NFS share to test with. You would have thought that others using NFS would have at least said something... but then again, maybe there aren't many that do.
 
@pedeb04 @Jeffrey Young ... please give this version a shot. Included the recommended steps that Jeffrey spelled out above:

Code:
curl --retry 3 "https://raw.githubusercontent.com/ViktorJp/BACKUPMON/develop/backupmon.sh" -o "/jffs/scripts/backupmon.sh" && chmod 755 "/jffs/scripts/backupmon.sh"

(please ignore the version upgrade notice)
 
I have an AX88U... but I don't have an NFS share to test with. You would have thought that others using NFS would have at least said something... but then again, maybe there aren't many that do.
You can always spin up a Linux VM. Only takes a few seconds to set up an NFS export.
 
@pedeb04 @Jeffrey Young ... please give this version a shot. Included the recommended steps that Jeffrey spelled out above:

Code:
curl --retry 3 "https://raw.githubusercontent.com/ViktorJp/BACKUPMON/develop/backupmon.sh" -o "/jffs/scripts/backupmon.sh" && chmod 755 "/jffs/scripts/backupmon.sh"

(please ignore the version upgrade notice)
We might be getting ahead of our selves. Perhaps @pedeb04 should manually try setting up the share.
 
You can always spin up a Linux VM. Only takes a few seconds to set up an NFS export.
I've got one... I tried in the past, but don't think I had much success.
 
I'll PM you tomorrow with some quick instructions. What flavour of Linux? Please say Debian or Ubuntu
 
OK, so I played around a bit this morning with this. I had to stop as my daughter is home this week and she remote works, so she needs the internet.

So, first, you have not listed the router or firmware version you are using, can you please add this information to your signature. It does help.

Can you mount the NFS share manually?

Code:
mount -t nfs 192.168.50.46:/srv/nfsshared /tmp/mnt/testbackups -o nfsvers=3,nolock,_netdev,rsize=8192,wsize=8192

On my RTAX86U-Pro, the manual means of setting up an NFS share has changed from my previous RTAX88U. You need create a directory and also start the portmap process.

In the meantime, if you have not done so, from the GUI, go to USB Applications -> NFS Exports, and turn on NFS. That should load the required kernel modules and the mountd daemon, if not already done so.

Also, in your mount statement, you may need to add the option nfsvers=3 as the router does not support NFSv4.

EDITED - I done some more testing, unless you start NFS via the GUI, these are the CLI commands I had to use to mount an NFS drive

@Viktor Jaep - On my RT-AX86U-Pro, it seems that for NFS to work, without turning on NFS in the GUI, you now need to;

1. Create directory /var/lib/nfs -> This is new
2. Load the nfs kernel module as usual (modprobe nfs)
3. Start portmap as user nobody (portmap) -> This is new
3. Then you can start the NFS daemon -> /usr/sbin/mountd -N 2.

Now you should be able to use the NFS share. You should use the nfsvers=3 option as the router does not support NFSv4.
No could not mount the NFS share manually.
1. Created directory /var/lib/nfs
2. modprobe nfs
Then ran # lsmod | grep nfs
nfs 155648 0
lockd 81920 1 nfs
sunrpc 233472 2 nfs,lockd
3. Don't know how to start portmap, or how to change to user nobody.
 
PS I am using a Ubuntu Server and Desktop.
I am not familiar with linux OS Asus uses.
In Ubuntu to start a service or daemon with systemctl start sevice/daemon
I tried it with portmap on the router, but bad command.
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top