Setting up NAS with NFS
Hi there guys.
I was hoping that you could help me with a project please. Background / History: I have a Synology DS413J NAS device. It was working well for many years, however a while ago It had a hard drive failure (was in SHR / RAID-5) so I managed to retrieve my data. I have very recently decided to set this up again from scratch and bought some new HDD's (again x3, 4TB drives in SHR / RAID-5) I am trying to set up the mount points, but I'm struggling. Steps already taken: 1. Set up a static ip (via DHCP reservation) address for my NAS 2. Set up a static ip (via DHCP reservation) address for my client PC 3. (On the NAS) Added both the NAS and the client PC to the hosts file Added both the NAS and the client PC to the hosts.allowed file 4. (On the client PC) Added both the NAS and the client PC to the hosts file Added both the NAS and the client PC to the hosts.allowed file 5. (On the NAS) Added both the NAS and the client PC to the exports file 6. (On the client PC) Added both the NAS and the client PC to the exports file Questions: 1. How do I create a mount point (on the client PC) to allow it to see / access the NAS box ? 2. Whic dir, do I create the mount point in ? - mnt media var 3. What other steps do I need to do, in order to get this to work ? TIA for any help or advice Useful details: NAS: Synology DS413J NAS OS: DSM 6.2.4-25556 PC details: OS: Ubuntu 20.04 LTS OS type: 64-bit DE: KDE 5.18.8 Kernel: 5.14.0-1051-oem CPU: 4x Intel Core-2 Q8200 (@2.33 Ghz) GFX: Intel HD RAM: 8GB |
#1 you really should have examined the man pages and documentation on NFS and /etc/exports before starting. You have gone as far to making your PC an NFS server as the NAS box!
#2 take a look at https://www.thegeekdiary.com/underst...-exports-file/ and pay attention to what goes on the server and what happens on the client. Other good resources will be your distribution wiki or documentation pages and sites like https://web.mit.edu/rhel-doc/5/RHEL-...g-exports.html and https://www.golinuxcloud.com/nfs-exp...ions-examples/ |
As above, the export file is on the server only. The client just needs the client software of NFS installed to be able to mount a folder that was defined in the export file on the NAS server. Simple. Only big gotcha is user permissions to information on the server.
|
Why are you not using the DSM control panel to setup NFS and NFS shares on the NAS?
https://kb.synology.com/en-us/DSM/he..._nfs?version=7 You can mount the share almost anywhere just a matter of preference, I would use /mnt. How the client is configured sort of depends on if you are using version 3 or 4. There are lots of guides on the internet. All you need on the client for software is the nfs-common package. On my Synology NAS everything is a sub-directory of the /volume1 directory. sudo mount -t nfs NAS:/volume1/share_name /mnt/where_ever |
Thanks for the responses so far guys.
@michaelk I have used Synology's DSM (ver 6.2.4-25556) to set up the NFS shared dirs on the NAS (I beleive that I'm using NFS (ver 3) as I specifically did not use the check box for NSF Ver 4/4.1 (as I'm led to beleive that it allows more granualar access and permissions, at the price of further complexity). I'm just looking to get this NAS up and running on my internal network for now I don't have a burning desire to access my media via the internet ATM 07. I have added mount points for the NAS in my fstab file on my client PC (corellia) (see below): fstab (on client PC) Code:
hoth:/volume1/videos /mnt/video_share/video nfs When clicking on them, I receive the following error message: Code:
"Could not enter folder /mnt/photo_share/photo." So this now appears to be a permissions problem (from the NAS) 08. Interestingly I tried an experiment - (On the client PC) I su'd to a root shell, then cd'd into the dir (on the NAS) and I was able to access the NAS and its dirs via the shell prompt 8.1. (On the NAS - via DSM / in the NAS GUI) I created a test dir (called test_01) in volume1/videos/ 8.2. (On the client PC) I then re-ran the ls command, and the test dir appeard 09. (On the client PC) I have then run the following command: Code:
showmount -e hoth Code:
/volume1/music corellia.home looks a bit strange to my eyes. 09. (On the NAS) Here are the results of my exports list: Code:
/volume1/videos 10. (On the client PC) I ran: Code:
sudo mount -a Code:
mount: 0: mount point does not exist. |
What are the permissions for /mnt/photo_share/photo. I suspect they are owned by root.
|
@michaelk
11. The permissions for the dirs are as follows: 11.1. /mnt/photo_share/photo = root 11.2. /mnt/music_share/music = [my username] 11.3. /mnt/video_share/video = root 11.4. Interestingly, for both root and [my username] when I look at the access permissions I see the following user: no access group: no access others: no access However, when I created the mount points for these dirs I did perform a sudo chown -R [my username] : [my username] on each of the 3 dirs. However I'm going to try and do this again, to see if makes any improvement 12. (On the client) I ran the following command: Code:
ls -l /mnt Result was: Code:
drwxr-xr-x 3 755 [my username] 4096 Oct 23 12:22 music_share |
13. (On the NAS) Running the following command:
Code:
ps aux | grep nfsd Gived me this result: Code:
root 6578 0.0 0.0 0 0 ? S 13:52 0:00 [nfsd4] |
14. (On the client PC) Running the following command:
Code:
mount | grep nfs Code:
nfsd on /proc/fs/nfsd type nfsd (rw,relatime) |
Does anyone have any further thoughts on this, and how to get the shared dirs
from the NAS, to be accessible from my client PC ? TIA |
I've managed to resolve this.
It was a permissions problem (on the NAS) I had to change the "Squash" settings to: "Map all users to Admin" This is what allowed my to access the NAS shared folders on the client. 15. Here are the setps I took to fix it: (On the NAS) Log into the web interface > Control panel > Shared folder > (Chose the folder you want to allow access to from a client). Edit > NFS permissions > Chose host > Edit > Select the option called "Squash" > Chose - Map all users to Admin > OK > (Wait for this to be saved) Thank you to all who shared their time and knowleged with me to get this sorted It's much appreciated ! |
All times are GMT -5. The time now is 02:11 AM. |