Cool Solution - NFS with UCS

From Univention Wiki

Jump to: navigation, search
Produktlogo UCS Version 4.1
Produktlogo UCC Version 3.0

Note: Cool Solutions are articles documenting additional functionality based on Univention products. Not all of the shown steps in the article are covered by Univention Support. For questions about your support coverage contact your contact person at Univention before you want to implement one of the shown steps.

Also regard the legal notes at Terms of Service.

This article describes how to configure the Network File System (NFS) in Version 4 for Univention Corporate Clients (UCC) and Univention Corporate Servers (UCS). Since UCS 3.2 NFSv4 is activated by default1.. UCS Versions < 3.2 use NFSv3 for shares so please have a look on NFSv4 for Univention Corporate Server < 3.2.

NFS on UCS

Shares on UCS

For bigger environments, it is recommended to set up a separate file server (e.g. DC Slave). On this server, shares can be created as described in the UCS documentation.

Configuration in the Univention Management Console

Beside several different options in the tab 'NFS' which are described in the UCS documentation, it is possible to set the following Univention Configuration Registry variables:

  • nfs/autostart - This variable configures the start mode of the NFS service. If set to 'no' or 'disabled', the service cannot be started. If the variable is set to 'manually', the service isn't started during system boot, but can be enabled manually at a later point.
  • nfs/common/gssd - This variable defines if the gssd daemon should be started. Evaluated values are 'yes', 'no' or <undefined> (default=yes).
  • nfs/common/idmapd - This variable defines if the idmap daemon should be started. Evaluated values are 'yes', 'no' or <undefined> (default=yes).
  • nfs/create/homesharepath - If this option is activated, the home directory configured for a user in the attributes 'Home share' and 'Home share path' is automatically created through a Univention Directory Listener module.
  • nfs/nfsd/nfs4 - This option activates the NFSv4 support of the NFS server. In addition the IDMAPD process must be configured usually.
  • nfs/ports - If this variable is set to 'static', fixed ports are used for the NFS services: 32767 for RPC mounts, 32765/32766 for statd and 32769 for the quota service. Otherwise the ports are assigned dynamically.
  • ucc/pxe/nfsroot - Sets the PXE rollout server in the domain.

NFS for UCC

Prerequisite:
Install the needed package:

apt-get install nfs-common

Besides that you need a directory the NFS directory will be mounted to.

mkdir <PATH TO MOUNT POINT>

Temporary mount

Verify following setting in the following file on your UCS Server: /etc/default/nfs-kernel-server:

NEED_SVCGSSD=no

To temporary mount a NFSv4 share, use following command:

mount -t nfs4 <NFS SERVER>:<PATH TO SHARE> <PATH TO LOCAL MOUNT POINT>

Static mount

To add the share permanently, it is possible to mount the share statically during the system startup. Therefore, the following line has to be added to the /etc/fstab file (USE TABS BETWEEN THE VALUES):

<NFS SERVER>:<PATH TO SHARE> <PATH TO LOCAL MOUNT POINT> nfs4 auto 0 0

Auto mount

It is possible to only mount the share when accessed and unmount it after a period of inactivity.
This conserves bandwidth and increases the overall performance.

For this, it is necessary to install autofs:

apt-get install autofs

You also have to create the folder /etc/auto.master.d if it doesn't exist yet:

mkdir -p -m755 /etc/auto.master.d/

Afterwards, add the following line to the bottom of the file /etc/auto.master:

/- /etc/auto.master.d/auto.<NAME OF SHARE> --timeout=60 --ghost

Now, create the file /etc/auto.master.d/auto.<NAME OF SHARE> and insert the following line (USE TABS BETWEEN THE VALUES):

<PATH TO LOCAL MOUNT POINT> -fstype=nfs4 <NFS SERVER>:<PATH TO SHARE>

Verify following settings in /etc/default/nfs-common:

NEED_IDMAPD=yes 
NEED_GSSD=no # Default

Reload autofs:

service autofs restart

Test, if it worked:

ls <PATH TO LOCAL MOUNT POINT>

References

1. Release Notes Univention Corporate Server 3.2: http://docs.univention.de/release-notes-3.2-en.html#idp3973216
2. https://help.ubuntu.com/community/SettingUpNFSHowTo
3. https://help.ubuntu.com/community/Autofs

Personal tools