Help Center> FunctionGraph> User Guide> Appendixes> Creating an NFS Shared Directory on ECS

Creating an NFS Shared Directory on ECS

Linux OS

  • CentOS, SUSE, EulerOS, Fedora, or openSUSE
    1. Run the following command to install nfs-utils:
      yum install nfs-utils
    2. Create a shared directory.

      To create shared directory /sharedata, add the following configuration to the /etc/exports file:

      /sharedata 192.168.0.0/24(rw,sync,no_root_squash)

      The preceding configuration is used to share the /sharedata directory with other servers in the 192.168.0.0/24 subnet.

    3. Run the following commands to start the NFS server:
      systemctl start rpcbind
      service nfs start
    4. Create another shared directory.

      For example, to create the /home/myself/download directory, add the following configuration to the /etc/exports file:

      /home/myself/download 192.168.0.0/24(rw,sync,no_root_squash)

      Restart the NFS service.

      service nfs restart

      Alternatively, run the following command without restarting the NFS service:

      exportfs -rv
    5. (Optional) Enable automatic startup of the rpcbind service in the OS.

      Run the following command:

      systemctl enable rpcbind
  • Ubuntu
    1. Run the following commands to install nfs-kernel-server:
      sudo apt-get update
      sudo apt install nfs-kernel-server
    2. Create a shared directory.

      To create shared directory /sharedata, add the following configuration to the /etc/exports file:

      /sharedata 192.168.0.0/24(rw,sync,no_root_squash)

      The preceding configuration is used to share the /sharedata directory with other servers in the 192.168.0.0/24 subnet.

    3. Start the NFS service.
      service nfs-kernel-server restart
    4. Create another shared directory.

      For example, to create the /home/myself/download directory, add the following configuration to the /etc/exports file:

      /home/myself/download 192.168.0.0/24(rw,sync,no_root_squash)

      Restart the NFS service.

      service nfs restart

      Alternatively, run the following command without restarting the NFS service:

      exportfs -rv

Windows OS

  1. Install an NFS server.

    Paid software: haneWIN. Download the software at haneWIN official website.

    Free software: FreeNFS and WinNFSd. Download the software at the SourceForge website.

  2. Enable the NFS function.
    • In the case of WinNFSd, see WinNFSd configuration.
    • In the case of haneWIN, perform the following steps:
      1. Run nfsctl.exe as the administrator.
      2. Right-click in the blank area and choose Insert from the shortcut menu.
        Figure 1 Insert