top of page

NFS Configuration and Management

Nexfs can optionally directly manage and/or configure the Linux NFS server. You can choose if Nexfs should configure the NFS server and if Nexfs should manage (start and stop) the NFS server.

 

NFS Service Configuration

To allow Nexfs to configure the NFS server you must first enable the NFS service in Nexfs by setting NFSENABLED to 1 (enabled), to disable NFS management set NFSENABLED to 0

Example of using nexfscli to enable the NFS service on Nexfs start:

# nexfscli configfile set NFSENABLED 1
Updated Configuration file

If Nexfs is already running, you can enable NFS without requiring a restart with:

# nexfscli liveconfig set NFSENABLED 1

Updated Live Configuration

More information on managing Nexfs using nexfscli can be found here

By default Nexfs will manage up to 12 NFS exports, this is a soft limit that can be changed through the NFSMAXEXPORTS setting

NFS Start/Stop Management

Nexfs can be configured to start and stop the Linux NFS service, to enable NFS management set NFSSTARTSTOP to 1, or set NFSSTARTSTOP to 0 to disable direct management.

Note: NFS configuration must also be enabled in Nexfs (see NEXFSENABLED above) in addition to NFSSTARTSTOP for Nexfs to start and stop the Linux NFS service.

Example of using nexfscli to enable the NFS service management on Nexfs start:

# nexfscli configfile set NFSSTARTSTOP 1
Updated Configuration file

If Nexfs is already running, you can enable NFS management without requiring a restart with:

# nexfscli liveconfig set NFSSTARTSTOP 1

Updated Live Configuration

More information on managing Nexfs using nexfscli can be found here

Configuring NFS exports

NFS exports are managed through a standard JSON formatted configuration file, the easiest way to view and modify exports is by using the nexfscli management command.

Viewing NFS exports

You can view or make a copy of the current loaded NFS export file using nexfscli, to view the export configuration run:

# nexfscli nfs getexports

To save a copy of the exports configuration to a file, include a filename at the end of the getexports command, for example, to save a copy to a file in /tmp called nexfsnfsexports, run:

# nexfscli nfs getexports /tmp/nexfsnfsexports

Updating, creating and removing NFS exports 

You can add, remove and update existing NFS export using nexfscli, first create a correctly formatted JSON file which contains all exports, including all new and existing exports that should remain, to remove an existing export simply remove it from the JSON file, and run:

# nexfscli nfs putexports /tmp/nexfsnfsexports

Where /tmp/nexfsnfsexports is the location of the JSON file which contains the new configuration.

Once loaded check that the configuration has been accepted by viewing the NFS exports as detailed above, check the nexfs logfile (defaults to syslog) for details if any formatting errors were encountered loading the new configuration file.

Sample NFS JSON Configuration File

Below shows a JSON Configuration file that includes two NFS exported directories, the first exports the directory called "nfsroot" from within the Nexfs mount point, the second exports the directory "diskimages" located at "virtualservers/diskimages" from within the Nexfs mount point. 

 

For exportdir, the prefix directory that the Nexfs file system is mounted to is excluded, for example, if Nexfs is mounted to /mnt/nexfs and the intention is to mount /mnt/nexfs/virtualservers/diskimages, then the exportdir in the JSON configuration is only "virtualservers/diskimages". This allows the Nexfs mount point location to be changed without the need to update existing NFS exports.

See below for a description of each NFS configuration parameter.

{
        "nfsexports":   [{
                        "exportdir":    "nfsroot",
                        "enabled":      1,
                        "auth": "192.168.178.0/24",
                        "secsys":       1,
                        "seckrb5":      1,
                        "seckrb5i":     0,
                        "seckrb5p":     0,
                        "rw":   1,
                        "async":        1,
                        "nowdelay":     1,
                        "squash":       1,
                        "anonuid":      -1,
                        "anongid":      -1,
                        "securelocks":  1,

                        "subtree_check":    1,
                        "rootexport":   1
                }, {
                        "exportdir":    "virtualservers/diskimages",
                        "enabled":      1,
                        "auth": "*",
                        "secsys":       1,
                        "seckrb5":      0,
                        "seckrb5i":     0,
                        "seckrb5p":     1,
                        "rw":   0,
                        "async":        1,
                        "nowdelay":     1,
                        "squash":       1,
                        "anonuid":      -1,
                        "anongid":      -1,
                        "securelocks":  1,

                        "subtree_check":    0,
                        "rootexport":   0
                }]
}

 

 

 

 

NFS Export Configuration Parameters

Green Light TIP.png

"exportdir" is the only required parameter for any export, any parameters not included in the JSON file will be set to the corresponding default value as  documented below

Parameter
Values
Description
secsys
Default: 1 (yes) Valid Values: 0 (no), 1 (yes)
Basic Linux system security (no cryptographic security)
seckrb5
Default: 0 (no) Valid Values: 0 (no), 1 (yes)
The export supports krb5 security (authentication only)
seckrb5i
Default: 0 (no) Valid Values: 0 (no), 1 (yes)
The export supports krb5i security (integrity protection)
seckrb5p
Default: 0 (no) Valid Values: 0 (no), 1 (yes)
The export supports krb5p security (privacy protection)
NFS Service Configuration
NFS Start/Stop Management
Viewing NFS exports
Updating, creating and removing NFS Exports
Sample NFS JSON Configuration File
NFS Export Configuraton Parameters
bottom of page