NFSv4 server
NFSv4 exports exist in a single pseudo filesystem, where the real directories are mounted with the --bind option.
# mkdir -p /export/users
# mount --bind /home/chamy /export/users
/home/users /export/users none bind 0 0
/etc/default/nfs-kernel-server
/etc/default/nfs-common
NEED_SVCGSSD=no # no is default
NEED_IDMAPD=yes NEED_GSSD=no # no is default
In order for the ID names to be automatically mapped, both the client and server require the /etc/idmapd.conf file to have the same contents with the correct domain names. Furthermore, this file should have the following lines in the Mapping section:
[Mapping] Nobody-User = nobody Nobody-Group = nogroup
However, the client may have different requirements for the Nobody-User and Nobody-Group. For example on RedHatvariants, it's nfsnobody for both. Cat /etc/passwd and cat /etc/group should show the "nobody" accounts.
[Translation] Method = nsswitch
This will cause idmapd to know to look at nsswitch.conf to determine where it should look for credential information (and if LDAP authentication already working, nsswitch shouldn't require further explanation).
/export 192.168.1.0/24(rw,fsid=0,insecure,no_subtree_check,async) /export/users 192.168.1.0/24(rw,nohide,insecure,no_subtree_check,async)
NFSv4 client
NEED_IDMAPD=yes NEED_GSSD=no # no is default
mount.nfs4: No such device
# modprobe nfs
nfs-server or ipaddress:/ /mnt nfs4 _netdev,auto 0 0
The auto option mounts on startup and the _netdev option waits until system network devices are loaded. However this will not work withWiFi as WiFi is set up at the user level (after login) not at system startup. If user use _netdev with WiFi the boot process will pause waiting for the server to become available.
Note that _netdev only works with nfs version 3 and before. nfs4 ignores this option. Depending on how fast the network comes up on boot the mount entry may fail and the system will just keep booting. It can still be useful if user make own script to wait for the network to come up and then mount -a -O _netdev
Server doesn't come with any init.d/netfs or other scripts to do this for user.
No comments:
Post a Comment