Help Center/ Scalable File Service/ User Guide (Paris Region) / Other Operations/ Mounting a Subdirectory of an NFS File System to ECSs (Linux)
Updated on 2024-03-21 GMT+08:00

Mounting a Subdirectory of an NFS File System to ECSs (Linux)

This section describes how to mount a subdirectory of an NFS file system to Linux ECSs.

Prerequisites

You have mounted a file system to Linux ECSs by referring to Mounting an NFS File System to ECSs (Linux).

Procedure

  1. Run the following command to create a subdirectory in the local path:

    mkdir Local path/Subdirectory

    Variable Local path is an ECS local directory where the file system will be mounted on, for example, /local_path. Specify the local path used for mounting the root directory.

  2. Run the following command to mount the subdirectory to the ECSs that are in the same VPC as the file system: (Currently, the file system can be mounted to Linux ECSs using NFS v3 only.)

    mount -t nfs -o vers=3,timeo=600,noresvport,nolock Domain name or IP address of the file system:/Subdirectory Local path

    • Domain name or IP address of the file system: You can obtain it in the file system list from the console.
      • SFS Capacity-Oriented: example.com:/share-xxx/subdirectory
      • SFS Turbo: xx.xx.xx.xx:/subdirectory
    • Subdirectory: Specify the subdirectory created in the previous step.
    • Local path: An ECS local directory where the file system is mounted, for example, /local_path. Specify the local path used for mounting the root directory.

  3. Run the following command to view the mounted file system:

    mount -l

    If the command output contains the following information, the file system has been mounted.

    Mount point on /local_path type nfs (rw,vers=3,timeo=600,nolock,addr=)

  4. After the subdirectory has been mounted, you can access it from the server, and read or write data.

Troubleshooting

If a subdirectory is not created before mounting, the mounting will fail.

Figure 1 Mounting without a subdirectory created

In the preceding figure, the root directory does not have the subdir subdirectory created so that the mounting fails. In this case, error message "Permission denied" is reported.

To troubleshoot this issue, mount the root directory, create a subdirectory, and then mount the subdirectory.

Figure 2 Mounting subdirectory