Creating NFS Shares

With the Network File System (NFS) protocol, you can create and manage NFS shares in an Oracle Cloud Infrastructure (OCI) instance, and export files to the compute instance.

Note

Oracle Linux works with the NFSv3 and NFSv4 protocols.

Prerequisites and Considerations

Before you begin:

Creating an NFS Share In an OCI Instance

To create an NFS share in an OCI instance from the command line:

  1. Do one of the following:
    • Follow the instructions in the relevant Managing the Network File System guide for the Oracle Linux image version, with the following consideration:

      • Before you edit the etc/exports file, the directories and files that you want shared on the instance must already exist, and must have the appropriate permissions, as required by the environment.

    • Follow the tutorial at Create an NFS server on Oracle Linux.

  2. Access the NFS share. See Accessing NFS and Samba Shares.

Creating an NFS Share In an OCI Instance Using Cockpit

You can create an NFS share in a compute instance from the Cockpit web console by using the Cockpit file sharing plugin.

To create an NFS share using the Cockpit web console:
  1. On the compute instance, install and enable Cockpit. See Install and Enable Cockpit.

  2. Use DNF to install the cockpit-file-sharing package.

    The cockpit-file-sharing package is contained in the DNF developer_EPEL repository, and you must enable the repository before installing the package.

    For example:

    sudo yum-config-manager --enable ol<version>_developer_EPEL
    sudo dnf install cockpit-file-sharing
    Note

    Packages in the developer_EPEL repositories are considered unsupported and support is limited to basic installation. Content from this repository isn't recommended for production environments and is intended for development use only.
  3. Sign in to Cockpit. See Log in to the Cockpit Web Console.

  4. From the Cockpit web console, select Services, and search for the NFS server.

    If you find the NFS server, skip to Step 7. If NFS hasn't been configured, or the NFS service is off, go to the next step.

  5. To enable the NFS server and service, select the NFS server and services gray toggle.

    Activating the toggle switch makes the NFS service start automatically, and start after each system reboot.

  6. From the Services page, navigate to the Sockets section, and select the RPCbind Server Activation Socket gray toggle.

    Activating the toggle switch makes the RPC socket start automatically, and start after each system reboot.

  7. Create an NFS share:

    1. Select File Sharing, select the NFS tab, and then select the blue plus sign (+) button.

      The Add Export window is displayed.

    2. Enter the name and path of the NFS share, and in the Client Name and Client IP fields, enter the compute instance name and IP address.

    3. Select Add.

      Note

      The NFS share isn't visible in the /etc/export path. Instead, the exportfs command creates the NFS share at run time, and the NFS share resides in the /var/lib/nfs/etab path. To inspect the NFS share, use the exportfs -s command.

  8. Access the NFS share. See Accessing NFS and Samba Shares.