For others like myself, who will not be able to go to 4.3.X (wrong Intel processor ;( ) - Having some instructions on how to work with NFSv4 in a single post might be useful!
On many systems, NFSv4 is now default - with one important "hidden" default I'll be asking about below.
So, once you activate NFSv4 - if you need NFSv3 you (may) need to add "vers=3" to your mount options.
Step 1: activate NFSv4 on your QNAP NAS
As it is not part of the GUI - login as admin via ssh and then:
Code: Select all
[~] # /sbin/setcfg NFS Enable_V4 TRUE
[~] # /etc/init.d/nfs restart
nfs_get_lock
Shutting down NFS services: OK
Starting NFS services: re-export.
Shutting down NFS mountd:
Starting NFS mountd. Mountd port number = 30000.
OK
[~] #
I have not seen rpcinfo on QNAP - so I call use it from a client to query the server.
Code: Select all
michael@x071.home.local:[/home/michael]rpcinfo -p x053 | grep nfs
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
Step 3: The basics are running - but there is one more setting that must match for NFSv4 to work - the so-called domain.
Some versions of Linux have this setup to be the DNS domain, e.g., qnap.home.local would be "qnap" as short hostname, and "home.local" as the (default) NFSv4 domain. On (most) Linux distributions - so I assume also for QNAP - this is configured via the file /etc/idmapd.conf
Code: Select all
[~] # cat /etc/idmapd.conf
[General]
Verbosity = 9
Pipefs-Directory = /var/lib/nfs/rpc_pipefs
Domain = localdomain
[Mapping]
Nobody-User = guest
Nobody-Group = guest
FYI: On AIX this is set using the command: chnfsdom <domain>, and is viewed by chnfsdom; #no argument. The domain name is stored in the file /etc/nfs/domain (not newline terminated) - e.g.,
Code: Select all
root@x071.home.local:[/home/root]od -dc /etc/nfs/local_domain
0000000 29295 28532 30311
r o o t v g
0000006
Code: Select all
[~] # hostname
qnap
[~] # nslookup qnap
Server: fritz.box
Address: 192.168.120.254
Name: qnap
Address: 192.168.120.53
Update: I edited the file /etc/imapd.conf and changed the domain to home.local (and on AIX, ran chnfsdom home.local). I also had to restart NFS on AIX to get te NFS domain part active.
I was able to mount the NFSv4 root - but it was empty - as QNAP defines /share/NFS=4/ as the NFSv4 root - and there is nothing there.
Note: on the QNAP /share is the alias path for NFSv3 exports. e.g., mount -h qnap -d /Web -f /mnt mounts /share/Web on /mnt on the client. On QNAP /share/Web is a symbolic link to /MD0_DATA/Web. I tried adding a symbolic link (as you would find in /share)
Code: Select all
[/share] # ls -ld *Web */*Web
drwxrwxrwx 8 admin administ 4096 May 10 08:31 MD0_DATA/Web/
drwxrwxrwx 9 admin administ 4096 Feb 20 13:09 MD1_DATA/Web/
lrwxrwxrwx 1 admin administ 19 May 11 12:17 NFSv=4/Web -> /share/MD0_DATA/Web/
lrwxrwxrwx 1 admin administ 12 May 10 08:28 Web -> MD0_DATA/Web/
Code: Select all
michael@x071.home.local:[/nfs]ls -l
total 0
lrwxrwxrwx 1 root system 19 May 11 12:17 Web -> /share/MD0_DATA/Web
Code: Select all
[/share] # mount | grep NFSv
tmpfs on /share/NFSv=4 type tmpfs (rw,size=16M)
/share/MD0_DATA/aixtools on /share/NFSv=4/aixtools type none (rw,bind)
/share/MD0_DATA/distros on /share/NFSv=4/distros type none (rw,bind)
/share/MD0_DATA/httpd on /share/NFSv=4/httpd type none (rw,bind)
/share/MD0_DATA/michael on /share/NFSv=4/michael type none (rw,bind)
/share/MD0_DATA/projects on /share/NFSv=4/projects type none (rw,bind)
tmpfs on /share/NFSv=4 type tmpfs (rw,size=16M)
/share/MD0_DATA/Web on /share/NFSv=4/Web type none (rw,bind)
tmpfs on /share/NFSv=4 type tmpfs (rw,size=16M)