Cannot mount QNAP NAS folder

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
snowcrash101
Level 3
Level 3
Posts: 100
Joined: Sat Feb 04, 2017 7:16 am
Location: UK

Cannot mount QNAP NAS folder

Post by snowcrash101 »

Hello

I have a NAS (QNAP TS-251+), and have been trying to mount a shared folder (/share/movies). I've made it accessible from the NAS, and I for testing, I can copy to the folder via a rysnc command. But can't mount via NFS. I followed these instructions: https://wiki.qnap.com/wiki/Mounting_an_ ... _on_Ubuntu using the command:

Code: Select all

mount -t nfs -o username=foo,password=bar ipaddresofNAS:HR /mnt/qnap/
Though I'm not quite sure with the :HR part is. Anyhow, in my case I tried:

Code: Select all

sudo mount -w -v -t nfs -o username=admin,password=xxx 192.168.0.15:/share/movies /mnt/qnap/
But that doesn't work.
Then I tried:

Code: Select all

sudo mount -w -v -t nfs -o user=admin 192.168.0.15:/share/movies /mnt/qnap/
But that just generates:

Code: Select all

mount.nfs: timeout set for Thu Dec 21 10:59:23 2017
mount.nfs: trying text-based options 'vers=4,addr=192.168.0.15,clientaddr=192.168.0.14'
mount.nfs: mount(2): Connection refused
mount.nfs: trying text-based options 'vers=4,addr=192.168.0.15,clientaddr=192.168.0.14'
mount.nfs: mount(2): Connection refused
mount.nfs: trying text-based options 'vers=4,addr=192.168.0.15,clientaddr=192.168.0.14'
mount.nfs: mount(2): Connection refused
mount.nfs: trying text-based options 'vers=4,addr=192.168.0.15,clientaddr=192.168.0.14'
mount.nfs: mount(2): Connection refused
Then after reading that nfs command doesn't need user or pwd, I tried:

Code: Select all

sudo mount -w -v -t nfs -o 192.168.0.15:/share/movies /mnt/qnap/ 
And see the error: :

Code: Select all

mount: can't find /mnt/qnap/ in /etc/fstab
This is one of those problems that drives a newbie LM user nuts. (My windoze friend is laughing at me, as it's so easy in that OS :evil: )

Any help appreciated - thanks.
Learning linux & dumping spyware Windows
Intel Core i5-7500 (Kaby Lake) | Asus H270-Plus | 16gb DDR4 HyperX Fury
Samsung 960 EVO 500GB NVME SSD | 2TB HDD
User avatar
coffee412
Level 6
Level 6
Posts: 1077
Joined: Mon Nov 12, 2012 7:38 pm
Location: Indiana, USA
Contact:

Re: Cannot mount QNAP NAS folder

Post by coffee412 »

Before we get your share mounted, We should make sure of some things to make life a lot easier.

1. The address for your nas is that a static ip? that is an ip that does not change. The other type of ip address is called a dynamic ip address. The dynamic address can change when the network card gets reset - like when you reboot the nas. We do want it to be a static ip address if its going to be file server. I will assume it is for this problem.

2. We want to reference the nas by a host name to make things easier. We do this by editing the /etc/hosts file and adding the ip address and name to the file.

Code: Select all

sudo nano /etc/hosts
Add this line to the bottom of the file:

Code: Select all

192.168.0.15    qnap
Save the file by hitting control-x and choosing Yes to save it.

Now, You can check to make sure it works by pinging the nas

Code: Select all

ping qnap
Now we can manually mount the nas with the following command:

Code: Select all

sudo mount -t nfs qnap:/share/movies    /mnt/qnap
This should mount the nas and you can check it by typing in the following:

Code: Select all

ls /mnt/qnap
If you get a permission denied then (for the sake of making it easy) just change the permissions on the /mnt/qnap folder so all can read/write to it.

Code: Select all

sudo chmod 777 /mnt/qnap
Then try it as a normal user.

Lets see if you get any errors. Post them here when you reply. After that we can move on to restricting access to only certain users if you want.
Ryzen x1800 Asus Prime x370-Pro 32 gigs Ram RX480 graphics
IceWarp 12.0.3 * Mint 18.3 * RAID 1/5 * OpenVPN * Linux since kernel 2.0.36
************* Get Your Linux on! ***************
snowcrash101
Level 3
Level 3
Posts: 100
Joined: Sat Feb 04, 2017 7:16 am
Location: UK

Re: Cannot mount QNAP NAS folder

Post by snowcrash101 »

Thanks for the advice. It's a static ip for the NAS.
When I ping the NAS I see a listing:

Code: Select all

PING qnap (192.168.0.15) 56(84) bytes of data.
64 bytes from qnap (192.168.0.15): icmp_seq=1 ttl=64 time=0.372 ms
64 bytes from qnap (192.168.0.15): icmp_seq=2 ttl=64 time=0.395 ms
64 bytes from qnap (192.168.0.15): icmp_seq=3 ttl=64 time=0.399 ms
64 bytes from qnap (192.168.0.15): icmp_seq=4 ttl=64 time=0.393 ms
64 bytes from qnap (192.168.0.15): icmp_seq=5 ttl=64 time=0.399 ms
64 bytes from qnap (192.168.0.15): icmp_seq=6 ttl=64 time=0.389 ms
64 bytes from qnap (192.168.0.15): icmp_seq=7 ttl=64 time=0.386 ms
And if I try to mount with

Code: Select all

sudo mount -t nfs qnap:/share/movies    /mnt/qnap
It time-outs

Code: Select all

mount.nfs: Connection timed out
Learning linux & dumping spyware Windows
Intel Core i5-7500 (Kaby Lake) | Asus H270-Plus | 16gb DDR4 HyperX Fury
Samsung 960 EVO 500GB NVME SSD | 2TB HDD
User avatar
AndyMH
Level 13
Level 13
Posts: 4578
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Cannot mount QNAP NAS folder

Post by AndyMH »

I've got a synology NAS (diskstation) and added an entry in the fstab file (it's sat in /etc) so that it mounts automatically, additional lines in fstab as follows:

Code: Select all

# mount point for synology NAS used in rsync backups
192.168.0.5:/volume1/homes/andy/backups /media/andy/diskstation nfs rw,noauto,user,nofail 0 0
Works without problems (across mint 17.3 and 18.x), if I fire up 'Computer' I see the screenshot below. It does ask for my password to access.
Attachments
Screenshot from 2017-12-21 12-22-19.png
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate
snowcrash101
Level 3
Level 3
Posts: 100
Joined: Sat Feb 04, 2017 7:16 am
Location: UK

Re: Cannot mount QNAP NAS folder

Post by snowcrash101 »

AndyMH wrote:I've got a synology NAS (diskstation) and added an entry in the fstab file (it's sat in /etc) so that it mounts automatically, additional lines in fstab as follows:

Code: Select all

# mount point for synology NAS used in rsync backups
192.168.0.5:/volume1/homes/andy/backups /media/andy/diskstation nfs rw,noauto,user,nofail 0 0
Works without problems (across mint 17.3 and 18.x), if I fire up 'Computer' I see the screenshot below. It does ask for my password to access.
Thks. Though I'd rather make sure I can connect to NAS, before setting up fstab.
Learning linux & dumping spyware Windows
Intel Core i5-7500 (Kaby Lake) | Asus H270-Plus | 16gb DDR4 HyperX Fury
Samsung 960 EVO 500GB NVME SSD | 2TB HDD
altair4
Level 20
Level 20
Posts: 10189
Joined: Tue Feb 03, 2009 10:27 am

Re: Cannot mount QNAP NAS folder

Post by altair4 »

I'm a samba guy not an NFS guy but something similar happens with certain NAS devices and a CIFS mount.
mount.nfs: trying text-based options 'vers=4,addr=192.168.0.15,clientaddr=192.168.0.14'
mount.nfs: mount(2): Connection refused
It looks like the Linux client is attempting to access the server with NFSv4. Is it at all possible that your NAS is running NFSv3?

From the user manual for this device it sounds like something you configure:
NFS Service
To connect to the NAS from Linux, enable the NFS service under NFS. Select “Enable NFS v2/v3 Service” for NFS version 2 or 3. Select “Enable NFS v4 Service” for NFS version 4.
Or add another option to your mount command specifying version 3: I'm guessing it's vers=3
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
User avatar
coffee412
Level 6
Level 6
Posts: 1077
Joined: Mon Nov 12, 2012 7:38 pm
Location: Indiana, USA
Contact:

Re: Cannot mount QNAP NAS folder

Post by coffee412 »

snowcrash101 wrote:Thanks for the advice. It's a static ip for the NAS.
When I ping the NAS I see a listing:

Code: Select all

PING qnap (192.168.0.15) 56(84) bytes of data.
64 bytes from qnap (192.168.0.15): icmp_seq=1 ttl=64 time=0.372 ms
64 bytes from qnap (192.168.0.15): icmp_seq=2 ttl=64 time=0.395 ms
64 bytes from qnap (192.168.0.15): icmp_seq=3 ttl=64 time=0.399 ms
64 bytes from qnap (192.168.0.15): icmp_seq=4 ttl=64 time=0.393 ms
64 bytes from qnap (192.168.0.15): icmp_seq=5 ttl=64 time=0.399 ms
64 bytes from qnap (192.168.0.15): icmp_seq=6 ttl=64 time=0.389 ms
64 bytes from qnap (192.168.0.15): icmp_seq=7 ttl=64 time=0.386 ms
And if I try to mount with

Code: Select all

sudo mount -t nfs qnap:/share/movies    /mnt/qnap
It time-outs

Code: Select all

mount.nfs: Connection timed out
Ok, So it appears that there might not be much communication on the nfs ports. Perhaps they are being blocked?

Install nmap :

Code: Select all

sudo apt install nmap
run nmap from your workstation :

Code: Select all

nmap qnap
Post the output - lets make sure the ports are available :)
Ryzen x1800 Asus Prime x370-Pro 32 gigs Ram RX480 graphics
IceWarp 12.0.3 * Mint 18.3 * RAID 1/5 * OpenVPN * Linux since kernel 2.0.36
************* Get Your Linux on! ***************
snowcrash101
Level 3
Level 3
Posts: 100
Joined: Sat Feb 04, 2017 7:16 am
Location: UK

Re: Cannot mount QNAP NAS folder

Post by snowcrash101 »

coffee412 wrote: [...]
Ok, So it appears that there might not be much communication on the nfs ports. Perhaps they are being blocked?

Install nmap :

Code: Select all

sudo apt install nmap
run nmap from your workstation :

Code: Select all

nmap qnap
Post the output - lets make sure the ports are available :)
This is the output:

Code: Select all

Starting Nmap 7.01 ( https://nmap.org ) at 2017-12-21 13:40 GMT
Nmap scan report for qnap (192.168.0.15)
Host is up (0.0020s latency).
Not shown: 990 closed ports
PORT      STATE SERVICE
22/tcp    open  ssh
80/tcp    open  http
139/tcp   open  netbios-ssn
443/tcp   open  https
445/tcp   open  microsoft-ds
631/tcp   open  ipp
8080/tcp  open  http-proxy
8081/tcp  open  blackice-icecap
8090/tcp  open  unknown
49152/tcp open  unknown

Nmap done: 1 IP address (1 host up) scanned in 0.06 seconds
Learning linux & dumping spyware Windows
Intel Core i5-7500 (Kaby Lake) | Asus H270-Plus | 16gb DDR4 HyperX Fury
Samsung 960 EVO 500GB NVME SSD | 2TB HDD
snowcrash101
Level 3
Level 3
Posts: 100
Joined: Sat Feb 04, 2017 7:16 am
Location: UK

Re: Cannot mount QNAP NAS folder

Post by snowcrash101 »

altair4 wrote:I'm a samba guy not an NFS guy but something similar happens with certain NAS devices and a CIFS mount.
mount.nfs: trying text-based options 'vers=4,addr=192.168.0.15,clientaddr=192.168.0.14'
mount.nfs: mount(2): Connection refused
It looks like the Linux client is attempting to access the server with NFSv4. Is it at all possible that your NAS is running NFSv3?

From the user manual for this device it sounds like something you configure:
NFS Service
To connect to the NAS from Linux, enable the NFS service under NFS. Select “Enable NFS v2/v3 Service” for NFS version 2 or 3. Select “Enable NFS v4 Service” for NFS version 4.
Or add another option to your mount command specifying version 3: I'm guessing it's vers=3
Oh, why didn't I check this before (I didn't know it existed). Enable NFS on the QNAP wasn't set. You'd think if you set up a share via NFS, there would be some indication to enable it in the first place.

I can connect to the NAS now :)

Next step to auto-mount...

Thanks!
Learning linux & dumping spyware Windows
Intel Core i5-7500 (Kaby Lake) | Asus H270-Plus | 16gb DDR4 HyperX Fury
Samsung 960 EVO 500GB NVME SSD | 2TB HDD
User avatar
coffee412
Level 6
Level 6
Posts: 1077
Joined: Mon Nov 12, 2012 7:38 pm
Location: Indiana, USA
Contact:

Re: Cannot mount QNAP NAS folder

Post by coffee412 »

Code: Select all

PORT      STATE SERVICE
22/tcp    open  ssh
80/tcp    open  http
139/tcp   open  netbios-ssn
443/tcp   open  https
445/tcp   open  microsoft-ds
631/tcp   open  ipp
8080/tcp  open  http-proxy
8081/tcp  open  blackice-icecap
No port 111 for rpc. Also, No port 2049 for nfs on the server. This is why you get the timeout.

Check the network settings on your server to make sure you can / are running sharing with nfs.

LOL! Just tried to post this and got alerted to your fix. Good job!

Have fun!
Ryzen x1800 Asus Prime x370-Pro 32 gigs Ram RX480 graphics
IceWarp 12.0.3 * Mint 18.3 * RAID 1/5 * OpenVPN * Linux since kernel 2.0.36
************* Get Your Linux on! ***************
User avatar
coffee412
Level 6
Level 6
Posts: 1077
Joined: Mon Nov 12, 2012 7:38 pm
Location: Indiana, USA
Contact:

Re: Cannot mount QNAP NAS folder

Post by coffee412 »

Auto-mounting

This involves adding the mount to the /etc/exports file on your linux box. IF YOU ARE SHARING THEM OUT FROM YOUR LINUX BOX.

OTHERWISE SKIP DOWN

I will use my share(s) as an example:

I will be sharing out my /mnt/raidbox to everyone:

/mnt/raidbox *(rw,insecure,async,no_subtree_check)

Here is where I share out /mnt/raidbox/movies only to those in my local network:

/mnt/raidbox/movies 10.0.1.0(rw,sync,no_subtree_check)

Here is where only my computer has access to the html directory

/var/www 10.0.1.61(rw,sync,no_subtree_check)

Edit your /etc/exports file and add the appropriate lines on your nas - if it has this. I have never bothered to run a nas as I always use linux servers for all file sharing. You might have a GUI for setting up the shares in your nas.

To automount just add a line to your /etc/fstab on the linux box like this (once again mine as an example) :

Code: Select all

dino2:/mnt/raidbox	/home/coffee/raidbox		nfs	rw,user,_netdev	0 0
dino2:/var/www		/home/coffee/webserver		nfs	rw,user,_netdev 0 0
My server is called dino2 - btw :)

Save the /etc/fstab file and lets test it.

When you go to mount a nfs share you do not need the whole mount line IF it is mentioned in the /etc/fstab file.

Code: Select all

sudo mount dino2:/var/www
(replace with your server name / path )
Ryzen x1800 Asus Prime x370-Pro 32 gigs Ram RX480 graphics
IceWarp 12.0.3 * Mint 18.3 * RAID 1/5 * OpenVPN * Linux since kernel 2.0.36
************* Get Your Linux on! ***************
Post Reply

Return to “Newbie Questions”