LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-21-2019, 12:04 PM   #1
mackowiakp
Member
 
Registered: Jun 2014
Location: Poland/Gdynia
Distribution: Mageia 9, SH4, Debian
Posts: 367

Rep: Reputation: 8
Mount NFS share from Linux to QNAP NAS


I use such command to mount NFS share exported from Linux server (Mageia 7 based, 64 bit, 6 core/12 treads, 64 GB RAM) to QNAL NAS (64 bit Intel, 8 GB RAM)

Mount command executed on QNAP:

Code:
mount -w -vvv -t nfs -o rw -o vers=3 -O user=root.password=<pass> 192.168.0.2:/home/maciek/back/RSYNC /share/CACHEDEV2_DATA/mnt
It mounts RSYNC dir from PC to /share/CACHEDEV2_DATA/mnt without problems.
/home/maciek/back/RSYNC is de facto separate filesystem mounted on demand from USB ver 3 connected v3 HDD. The content of /share/CACHEDEV2_DATA/mnt listed on QNAP after mount looks like this:

Code:
[/share/homes/media/Pobrane] # ls -la /share/CACHEDEV2_DATA/mnt/
total 100
drwxrwxrwx 23 admin administrators  4096 2019-12-21 12:50 ./
drwxrwxrwx  6 admin administrators  4096 2019-03-23 09:21 ../
drwxr-xr-x  2 admin administrators  4096 2017-08-26 10:01 Asus/
drwxr-xr-x  3 media media           4096 2019-01-03 07:27 Bioama/
drwxr-xr-x  3 admin administrators  4096 2019-05-16 16:25 Domoticz/
drwxr-xr-x  3 admin administrators  4096 2017-03-17 13:57 Entware/
drwxr-xr--  4 media media           4096 2014-03-07 19:50 EXATEL/
drwxrwxr-x 27 media media           4096 2019-02-26 14:04 Filmy/
drwxrwxr-x  2 media media           4096 2019-12-20 16:47 Gosia_ISO/
drwxr-xr-x 12 admin administrators  4096 2018-08-17 13:10 jffs/
drwxr-xr-x  3 media media           4096 2016-08-05 05:31 LAMIA/
drwx------  8 media media           4096 2014-03-07 10:56 lost+found/
drwxr-xr-x  3 media media           4096 2019-01-03 07:27 Media/
drwxrwxr-x 57 media media           4096 2019-02-26 14:04 Muzyka/
drwxrwxr-x  3 admin administrators  4096 2019-12-18 16:16 NextCloud/
drwxr-xr-x  9 media media           4096 2017-08-17 14:54 Oprogramowanie-Gosia/
drwxrwxr--  6 media media           4096 2015-12-08 07:53 Oprogramowanie-Piotr/
drwxr-xr-x  9 media media           4096 2018-11-09 10:25 Oprogramowanie-Piotr-L/
drwxr-xr-x  2 media media           4096 2019-12-20 16:40 Piotr_ISO/
drwxrwxr-x  2 media media           4096 2019-12-20 16:44 Piotr-L_ISO/
drwxr-xr-x  5 media media          12288 2015-02-08 19:21 PROKOM/
lrwxrwxrwx  1 admin administrators    27 2017-03-08 14:18 @Recycle -> /share/homes/@Recycle/media
drwxr-xr-x  2 media media           4096 2014-03-24 17:57 Stara poczta/
drwxrwxr-x 38 media media           4096 2019-09-13 10:51 Zdjecia/
Looks ok. But it is possible to create/modify/delete file in root exported dir that is /share/CACHEDEV2_DATA/mnt/ directory but not in any subdirectory. For example:

Code:
[/share/homes/media/Pobrane] # touch /share/CACHEDEV2_DATA/mnt/jffs/ttt
touch: /share/CACHEDEV2_DATA/mnt/jffs/ttt: Permission denied
So what I am doing wrong?

The content of /etc/exports on PC:

Code:
[root@Piotr ~]# cat /etc/exports
/home/maciek/back/RSYNC 192.168.0.7(rw,subtree_check,crossmnt)
On both units are users having the same UID/GID, but different names.

Any idea?

Last edited by mackowiakp; 12-21-2019 at 12:07 PM.
 
Old 12-21-2019, 04:30 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
You seem to be root on the NFS client. Normally, root is mapped to a non-root user. Check export option no_root_squash.
 
1 members found this post helpful.
Old 12-21-2019, 11:07 PM   #3
mackowiakp
Member
 
Registered: Jun 2014
Location: Poland/Gdynia
Distribution: Mageia 9, SH4, Debian
Posts: 367

Original Poster
Rep: Reputation: 8
Yes, I am root. But in QNAP they use name "admin" as user with UID=0 and administrator as GID=0. So admin/administrator stands for root/root. Strange, but QNAP OS is bizarre version of Debian/Ubuntu 14.4

EDIT

Adding no_root_squash to exports resolved problem THX !

But now I have another problem. If I unmount NFS share and than try to mount it again, sometimes error
"Stale file handle" occurs. It seams to say that NFS share was not unmount fully clean and something still try to access unmounted NFS share. If only my assumption but it looks like that.
Any advice what to do wit this without rebooting both client and server?

Last edited by mackowiakp; 12-22-2019 at 02:02 AM.
 
Old 12-22-2019, 04:10 AM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
I googled this for you (and for me). Plenty of information about this error is available. One of the better resources is https://unix.stackexchange.com/quest...cannot-umount; the second answer provides steps to get rid of the problem.

EDIT: The superuser is UID 0. It's normally named root, but can have other names. Thus, QNAP's admin may be an unusual name, but it's entirely legitimate. The "root" in "no_root_squash" doesn't actually refer to user root, but to UID 0.
As far as I know, anyway.

Last edited by berndbausch; 12-22-2019 at 04:16 AM.
 
Old 12-22-2019, 05:04 AM   #5
mackowiakp
Member
 
Registered: Jun 2014
Location: Poland/Gdynia
Distribution: Mageia 9, SH4, Debian
Posts: 367

Original Poster
Rep: Reputation: 8
Quote:
The "root" in "no_root_squash" doesn't actually refer to user root, but to UID 0.
Yes, of course I know.

THX for help!
 
Old 12-22-2019, 09:53 PM   #6
mackowiakp
Member
 
Registered: Jun 2014
Location: Poland/Gdynia
Distribution: Mageia 9, SH4, Debian
Posts: 367

Original Poster
Rep: Reputation: 8
Quote:
One of the better resources is https://unix.stackexchange.com/quest...cannot-umount; the second answer provides steps to get rid of the problem.
Disabling NFS v2/3 server compatibility on QNAP NAS resolved the problem. It is strange for me because in this case I use NFS client from NAS to mount share from another NFS server. But NFS server is still running of course in background on NAS.
Nevertheless, it resolved "Stale file handle" problem.
QNAP OS is still bizarre for me.
 
  


Reply

Tags
nfs, nfs exports, nfs mount network



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
LXer: Extending Linux Photographic Workflow with a QNAP NAS LXer Syndicated Linux News 0 11-27-2017 05:42 AM
Mount NAS-QNAP to Ubuntu Server AmirSI Linux - Newbie 4 03-14-2014 06:23 AM
Best practice for accessing Qnap NAS from linux Mint Manganus Linux - Newbie 3 11-11-2013 07:15 AM
Locked out of linux based NAS (QNAP TS-409Pro) -- My fault though kwiksand Linux - General 5 01-17-2010 04:53 PM
QNAP NAS-server under Linux? ronald-be Linux - Hardware 2 09-16-2007 05:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:31 AM.

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