[SoftNAS KB]: Migrating NFS, and upgrading to NFSv4

Symptoms

When exporting files from one SoftNAS NFS server instance to another, you are in effect creating NFSv3 during the export. In order to add NFSv4, several additional steps need to be performed. 

Purpose

The following process will migrate your NFS enabled volumes and pools over to a new instance, and create NFSv3 on the instance in the process. You will then integrate NFSv4 on your new instance.

Resolution

  • Log in to your new (target) SoftNAS instance using your current credentials.
  • In the Storage Administration pane, expand Settings, and select General System Settings.

    General System Settings

  • This will bring you to the Webmin Panel. In the Webmin Panel, select Servers, then OpenSSH, and select Authentication.



  • Select Yes for the option Allow Password Authentication.



  • SSH into the source SoftNAS instance.
    Run the following command.

    sudo scp /etc/exports softnas@newSoftNASip:~

    This will copy your NFS export settings to the new instance.  
  • Enter your softnas Password. All commands should be run as root.

    Note: The default password for AWS is the instance id ('i-xxxxxxxx'). For VMware, the default is 'Pass4W0rd' (note the zero).

  • SSH into the new SoftNAS instance via its IP address.
    Run the following commands:

    sudo cp ./exports /etc/exports

    sudo <text editor> /etc/exports

    /exports *(ro,fsid=0)

    Note:  The '*' above can be changed to the IP of each server for more security. Add a line for each IP in place of '*'.

    Note: For each /<pool>/<vol> entry, copy the line and append '/exports'.

  • Next, run the following commands:

    sudo <text editor> /etc/fstab

    <pool>/<vol> /exports/<pool>/<vol> bind bind 0 0

    Note: For each /exports/<pool>/<vol> in the /etc/exports, add a line like the above.

  • Add the correct directories:

    sudo mkdir -p /exports/<pool>/<vol>

    Note: For each NFSv4 export used in the above steps, add a directory using the above command.

  • Still for the new (or target) SoftNAS instance, run the following commands:

    sudo mount -av

    sudo service nfsd restart

    This will allow for both NFSv3 and NFSv4 on the target node, and the migrated data.

  • On the client, then run:

    mount -o nfsvers=X 

    where X equals the needed version.

    Alternatively, in the /etc/fstab options for NFS, run the command:

    mount add 'vers=X'

    where vers equals the needed version.