This topic describes how to access gateways from a client that runs the Linux operating system.

Prerequisites

You have created an NFS share. For more information, see Create a share.

Background information

To access a gateway from a client that runs the Linux operating system, you must mount the NFS share to a local file directory. After the share is mounted, directory mappings are established between the share and the local directory. You can perform operations on the remote share in the same way as managing local file directories.

Procedure

  1. Log on to the ECS console.
  2. Mount the NFS share to the local directory on the client computer.
    1. Run the following command to mount the NFS share:
      mount.nfs 192.168.0.0:/shares local-directory
      • 192.168.0.0:/shares: the mount point of the file gateway, including the gateway IP address and the share name. Replace them with the actual IP address and share name. To query the mount point, navigate to the Share page of the target file gateway.
      • local-directory: the local file directory. Specify any file directory that supports read and write operations. You cannot specify a directory that does not exist.
      Note If your file gateway version is earlier than 1.0.35, and you have mounted shares using the NFSv3 protocol, then you must run the showmount –e <The IP address of the file gateway> command to query the mount path. The procedure is as follows.
      1. Run the following command to query the mount path, for example, 192.168.0.0:/shares.
        showmount –e <The IP address of the file gateway>
      2. Run the following command to mount the share to the local directory.
        mount -t nfs -o vers=3,proto=tcp,nolock,noacl,sync 192.168.0.0:/shares local-directory
    2. Run the df -h command to verify the result.

      If the following or similar information appears, it indicates that the share is mounted to the local directory.

      Note After the share is mounted to the local directory, it will show the file system capacity managed by this share. For more information about the capacity, see Specifications.
      Verify the result
  3. Access the share.

    After the share is mounted to the local directory, you can perform operations on the remote share in the same way as managing the local file directory. If you have the write permission, you can write data to the share. If you have the read-only permission, then you can only read data from the share.

    Note Shares are synchronized with the associated OSS buckets. Operations performed on shares are synchronized to the associated OSS buckets.