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

Mounting a Parallel File System

Updated on 2025-02-05 GMT+08:00

To use obsfs to manage your objects in OBS, you need to mount an OBS parallel file system locally. After the parallel file system is mounted, working on the mount directory is working on the parallel file system. For example, you can upload an object to OBS simply by saving it to the mount directory.

NOTE:

Traffic consumed by parallel file systems after they are mounted to ECSs through obsfs is measured as OBS traffic.

Constraints

  • obsfs can be used to mount parallel file systems but not OBS buckets.
  • The local directory that the parallel file system will be mounted to does not need to be empty, but any files in that directory will become unavailable after the parallel file system is mounted to that directory. However, they will still be there when the parallel file system is unmounted later. To avoid any confusion this might cause, mount your parallel file system to an empty directory.
  • Files or folders in the mount directory do not support hard links.
  • There can be no more than 45 directory levels.
  • If a parallel file system is manually mounted by running a command, it needs to be mounted again every time the Linux is restarted.
  • The actual size and used space of a parallel file system vary with your actual usage.
    NOTE:

    You can configure auto mounting of a parallel file system upon startup. For details, see Mounting a Parallel File System Automatically upon Startup.

  • A parallel file system can be mounted to multiple cloud servers, but you need to prevent multiple servers from concurrently writing to the same file.
  • If obsfs is used to mount a parallel file system, policies and IAM policies configured for the parallel file system take effect, but those configured for directories do not take effect.

Prerequisites

  • You have obtained obsfs by referring to Downloading and Installing obsfs.
  • obsfs has been initialized by referring to Initializing obsfs.
  • There is a mount directory in the local file system.
    NOTE:

    You can run the mkdir command to create a directory for mounting a parallel file system. For example, to create a directory named mountpoint, the command is:

    mkdir mountpoint
  • The system time has been calibrated.
    NOTE:

    If there is a huge time offset between the system and the storage server, the request authentication will fail.

Mounting a Parallel File System Manually

  1. Open the CLI.
  2. Run the cd command to go to the directory where obsfs is located.
  3. Run the mount command in the following format:

    ./obsfs Parallel file system name Local mount directory -o url=Region endpoint address -o passwd_file=Key file path -o big_writes -o max_write=131072 -o use_ino Mount parameters 
    • Parallel file system name: name of the parallel file system you want to mount.
      NOTE:

      A specific directory in a parallel file system can be mounted locally. If you mount just a directory, you can access only this directory in the parallel file system after entering the local mount directory. The mount command is as follows:

      ./obsfs Parallel file system name:/Directory name Local mount directory -o url=Region endpoint address -o passwd_file=Key file path -o big_writes -o max_write=131072 -o use_ino Mount parameters

    • Local mount directory: the absolute or relative path of the directory on which a parallel file system is to be mounted.
    • Region endpoint address: Obtain the endpoint address according to the region where the mounted parallel file system resides. For details, see Regions and Endpoints.
    • Mount parameters:

      Mount parameters, excepting passwd_file and use_ino, are optional. Select proper parameters according to your actual needs. The format is as follows: -o Parameter=Value. If you do not need to specify a parameter value, use only -o Parameter. Table 1 lists OBS mount parameters and their descriptions.

      NOTE:

      For details about obsfs mount parameter configurations, run the ./obsfs --help command to learn more.

      Table 1 obsfs mount parameters

      Parameter

      Value

      Description

      passwd_file

      Type: String

      Value: Set this parameter to the path of the access key file configured in Initializing obsfs.

      The access key file contains the AK and SK information required for accessing obsfs.

      use_ino

      Required

      If this parameter is specified, obsfs allocates the inode number.

      big_writes

      Not required

      After the configuration, the maximum size of the cache can be modified.

      max_write

      Type: Integer

      Recommended value: 128 KB

      This parameter is valid only when big_writes is configured. The default write size is 4 KB. The recommended value is 128 KB.

      nonempty

      Not required

      This parameter allows the mount point to be a non-empty directory.

      allow_other

      Not required

      This parameter allows other users to access the parallel file system.

      max_background

      Type: Integer

      Recommended value: 100

      You can use this parameter to set the maximum number of waiting requests in the background.

      use_path_request_style

      Not required

      Indicates the path-based access (legacy API). If this parameter is configured, you need to use the specified endpoint address to access OBS.

      NOTE:

      If the value of the URL in the command is an IP address, this parameter must be carried in the mount command. Otherwise, a domain name resolution error is reported.

      umask

      Not required

      It controls what permissions are not given to all files in the parallel file system.

      NOTE:

      Below gives an example:

      -o umask=xxx
      If umask is set to 777, the permissions for all files in the parallel file system is 000.
      If umask is set to 000, the permissions for all files in the parallel file system is 777.
      If umask is set to 002, the permissions for all files in the parallel file system is 775.

      obsfslog

      Not required

      This parameter enables the loading of log configuration parameters from the configuration file, including the log mode and level. You can change the log level without restarting the process when this parameter is enabled.

      NOTE:

      The path of the configuration file is: /etc/obsfsconfig. If you want to use this parameter, you need to manually create the configuration file path on the local host and write the content by referring to the following example and comments.

      An example of the configuration file content:

      //Log mode. The value 0 indicates that the log mode is displayed on the client. If the value is 1, the log file is generated in the following path: /var/log/obsfs, which is named after the process ID. If the value is 2, the log is written into the system log.
      dbglogmode=1
      //Log level. The value can be dbg, info, warn, err, or crit. If the log level is set to dbg or info, service details, such as the bucket name and file name, will be printed.
      dbglevel=info

  4. Run the following command to view the result:

    df -h

    If the information similar to the following is displayed, the parallel file system is successfully mounted:

    Filesystem       Size         Used       Avail      Use%      Mounted on
    obsfs            256T         0          256T       0%        /path/to/mountpoint
    NOTE:

    The actual size and used space of a parallel file system vary with your actual usage.

    If the preceding information is not displayed, the parallel file system fails to be mounted. In this case, you can add the following parameters to the command, so that the mount process and detailed debug logs are displayed in the command output:

    -d -d -f -o f2 -o curldbg

    Then you can locate the fault based on the error information. For details about troubleshooting of common faults, see Failures in Mounting a Parallel File System.

Command Example

In this example, the filesystem001 parallel file system and the access key file path /etc/passwd-obsfs in the CN-Hong Kong region are used as examples to describe how to mount an OBS parallel file system.

  • Mount the parallel file system filesystem001 to the mount point /mnt/mount_path/ and allow the directory to be non-empty.
    ./obsfs filesystem001 /mnt/mount_path/ -o url=obs.ap-southeast-1.myhuaweicloud.com -o passwd_file=/etc/passwd-obsfs -o big_writes -o max_write=131072 -o nonempty -o use_ino
  • Mount the parallel file system filesystem001 to the mount point /mnt/mount_path/ and set the write cache size.
    ./obsfs filesystem001 /mnt/mount_path/ -o url=obs.ap-southeast-1.myhuaweicloud.com -o passwd_file=/etc/passwd-obsfs -o big_writes -o max_write=131072 -o max_background=100 -o use_ino
  • Mount the filesystem001 parallel file system to the mount point /mnt/mount_path/ and allow other users to access the directory.
    ./obsfs filesystem001 /mnt/mount_path/ -o url=obs.ap-southeast-1.myhuaweicloud.com  -o passwd_file=/etc/passwd-obsfs -o big_writes -o max_write=131072 -o allow_other -o use_ino
NOTE:

If the value of the url in the command is an IP address, add the -o use_path_request_style parameter to the mount command. Otherwise, a domain name resolution error is reported.

Mounting a Parallel File System Automatically upon Startup

The following uses CentOS 7 as an example to describe how to configure the parallel file system to automount at startup.

  1. Log in to the Linux server as user root.
  2. Run the following command to create a /home/startobsfs.sh script:

    vi /home/startobsfs.sh

  3. Press i to enter the editing mode, and write the following comments and mount commands to the /home/startobsfs.sh script.

    #!/bin/bash
    cd Absolute path of obsfs
    ./obsfs Parallel file system name Local mount directory -o url=Region endpoint address -o passwd_file=Key file path -o big_writes -o max_write=131072 -o use_ino Mount parameters
    NOTE:

    For details about the mount command parameters, see 3 in section "Mounting a Parallel File System Manually."

  4. Press Esc and enter :wq to save and exit the script.
  5. Run the following command to grant the root user the permission to execute the script:

    chmod +x /home/startobsfs.sh

  6. Run the following command to grant the root user the permission to execute the rc.local file:

    chmod +x /etc/rc.d/rc.local
    NOTE:

    The location of the rc.local file varies depending on the OS. In CentOS 7, the file is stored in /etc/rc.d/rc.local.

  7. Add the following command to the end of /etc/rc.d/rc.local, save the file, and exit:

    bash /home/startobsfs.sh
    NOTE:

    If the /etc/rc.d/rc.local file contains an exit command, for example, exit 0, add the command prior to the exit command.

  8. Restart the server and verify the mounting.

    After the server is restarted, run the following command to check whether the parallel file system is successfully mounted:

    df -h
    NOTE:

    If you no longer want the parallel file system to automount at startup, delete the script from rc.local.

Follow-up Procedure

Before adding, modifying, or deleting any parameters for a mounted parallel file system, you need to unmount the parallel file system and then mount it again. For details about how to unmount a parallel file system, see Unmounting a Parallel File System.

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