auristorfs_linux_exportnfs - Exporting /afs over NFS on Linux
The Linux AuriStorFS client supports exporting the contents of /afs or subdirectories over NFS. NFS protocol versions 4, 3 or 2 can be used.
The instructions below are based on Fedora or Red Hat Enterprise Linux (RHEL) distributions. They may need to be adapted for other distributions.
Any host with the auristor-client package can be configured to export over NFS, as follows:
Install the required NFS server packages, and have the NFS services enabled and running:
% dnf install nfs-utils % systemctl enable --now nfs-server
Configure the client to enable exporting, by adding the exportnfs = yes option in the [afsd] section of the /etc/yfs/yfs-client.conf file.
Add an entry to /etc/exports (or in a file under /etc/exports.d), then restart the NFS server or notify it to reread its configuration: % echo "/afs/your-cell-name.com *(rw)" >> /etc/exports % exportfs -r
This example would export everything under /afs, in readonly mode: % echo "/afs *(ro)" >> /etc/exports % exportfs -r
NFS clients can mount the target path using the mount command:
% mount -t nfs gateway-host:/afs/your-cell-name.com /mnt
Optionally, a specific NFS version can be requested with the nfsvers mount option. For instance, this will request the use of NFS V3:
% mount -t nfs -o nfsvers=3 gateway-host:/afs/your-cell-name.com /mnt
By default the mount will use the highest version supported by both the client and server. This will typically be V4 for recent distributions.
The use of NFS V2 is discouraged, but it may be necessary if there is a need to export to legacy clients that do not support newer protocol versions of NFS.
As shipped, the NFS server packages in Fedora and RHEL will not respond to V2 requests. This can be enabled by passing the -V 2 option to the nfs server process, adding this line to /etc/sysconfig/nfs:
Note that Fedora and RHEL do not include NFS V2 modules with their kernels. An attempt to mount with -o nfsvers=2 will fail with an indication that the protocol is not supported, even if the server supports V2.
There are some limitations and other issues that should be kept in mind when using this feature.
All access to AuriStorFS servers will be done using the tokens associated with the uid running the NFS server processes. This is typically root.
For V2 clients, only the contents of the gateway host's workstation cell can be accessed. The cell can be displayed on the gateway host with: % fs wscell
Spurious ENOTEMPTY errors may occur with some access patterns that use files then unlink them and their parent directories in quick succession.
It is recommended to avoid concurrent use of the same files via exports and through /afs directly on the gateway host.
Loopback mounting (NFS client and server on the same host) can lead to some deadlocks, and is not a supported configuration. This is a general recommendation that applies to any exported filesystem on Linux and is not specific to AuriStorFS.
Care must be taken if the AuriStorFS client is stopped or restarted, as the NFS server may have references to files that will prevent /afs from being unmounted cleanly. Always stop the NFS server before stopping the AuriStorFS client: % systemctl stop nfs-server % systemctl stop yfs-client
A dependency can be added in the nfs-server service file /lib/systemd/system/nfs-server.service:
After = yfs-client.service
This will enforce the correct ordering when starting up and shutting down.
The -fakestat setting will be forced to off/false when -exportnfs is used, as it can interfere with the nfs server's path reconnection logic and result in stale file handle errors on the nfs clients.
Copyright AuriStor, Inc. 2014-2021. https://www.auristor.com/ All Rights Reserved.
"AFS" is a registered mark of International Business Machines Corporation, used under license. (USPTO Registration 1598389)
"OpenAFS" is a registered mark of International Business Machines Corporation. (USPTO Registration 4577045)
The "AuriStor" name, log 'S' brand mark, and icon are registered marks of AuriStor, Inc. (USPTO Registrations 4849419, 4849421, and 4928460) (EUIPO Registration 015539653).
"Your File System" is a registered mark of AuriStor, Inc. (USPTO Registrations 4801402 and 4849418).
"YFS" and "AuriStor File System" are trademarks of AuriStor, Inc.