User Tools

Site Tools


aix:aix_nfsv4

This is an old revision of the document!


AIX: Mount a filesystem on NFS v4

  • On the source host, check the domain:
[root@nfsserver]/root# chnfsdom
Current local domain: mydom
  • On the target host, set the domain, and start NFSv4 daemon:
[root@labotest]/root# chnfsdom        
Current local domain: N/A
[root@labotest]/root# chnfsdom mydom
[root@labotest]/root# chnfsdom      
Current local domain: mydom
[root@labotest]/root# cat /etc/nfs/local_domain
mydom
[root@labotest]/root# startsrc -g nfs
0513-029 The biod Subsystem is already active.
Multiple instances are not supported.
0513-059 The nfsd Subsystem has been started. Subsystem PID is 66142.
0513-059 The rpc.mountd Subsystem has been started. Subsystem PID is 20447570.
0513-059 The nfsrgyd Subsystem has been started. Subsystem PID is 39715266.
0513-059 The gssd Subsystem has been started. Subsystem PID is 55509106.
0513-029 The rpc.lockd Subsystem is already active.
Multiple instances are not supported.
0513-029 The rpc.statd Subsystem is already active.
Multiple instances are not supported.
  • On the source host, export a filestem for NFS V3 and V4 (if not specified = v3):
[root@nfsserver]/root# vi /etc/exports
/nfs_test -vers=3:4
[root@nfsserver]/root# exportfs -va
  • On the target host, mount the NFSv4 exported filesystem:
[root@labotest]/root# mount -o vers=4,soft,intr nfsserver:/nfs_test /mnt 
[root@labotest]/root# mount | grep /mnt
nfsserver /nfs_test      /mnt             nfs4   Oct 28 17:19 vers=4,soft,intr

On client ports used for NFSv4:

  • nfsserver:2049
  • clientnfs: 1022-1023

Restrict access

[root@labotest]/root# cat /etc/exports
/Tech/test1 -vers=4,sec=sys:krb5p:krb5i:krb5:dh,rw,access=10.1.199.35,root=10.1.199.35

Required Tuning to Mount Linux NFSv4 export

# For NFS with Linux, add the following settings

nfso portcheck  1 (not sure)
nfso nfs_use_reserved_ports  1
nfs -po <param>=<value>

Commands to export/unexport on AIX server

Example to unexport

[root@nfsserver]/root# rmnfsexp -d /export/mksysb

Example to export

[root@nfsserver]/root# mknfsexp -d /export/mksysb -v 3,4 -S sys,krb5p,krb5i,krb5,dh -r aixn*,aixa*,aixb* -t rw

Open the /etc/filesystems file on labotest with a text editor.

/mksysb:
        dev             = "/export/mksysb"
        vfs             = nfs
        nodename        = nfsserver
        mount           = true
        options         = bg,soft,intr,vers=4,sec=sys
        account         = false

NFSv4 error

Error while trying to export

root@ds:/root# cat /etc/exports
/export/aix72 -vers=3:4
root@ds:/root# exportfs -va
error: Too many levels of symbolic links

First chek if you have symbolic link into you directory

find /export/aix72 -type l

In symbolic link exist, remove it, else:

This problem is more common when using a NFS filesystem (v3 or v4) over an filesystems backend and with a lot of files in the same directory (more than 50000).

The problem is related to the readdir function of the readdir API, that uses the readdir cookie to quickly locate a file inside a directory. The NFS server uses this API while communicating with filesystem backends.

The “readdir loop” problem seems to be fairly widely known. Try to upgrade your OS, and reboot.

aix/aix_nfsv4.1636636468.txt.gz · Last modified: 2021/11/11 14:14 by manu