All Products
Search
Document Center

Access an NFS share from a client

Last Updated: Jun 27, 2019

To access a gateway from a client that runs the Linux operating system, you must mount the NFS share to the 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 by managing the local file directory.

Note: You can create up to 16 NFS shares under each gateway. The upper limit varies depending on the gateway specification due to the CPU and memory capacities. For more information, see Specifications of different types of Alibaba Cloud CSG gateways.

Mount an NFS file system to a client

1.Open the command line tool in the client and run the following command:

mount.nfs x.x.x.x:/share name local-directory

x.x.x.x:/shares: The IP address of the gateway and the share name. local-directory: The local directory in the client. The directory can have any read and write permissions. You cannot specify a directory that does exist. After the local directory is mounted, run the df -h command to view system disk information. The information shows that the local directory has been mounted to the share.

5-30

2.Version 1.0.35 and earlier do not allow you to mount local directories to shares through NFSv3. You must run the showmount –e command to obtain the path for mounting the local directory:

mount -t nfs -o vers=3,proto=tcp,nolock,noacl,sync x.x.x.x:/shares local-directory

x.x.x.x:/shares: The IP address of the gateway and the share name. You can run the showmount command to obtain this information.

After the local directory is mounted, run the df -h command to view disk information. The information shows that the local directory has been mounted to the share.

23

Note: After the local directory is mounted to the share, the file system capacity equals the OSS bucket capacity. The displayed capacity 256 TB is the maximum capacity of the file system. Currently, capacities of OSS buckets are unlimited.

2.Access the shared folder

After the local directory is mounted, you can read data from and write data to the mapped local directory. If you have granted write permissions to the host on the gateway, you can write data to the shared directory. If you have only granted read permissions to the host, you can only read files from the shared directory.

Shares are synchronized with the associated OSS buckets. Operations performed on local directories will be also performed on the associated OSS buckets.