LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-18-2022, 02:08 PM   #1
GeordieJedi
LQ Newbie
 
Registered: Jan 2008
Posts: 23

Rep: Reputation: 0
Question 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
 
Old 10-18-2022, 03:23 PM   #2
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 4,725

Rep: Reputation: 2303Reputation: 2303Reputation: 2303Reputation: 2303Reputation: 2303Reputation: 2303Reputation: 2303Reputation: 2303Reputation: 2303Reputation: 2303Reputation: 2303
#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/
 
1 members found this post helpful.
Old 10-18-2022, 04:31 PM   #3
rclark
Member
 
Registered: Jul 2008
Location: Montana USA
Distribution: KUbuntu, Fedora (KDE), PI OS
Posts: 265

Rep: Reputation: 76
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.
 
Old 10-18-2022, 07:04 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 23,918

Rep: Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268
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

Last edited by michaelk; 10-18-2022 at 07:46 PM.
 
Old 10-23-2022, 09:36 AM   #5
GeordieJedi
LQ Newbie
 
Registered: Jan 2008
Posts: 23

Original Poster
Rep: Reputation: 0
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 
nouser,atime,auto,rw,dev,exec,suid 0 0
#
hoth:/volume1/photos /mnt/photo_share/photo nfs 
nouser,atime,auto,rw,dev,exec,suid 0 0
#
hoth:/volume1/music /mnt/music_share/music nfs 
nouser,atime,auto,rw,dev,exec,suid 0 0
These mount points now show up in the GUI (Dolphin) on KDE as networked dirs

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
Here are the results:
Code:
/volume1/music  corellia.home
/volume1/photos corellia.home
/volume1/videos corellia.home
This looks promising, hoever the .home at the end of the hostname of the PC (corellia)
looks a bit strange to my eyes.


09. (On the NAS) Here are the results of my exports list:

Code:
/volume1/videos 
corellia(rw,async,no_wdelay,crossmnt,no_root_squash,insecure_locks,sec=sys,
anonuid=1025,anongid=100)

/volume1/photos 
corellia(rw,async,no_wdelay,crossmnt,no_root_squash,insecure_locks,sec=sys,
anonuid=1025,anongid=100)

/volume1/music  
corellia(rw,async,no_wdelay,crossmnt,no_root_squash,insecure_locks,sec=sys,
anonuid=1025,anongid=100)

10. (On the client PC) I ran:
Code:
sudo mount -a
Output:
Code:
mount: 0: mount point does not exist.
mount: 0: mount point does not exist.
mount: 0: mount point does not exist.

Last edited by GeordieJedi; 10-23-2022 at 10:13 AM.
 
Old 10-23-2022, 10:51 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 23,918

Rep: Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268
What are the permissions for /mnt/photo_share/photo. I suspect they are owned by root.
 
Old 10-23-2022, 12:47 PM   #7
GeordieJedi
LQ Newbie
 
Registered: Jan 2008
Posts: 23

Original Poster
Rep: Reputation: 0
@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
drwxr-xr-x 3 [my username] [my username] 4096 Oct 23 12:22 photo_share
drwxr-xr-x 3  755 [my username] 4096 Oct 23 12:22 video_share

Last edited by GeordieJedi; 10-24-2022 at 07:09 AM.
 
Old 10-23-2022, 01:44 PM   #8
GeordieJedi
LQ Newbie
 
Registered: Jan 2008
Posts: 23

Original Poster
Rep: Reputation: 0
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]
root      6580  0.0  0.0      0     0 ?        S    13:52   0:00 [nfsd]
root      6581  0.0  0.0      0     0 ?        S    13:52   0:00 [nfsd]
root      6583  0.0  0.0      0     0 ?        S    13:52   0:00 [nfsd]
root      6585  0.0  0.0      0     0 ?        S    13:52   0:00 [nfsd]
root      6587  0.0  0.0      0     0 ?        S    13:52   0:00 [nfsd]
root      6589  0.0  0.0      0     0 ?        S    13:52   0:00 [nfsd]
root      6591  0.0  0.0      0     0 ?        S    13:52   0:00 [nfsd]
root      6595  0.0  0.0      0     0 ?        S    13:52   0:00 [nfsd]
root      6599  0.0  0.0      0     0 ?        S    13:52   0:00 [nfsd]
root      6601  0.0  0.0      0     0 ?        S    13:52   0:00 [nfsd]
root      6604  0.0  0.0      0     0 ?        S    13:52   0:00 [nfsd]
root      6605  0.0  0.0      0     0 ?        S    13:52   0:00 [nfsd]
root      6606  0.0  0.0      0     0 ?        S    13:52   0:00 [nfsd]
root      6607  0.0  0.0      0     0 ?        S    13:52   0:00 [nfsd]
root      6608  0.0  0.0      0     0 ?        S    13:52   0:00 [nfsd]
root      6609  0.0  0.0      0     0 ?        S    13:52   0:00 [nfsd]
root     20164  0.0  0.1   4756   952 pts/1    S+   18:40   0:00 grep nfsd
Would that mean the nfs deamon is running correctly on the NAS ?

Last edited by GeordieJedi; 10-23-2022 at 01:55 PM.
 
Old 10-23-2022, 01:58 PM   #9
GeordieJedi
LQ Newbie
 
Registered: Jan 2008
Posts: 23

Original Poster
Rep: Reputation: 0
14. (On the client PC) Running the following command:
Code:
mount | grep nfs
Result:
Code:
nfsd on /proc/fs/nfsd type nfsd (rw,relatime)
hoth:/volume1/music on /mnt/music_share/music type nfs (rw,relatime,vers=3,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=192.168.1.138,mountvers=3,mountport=892,mountproto=udp,local_lock=none,addr=192.168.1.138)

hoth:/volume1/photos on /mnt/photo_share/photo type nfs (rw,relatime,vers=3,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=192.168.1.138,mountvers=3,mountport=892,mountproto=udp,local_lock=none,addr=192.168.1.138)

hoth:/volume1/videos on /mnt/video_share/video type nfs (rw,relatime,vers=3,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=192.168.1.138,mountvers=3,mountport=892,mountproto=udp,local_lock=none,addr=192.168.1.138)
 
Old 10-30-2022, 10:00 AM   #10
GeordieJedi
LQ Newbie
 
Registered: Jan 2008
Posts: 23

Original Poster
Rep: Reputation: 0
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
 
Old 10-31-2022, 03:05 PM   #11
GeordieJedi
LQ Newbie
 
Registered: Jan 2008
Posts: 23

Original Poster
Rep: Reputation: 0
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 !
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mounting NFS from Windows NAS (NFS server for unix) got hidden folders collectordk AIX 2 05-28-2020 12:49 PM
reliable centos nas server with raid or nas boxes which is better ? Gil@LQ Linux - Server 9 09-10-2015 06:13 AM
Help figuring out: NAS, FreeNas, Linux "NAS", or Linux server JohnLocke Linux - General 24 04-18-2015 11:16 AM
automatically backup folder on Free NAS computer to another Free NAS computer tom treadway Linux - Newbie 1 01-26-2011 08:28 PM
Buffalo NAS - how do we get files on NAS syncing with Windows Sync? bykerbob Linux - Newbie 0 10-21-2008 09:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration