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
Situation Awareness
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
On this page

Creating a Local Directory for a File System

Updated on 2023-05-10 GMT+08:00

After creating a file system, you need to mount the file system to an ECS and create a local directory for the root user.

If the file system has been mounted, skip this section. Record the local directory in 4 and perform steps in Creating a Readable and Writable Subdirectory on the File System for Each User.

Prerequisites

  • You have checked the type of the ECS operating system. Different operating systems require different commands for NFS client installation.
  • You have created a file system and have obtained the mount point of the file system.
  • The ECS to which a file system is mounted belongs to the same VPC as the file system.
  • The IP addresses of the DNS server used to resolve the file system domain name have been configured on the ECS.

Procedure

  1. Create an ECS running CentOS in AZ2 of the CN North-Beijing1 region, for example, ecs-whm. See Figure 1.

    Figure 1 Creating an ECS

  2. Log in to the ECS as user root. Install the NFS client.

    1. Run the following command to check whether the NFS software package is installed.
      • On CentOS, Red Hat, Oracle Enterprise Linux, SUSE, Euler OS, Fedora, or OpenSUSE:

        rpm -qa|grep nfs

      • On Debian or Ubuntu:

        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 Step 3. If nothing is displayed, go to Step 2.2.
      • On CentOS, Red Hat, Euler OS, Fedora, or Oracle Enterprise Linux:
        libnfsidmap
        nfs-utils
      • On SUSE or OpenSUSE:
        nfsidmap
        nfs-client
      • On Debian or Ubuntu:
        nfs-common
    2. Run the following command to install the NFS software package.
      NOTE:

      The following commands require that the ECS be connected to the Internet. Otherwise, the installation will fail.

      • On CentOS, Red Hat, Euler OS, Fedora, or Oracle Enterprise Linux:

        sudo yum -y install nfs-utils

      • On Debian or Ubuntu:

        sudo apt-get install nfs-common

      • On SUSE or OpenSUSE:

        zypper install nfs-client

  3. Run the following command to check whether the domain name in the file system mount point can be resolved. See Figure 2.

    nslookup File system domain name

    nslookup sfs-nas1.xx-xxxx-xx.xxxxxxxxxxx.com
    NOTE:
    • A file system domain name is just a part of the mount point, for example, sfs-nas1.xxxx.com. You can obtain a file system domain name from the mount point of a file system. In this step, you are not supposed to enter the entire mount point but only the domain name.
    • If the nslookup command cannot be used, install the bind-utils software package by running the yum install bind-utils command.
    • If the resolution succeeds, go to 4.
    • If the domain name cannot be resolved, configure the DNS server IP address and then mount the file system. For details, see Configuring DNS.
    Figure 2 Domain name resolution

  4. Run the following command to create a local directory for mounting the file system. Record the local directory name, for example, root001.

    mkdir Local directory

    mkdir root001

  5. Run the following command to mount the file system to the ECS. SFS supports mounting only file systems complying with NFSv3 to ECSs running Linux. Table 1 describes the variables.

    mount -t nfs -o vers=3,timeo=600,nolock Mount point Local directory

    NOTICE:

    After an ECS that has mounted file systems restarts, it loses the file system mount information. You can configure automatic mount in the fstab file to ensure that an ECS automatically mounts file systems when it restarts. For details, see Mounting a File System Automatically.

    Table 1 Parameters

    Parameter

    Description

    vers

    File system version. Currently, only NFSv3 is supported, so the value is fixed to 3.

    timeo

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

    lock/nolock

    Whether to lock files on the server using the NLM protocol. If nolock is selected, the lock is valid for applications on one host. For applications on another host, the lock is invalid. Recommended value: nolock

    Mount point

    The format for an SFS file system is File system domain name:/Path, for example, example.com:/share-xxx. The format for an SFS Turbo file system is File system IP address:/, for example, 192.168.0.0:/.

    NOTE:

    x can be a digit or letter.

    If the mount point is too long to display completely, expand the column to view the full mount point.

    Local directory

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

    Figure 3 Mount point

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

    mount -l

    If the command output contains the following information, the file system is mounted successfully.
    example.com:/share-xxx on /local_path type nfs (rw,vers=3,timeo=600,nolock,addr=)

  7. After the mounting is successful, create a common user and subdirectory by referring to the next section.

    If the mounting fails or times out, rectify the fault. For details, see Troubleshooting.
    NOTE:

    The supported maximum size of a file to be written is 240 TB.

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