Help Center/ Scalable File Service Turbo/ User Guide/ File System Management/ Mounting an SFS Turbo File System/ Mounting a Subdirectory of an NFS File System to Linux ECSs
Updated on 2024-12-23 GMT+08:00

Mounting a Subdirectory of an NFS File System to Linux ECSs

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

Prerequisites

You have mounted the file system to a Linux ECS by referring to Mounting an NFS File System to Linux ECSs as Root.

Procedure

  1. Create a subdirectory in the local path.

    mkdir <Local path>/<Subdirectory>

    Variable Local path is an ECS local directory where the file system is mounted, for example, /local_path. Specify the local path used to mount the root directory.

  2. Mount the subdirectory to the ECSs that are in the same VPC as the file system. You can mount the file system to Linux ECSs using NFSv3 only.

    mount -t nfs -o vers=3,timeo=600,noresvport,nolock,tcp <File system domain name or IP address>:/<Subdirectory> <Local path>

    • <File system domain name or IP address> : You can obtain it from the file system list or details page on the console.
      • SFS Turbo: <xx.xx.xx.xx>:/<Subdirectory>
    • <Subdirectory> is the subdirectory created in the previous step.
    • <Local path> is an ECS local directory where the file system is mounted, for example, /local_path. Specify the local path used to mount the root directory.

  3. View the mounted file system.

    mount -l

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

    <Shared path> on </local_path> type nfs (rw,vers=3,timeo=600,nolock,addr=)

  4. Check that you can access the subdirectory on the ECSs to read or write data.

Troubleshooting

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

Figure 1 Mounting without a subdirectory

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

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

Figure 2 Mounting a subdirectory