Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Mounting an SFS Turbo File System to Linux ECSs

Updated on 2025-01-10 GMT+08:00

After creating a file system, you need to mount it to cloud servers so that they can share the file system. This section describes how to mount a file system to ECSs.

NOTE:
  • The operations of mounting a file system to BMSs and containers on CCE are the same as those of ECSs. To mount a file system to CCE, see Storage or Storage (FlexVolume). Then complete the deployment on the CCE console.
  • The mount operation may vary depending on the server OS. Perform the mount operation based on your server OS.

Notes and Constraints

NOTE:

The constraints only apply to local paths (mount points) and do not affect other files or directories.

  • SFS Turbo file systems cannot be mounted to Windows ECSs.
  • The atime, ctime, and mtime attributes of a local path (root directory of the mount point) are the current time of the file system server. Each time a root directory attribute is queried, the current time of the server is returned.
  • Metadata of the local paths (mount points) cannot be modified. Specifically, the following operations cannot be performed on the local paths' metadata:

    - touch: Update file access time and modification time.

    - rm: Delete files or directories.

    - cp: Replicate files or directories.

    - mv: Move files or directories.

    - rename: Rename files or directories.

    - chmod: Modify permissions on files or directories.

    - chown: Change the owners of files or directories.

    - chgrp: Change the group of a file or directory.

    - ln: Create hard links.

    - link: Create hard links.

    - unlink: Delete hard links.

Prerequisites

  • You have checked the type of the OS on each ECS. Different OSs require different commands to install the NFS client.
  • You have created an SFS Turbo file system and obtained its shared path from the file system list.
  • At least an ECS that is in the same VPC as the file system is available.
  • The IP address of the DNS server for resolving the SFS Turbo file system domain name has been configured on the ECSs. For details, see Binding an EIP.

Mounting an SFS Turbo File System

  1. Log in to the ECS console.

    1. Log in to the console and select a region and a project.
    2. Choose Compute > Elastic Cloud Server to go to the ECS console.

  2. Log in to the ECS as user root. You can log in using the console or a remote access tool (such as PuTTY).

  3. Install the NFS client.

    1. Check whether the NFS software package is installed.
      • On CentOS, Red Hat, Oracle Enterprise Linux, SUSE, EulerOS, Fedora, or OpenSUSE, run the following command:
        rpm -qa|grep nfs
      • On Debian or Ubuntu, run the following command:
        dpkg -l nfs-common

      If a command output similar to the following is displayed, the NFS software package has been installed and you can go to 4. If no such command output is displayed, execute the installation command.
      • On CentOS, Red Hat, EulerOS, Fedora, or Oracle Enterprise Linux, the command output is as follows:
        libnfsidmap
        nfs-utils
      • On SUSE or OpenSUSE, the command output is as follows:
        nfsidmap
        nfs-client
      • On Debian or Ubuntu, the command output is as follows:
        nfs-common
    2. Install the NFS software package.
      NOTE:

      The following commands require that the ECSs be connected to the Internet. Or, the installation will fail.

      • On CentOS, Red Hat, EulerOS, Fedora, or Oracle Enterprise Linux, run the following command:
        sudo yum -y install nfs-utils
      • On Debian or Ubuntu, run the following command:
        sudo apt-get install nfs-common
      • On SUSE or OpenSUSE, run the following command:
        zypper install nfs-client

  4. If the shared path consists of the file system domain name, run the following command to check whether the domain name can be resolved:

    nslookup <File system domain name>
    NOTE:
    • The file system domain name is in the format of xxx.sfsturbo.internal (variable xxx is the file system ID). You can obtain the domain name from the shared path in the file system list.
    • If the nslookup command cannot be used, you can run yum install bind-utils to install the bind-utils software package.

  5. Mount the NFS file system.

    • To mount the file system root directory, run the following commands:
    mkdir <Local path>
    mount -t nfs -o vers=3,timeo=600,noresvport,nolock,tcp <Shared path> <Local path>
    • To mount a file system subdirectory, run the following commands:
    mkdir <Local path>/<Subdirectory>
    mount -t nfs -o vers=3,timeo=600,noresvport,nolock,tcp <File system domain name or IP address>:/<Subdirectory> <Local path>
    NOTE:
    • You can obtain the domain name or IP address from the shared path in the file system list.
    • If any other resources, such as a disk, have been mounted on the desired local path, create a new path. (NFS clients do not refuse repeated mounts. If there are repeated mounts, information of the last successful mount is displayed.)
    • A file system can only be mounted to the ECSs that are in the same VPC as the file system.
    Table 1 describes the mount command variables.
    Table 1 Mount command variables

    Parameter

    Description

    <Local path>

    A local directory on the ECS used to mount the file system, for example, /local_path.

    <Shared path>

    For an SFS Turbo Standard-Enhanced, Standard, Performance-Enhanced, or Performance file system, the format is File system IP address:/, for example, 192.168.0.0:/.

    For an SFS Turbo 20 MB/s/TiB, 40 MB/s/TiB, 125 MB/s/TiB, 250 MB/s/TiB, 500 MB/s/TiB, 1,000 MB/s/TiB, or HPC Cache file system, the format is File System domain name:/, for example, xxx.sfsturbo.internal:/.

    Figure 1 shows an example.

    NOTE:
    • Variable x is a digit or letter.
    • If the shared path is too long to display completely, you can adjust the column width.

    vers

    File system version. Only NFSv3 is supported currently, so the value is fixed to 3.

    timeo

    Waiting time before the NFS client retransmits a request. The unit is 0.1 second. The recommended value is 600.

    noresvport

    Whether the NFS client uses a new TCP port when it re-establishes a network connection to the NFS server.

    It is strongly recommended that you specify noresvport, which ensures that your file system remains uninterrupted after a network reconnection or recovery.

    lock/nolock

    Whether to use the NLM protocol to lock files on the server. If nolock is specified, the lock is valid only for applications on the same client. It is invalid for applications on any other clients. nolock is recommended. If this parameter is not specified, lock is used. Then, other clients cannot write data to the file system.

    tcp/udp

    Protocol used by the NFS client to send requests to the server. You can use either UDP or TCP.

    General Purpose File System does not support UDP. Therefore, you need to specify tcp for general purpose file systems.

    Figure 1 Shared Path

    When mounting the file system, you can add performance optimization options described in Table 2. Use commas (,) to separate them. A command example is provided as follows:

    mount -t nfs -o vers=3,timeo=600,nolock,rsize=1048576,wsize=1048576,hard,retrans=3,tcp,noresvport,ro,async,noatime,nodiratime <Shared path> <Local path>
    Table 2 Performance optimization options

    Option

    Description

    rsize

    Maximum number of bytes in each read request that the client can receive when reading data from a file on the server. The actual data size is less than or equal to this parameter setting. The value of rsize must be a positive integral multiple of 1024. Specified values less than 1024 are automatically replaced with 4096, and values greater than 1048576 are automatically replaced with 1048576. By default, this parameter is set through a negotiation between the server and the client.

    You are advised to set this parameter to the maximum value 1048576.

    wsize

    Maximum number of bytes in each write request that the client can send when writing data to a file on the server. The actual data size is less than or equal to this parameter setting. The value of wsize must be a positive integral multiple of 1024. Specified values less than 1024 are automatically replaced with 4096, and values greater than 1048576 are automatically replaced with 1048576. By default, this parameter is set through a negotiation between the server and the client.

    You are advised to set this parameter to the maximum value 1048576.

    soft/hard

    soft indicates soft mounts. With soft specified, if an NFS request times out, the client returns an error to the calling program. hard indicates hard mounts. With hard specified, if an NFS request times out, the client continues to request until the request is successful.

    The default value is hard.

    retrans

    Number of retransmission times before the client returns an error. The recommended value is 1.

    tcp/udp

    If mountproto is not specified, the client will mount the file system using UDP first. If the UDP network cannot be connected, the client will mount the file system using TCP after freezing for several seconds.

    The security group of the file system does not allow inbound traffic over the UDP port, so you need to specify mountproto=tcp.

    ro/rw

    • ro indicates that the file system is mounted as read-only.
    • rw indicates that the file system is mounted as read/write.

    The default value is rw. If neither ro nor rw is specified, the file system will be mounted as read/write.

    noresvport

    Whether the NFS client uses a new TCP port when it re-establishes a network connection to the NFS server.

    It is strongly recommended that you specify noresvport, which ensures that your file system remains uninterrupted after a network reconnection or recovery.

    sync/async

    sync indicates that data is written to the server immediately. async indicates that data is first written to the cache and then to the server.

    async is recommended. Synchronous writes require that an NFS server returns a success message after all data is written to the server, which brings long latency.

    noatime

    If you do not need to record the file access time, set this parameter. This prevents overheads caused by frequent access to modify the time.

    nodiratime

    If you do not need to record the directory access time, set this parameter. This prevents overheads caused by frequent access to modify the time.

    NOTE:

    You are advised to use the default values for the parameters with no recommendations provided.

  6. View the mounted file system.

    mount -l
    If the command output contains the following information, the file system has been mounted. You can access the file system to read or write data from the ECS.
    <Shared path> on </local_path> type nfs (rw,vers=3,timeo=600,nolock,addr=)
    NOTE:

    The maximum size of a file that can be written to an SFS Turbo file system is 32 TB, and that for an SFS Turbo Enhanced file system is 320 TB.

  1. (Optional) Configure the fstab file to configure file system auto mount upon system startup.

    After a client ECS is restarted, it loses the file system mount information. You can configure auto mount in the fstab file to ensure that the ECS automatically mounts the file system when it restarts.

    1. Open the /etc/fstab file.
    vi /etc/fstab
    At the end of the file, add the file system information, for example:
    <Shared path> </local_path> nfs vers=3,timeo=600,noresvport,nolock,tcp 0 0

    Replace <Shared path> and </local_path> with actual values. You can obtain the shared path on the file system details page. Each record in the /etc/fstab file represents a mount. Each record has six fields, as described in Table 3.

    Table 3 Mount fields

    Field

    Description

    <Shared path>

    The address of the file system to be mounted. Set it to the shared path in the mount command in 5.

    </local_path>

    A directory created on the ECS for mounting the file system. Set it to the local path in the mount command in 5.

    nfs

    The file system or partition mount type. Set it to nfs.

    vers=3,timeo=600,noresvport,nolock,tcp

    Mount options. Use commas (,) to separate multiple options.

    • vers: The file system version. Value 3 indicates NFSv3.
    • timeo: The waiting time before the NFS client retransmits a request. The unit is 0.1 second. The recommended value is 600.
    • noresvport: Whether the NFS client uses a new TCP port when it re-establishes a network connection to the NFS server. It is strongly recommended that you specify noresvport, which ensures that your file system remains uninterrupted after a network reconnection or recovery.
    • nolock: Whether to use the NLM protocol to lock files on the server. If nolock is specified, the lock is valid only for applications on the same client. It is invalid for applications on any other clients. nolock is recommended. If this parameter is not specified, lock is used. Then, other clients cannot write data to the file system.
    • tcp: The TCP transmission protocol.

    0

    Choose whether to use dump to back up the file system.

    • 0: Dump backup is not used.
    • An integer greater than zero means that the file system is backed up. A smaller value has a higher priority.

    0

    Choose whether to use fsck to check file systems when the ECS is starting and specify the sequence for checking file systems.

    • 0: File systems are not checked.
    • By default, this field is set to 1 for the root directory. The values for other directories start from 2, and one with a smaller integer is checked earlier than one with a larger integer.
    NOTICE:

    For optimal system performance, configure file system information based on the mount example provided. If needed, you can customize certain mount options. Note that the customization may affect system performance.

    1. Press Esc, enter :wq, and press Enter to save and exit.
    1. (Optional) View the updated content of the /etc/fstab file.
    cat /etc/fstab
    Figure 2 Updated file content
    NOTE:
    If auto mount fails due to a network issue, add the sleep option and a time in front of the mount command in the rc.local file, and mount the file system after the NFS service is started.
    sleep 10s && sudo mount -t nfs -o vers=3,timeo=600,noresvport,nolock,tcp <Shared path> </local_path>

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback