NFS does not work at all

Why does accessing a NAS have to be so difficult? I just want NFS access to my NAS. I have been trying to make this work off and on for multiple years. I am ready to quit linux altogether. Aaauuuggh!

Hello and welcome to the openSUSE forums.

First, be please aware that nobody here is clairvoyant. Thus, you explaing nothing about that NAS server, we have no idea if it even supports NFS, and when yes how (e.g. which version(s)).

Also you do not provide any information on what you do “trying to make this work off and on for multiple years”. E.g. show the NFS entries you use in /etc/fstab . How do you think we can provide any comments or point to mistakes on what you did when we see nothing?

Oh and as we can not know if you have any experience with the forums software here, this is important for posting here:
Please, to make the pieces of computer code in your posts better consumable by technical oriented people:

And post as complete as possible. That is starting with the line with the prompt and the command, then all output, and ending with the new prompt line.
When you really feel you need to change anything in such a copy, then add that in a comment, else we take all characters literally.

When the text is very long, then you can upload to https://paste.opensuse.org/ .
Or you can use the tool susepaste by piping the output to it ind posting the URL you get.

1 Like

@rob1249:

First, welcome to the openSUSE Forums!! :smiley:


NFS – is actually quite easy –

  1. First reference – <Configuring clients>
    Must admit that, using YaST as an initial means for configuring an openSUSE desktop system to access something like a NAS is the “official” 1st time method, I prefer something else …

  2. Second reference – <Using the automount service>
    My preferred method.

Please be aware that, from the ‘/etc/auto.master’ configuration file, I call a file with the settings for mounting the NAS –

/mnt/NAS-001 file:/etc/auto.NAS-001 --timeout=120

And the file ‘/etc/auto.NAS-001’ contains this –

NFS -rw,hard NAS-001.local-private.domain:/NFS

The directory below ‘/mnt/’ looks like this –

 > ls -ld /mnt/NAS-001
drwxr-xr-x 2 root root 0 14. Jan 10:38 /mnt/NAS-001
 >

And now, to the NAS – in my case a QNAP box – the OS is a Linux with, a Linux filesystem …

> ssh -l ??? nas-001.fritz.box.local-private.domain
???@nas-001.local-private.domain's password: 
[???@NAS-001 ~]$ 
[???@NAS-001 ~]$ pwd
/share/homes/???
[???@NAS-001 ~]$ cat /etc/exports
"/share/CACHEDEV1_DATA/NFS" *.local-private.domain(sec=sys,rw,async,wdelay,insecure,no_subtree_check,root_squash,anonuid=65534,anongid=65534,fsid=????) 
"/share/NFSv=4" *(no_subtree_check,no_root_squash,insecure,fsid=0)
"/share/NFSv=4/NFS" *.local-private.domain(sec=sys,rw,async,wdelay,insecure,nohide,no_subtree_check,root_squash,anonuid=65534,anongid=65534,fsid=????) 
[???@NAS-001 ~]$
[???@NAS-001 ~]$ mount
 . 
 . 
 . 
/share/CACHEDEV1_DATA/NFS on /share/NFSv=4/NFS type none (rw,bind)
[???@NAS-001 ~]$ 
???@NAS-001 ~]$ ls -ld /share/NFS
lrwxrwxrwx    1 admin    administ        18 Jan 14 07:46 /share/NFS -> CACHEDEV1_DATA/NFS/
[???@NAS-001 ~]$ 
[???@NAS-001 ~]$ ls -ld /share/CACHEDEV1_DATA/NFS 
drwxrwxrwx    5 admin    administ      4096 May 12  2023 /share/CACHEDEV1_DATA/NFS/
[???@NAS-001 ~]$ 

And, from this Leap 15.6 system – the QNAP NAS doesn’t have a “showmount” command –

 # showmount --exports nas-001.private-local.domain
Export list for nas-001.private-local.domain:
/NFS *.fritz.box
 #

The “NFS” directory on the NAS was created with the NAS Web GUI administration interface.

But, the directories below that exported directory were created via the SSH CLI and, the ownership ( User ID (UID) and Group ID (GID) ) were set to the same values as those here on the Leap system by means of a CLI command – “chown” …

  • N.B.: With this method, the SMB access to the NAS cannot access the user directories in the “NFS” directory tree …
1 Like

The OP never hinted that the NAS is an openSUSE based system. (Thus I asked for more information about it).

I also orefer automount, but then the newer, even easier to configure systemd.automount way.

There is no talking of SMB in the original post. Nor of anything Windows. Why making it more complicated?

1 Like

With this method there are 2 distinct data areas on the NAS –

  1. The “normal” area where user administration on the NAS is done via the (QNAP) GUI on the NAS and, is primarily for the SMB access plus, the (deprecated) AFP access.
  2. An “NFS-only” area which the Microsoft and Apple clients cannot access.

The “NFS-only” area is used primarily for backups of non-critical Linux user-data via NFS –

  • Like it or not, using a NAS as a primary backup device does have a few issues – because a NAS is a (commercial) network device …
    Despite the fact that, many commercial NAS boxes are using a Linux as the OS …

And, I didn’t assume that, the NAS box was using openSUSE as it’s OS –

  • YaST can be used to configure an openSUSE system as a NFS Client …
    Not only as an NFS Server …

Provided that, the system shutdown Use Case is properly configured –

Another interesting point is here – <Use of the x-systemd.automount mount option in /etc/fstab>

A notable difference between the default behaviors of x-systemd.automount and the autofs package is: The autofs package defaults to timing out (umounting) an automount after approximately 10 minutes of idleness. However, x-systemd.automount defaults to never timing out, which is preferred by many administrators. Repeatedly umounting and remounting based on idle periods can introduce potential points of failure.

There’s also this comment –

For someone not familiar with either method, the systemd method is typically more quickly grasped and implemented.

Well, it is all talking i the dark. I asked the OP if he can give more information about the NAS and if it supports NFS. He never answered, thus IMO every answer is just …

Sorry, I can’t login for some reason. I keep getting errors when I try

Helllo again.
Some info, six years ago I bought a Synology DS218. It does support NFS (allegedly).
Enabled NFS and setup a shared folder with read/write permissions. I then fumbled around trying to get NFS to work. Failed. Read several web posts on how easy it is to set up NFS. Failed.
dcurtisfra kindly posted one of the last references (number 1) that I tried. I got all the way to editing /etc/sysconfig/nfs to set static ports and was never able to save the edited file. I don’t know why. SuperUser or not, it wouldn’t let me.
I gave up and used the web interface to copy media files to the nas and relegated it to a media server.
Now I have returned to the exact same place, and still can’t get past it.

Which NFS version does the NAS use. It is important to know so you can set the client to the same version.

Your further explanation of what you did to get the client side working lacks all detail.

Did you try YaST > Network Servics > NFS Client.
And when yes, please post the entry it generated in /etc/fstab.
And when it does not mount at boot, the mount it (as root of course) from the CLI s you can see messages (and then post that here of course.

@rob1249:

Please be aware that, as far as any UNIX® / Linux / macOS / Android system is concerned, the files available below a NFS mount point, are simply part of the system’s directory tree – which begins at ‘/’.

And, you have to be aware of the “user identifier” (UID) and “group identifier” (GID).
Detailed explanations are here – <User identifier> <Group identifier>

Unfortunately, the administration interface (GUI – Web Browser) of most commercial NAS boxes isn’t oriented to the needs of the UNIX® world and, the need for UID and GID administration – despite the fact that, the commercial NAS boxes almost universally are using a Linux as their base OS.

You have to either force the directories immediately below the NFS directory exported by the NAS device to have UID and GID values which match to the user’s UID and GID on the Linux NFS Client system or,

  • on the NAS device, set the exported NFS directory to be world/other writeable.

You could also consider removing the “root squash” flag on the NFS export at the NAS device, at least until you’ve go the NFS export setup and running as it should do.

AFAIK, for most commercial NAS devices, the only way to setup the directories being exported via NFS is to login to the NAS as the administration user via SSH – you may also have to set a flag to allow the login via SSH in the setup of the NAS …

Hi. Fell off the earth for a bit.

I tried to connect the Synology NAS using the ‘mount’ command and received message that the server denied access. This started my journey into Synology’s help files.

If you are searching for help and you are using a Synology NAS with DSM 7.0 or greater, you need to…

go to ‘Control Panel’ and select ‘Security’ from the left side menu. Select ‘Firewall’ tab. Near the bottom, under ‘Firewall Profile’, on the right side, click the ‘Edit Rules’ button. Click the ‘Create’ button in hte new window. In the next window, under ‘Ports’ select ‘Select from a list of built-in applications’ radio button. Click ‘Select’ button to the right. Scroll down to the ‘Mac/Linux File server’ checkbox and check it. OK’s and Apply your way back out.

Next, ‘FIle Services’ on the left then ‘NFS’ tab and ‘Advanced Settings’ button. Tick the ‘Customized Ports’ checkbox and enter the static port numbers you chose to get thru Firewalld. Save and Apply.

‘Shared Folders’ on hte left. Select the folder you wish to share and click the ‘Edit’ button. In the new window, go to the ‘NFS Permissions’ tab, click ‘Edit’ button. In the new window there is a place to enter your hostname or IP, set privileges, Squash (I set this to ‘Map all users to Admin’. I don’t know if I needed to.) and select security. There are three checkboxes, Enable asynchronous, Allow connections from non-privileged ports (ports higher than 1024), and Allow user to access mounted subfolders. I selected all of them. Also, if you would like to chase this down yourself, Synology has a link in this window to their help files. Save.

I don’t know if all this is the correct way of doing this but it worked for me.

Cautious people such as myself, never ever give “Admin” privileges to all users –

  • System Administration is handled by the System Administrators only and, no-one else …

But, having said that, I must admit the handling networked devices without a centralised user database such as OpenLDAP (makes life with NFS much easier) or Windows AD (Active Directory) [make life with Windows Clients much easier] is more than a little bit of pain …