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.
First, welcome to the openSUSE Forums!!
NFS â is actually quite easy â
-
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 ⌠-
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 âŚ
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?
With this method there are 2 distinct data areas on the NAS â
- 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.
- 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.
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 âŚ