Quick start (Linux)

CFS

  • Updates and Announcements
    • Function Release Records
    • Product Announcement
      • Announcement on CFS Metric Adjustments
  • Product Description
    • Product Introduction
    • Basic concepts
    • Product features
    • Product specifications
    • Usage Limits and Recommendations
    • Selection Guide
      • How to Choose Between CFS and PFS
      • How to Choose Between CFS, BOS and CDS
    • Application scenarios
  • Product pricing
    • Pay-as-you-go
    • Storage package billing
    • Insufficient balance reminders and debt handling
    • Billing Cases
  • Quick Start
    • Getting Started Overview
    • Quick start (Linux)
    • Quick start (Windows)
  • Operation guide
    • Activate Service
    • Manage File System
      • Create file system
      • Delete a file system
      • View file system details
      • Set File System Capacity Upper Limit
    • Mount and Access
      • Add mount target
      • Mount and Unmount CFS on BCC
        • Mount and Unmount on Linux System
          • Mount and Unmount SMB Protocol CFS on Single BCC
          • Batch mounting and unmounting NFS CFS on multiple BCC
          • Mounting and unmounting NFS CFS on a single BCC
        • Mount and Unmount SMB Protocol CFS on Windows System
        • Mount CFS File System When Purchasing New BCC
      • Using CFS in CCE
    • Permission Group Management
    • Identity and access management
    • Data encryption
    • Management Tags
    • Backup
    • Monitor and Alarm
      • View monitoring
      • Alarm management
      • Metric definition
    • Cloud Audit
  • Typical Practices
    • Set Different User Permissions for Different Directories
    • Using File Systems Across Regions Or Accounts
    • Use SFTP to Upload and Download CFS File System Data
    • Use Rsync to Sync From Old File System to CFS File System
    • Best Practices for Managing CFS with Terraform
    • Performance Testing Methods
      • Linux System Performance Testing Methods
      • Windows System Performance Testing Methods
  • API Reference
    • API Function Update Records
    • API Overview
    • Interface Overview
    • General Description
    • Service domain
    • Error code
    • File System Related Interfaces
      • Create file system
      • Update file system
      • Query file system
      • Query mount client
      • Drop file system
      • Update file system tags
    • mount target Related Interfaces
      • Create mount target
      • Query mount targets
      • Delete mount target
    • Permission Group-related APIs
      • Create Permission Group
      • Update permission group
      • Query Permission Groups
      • Delete permission group
      • Create permission group rules
      • Update permission group rules
      • Query permission group rules
      • Delete permission group rule
    • Data type
  • Go-SDK
    • Overview
    • Initialization
    • File system
    • Mount target
    • Error handling
  • FAQs
    • Common Questions Overview
    • General Problems
    • Billing Problems
    • NFS protocol questions
    • SMB Protocol Issues
  • Service Level Agreement (SLA)
    • CFS Service Level Agreement (SLA)
All documents
menu
No results found, please re-enter

CFS

  • Updates and Announcements
    • Function Release Records
    • Product Announcement
      • Announcement on CFS Metric Adjustments
  • Product Description
    • Product Introduction
    • Basic concepts
    • Product features
    • Product specifications
    • Usage Limits and Recommendations
    • Selection Guide
      • How to Choose Between CFS and PFS
      • How to Choose Between CFS, BOS and CDS
    • Application scenarios
  • Product pricing
    • Pay-as-you-go
    • Storage package billing
    • Insufficient balance reminders and debt handling
    • Billing Cases
  • Quick Start
    • Getting Started Overview
    • Quick start (Linux)
    • Quick start (Windows)
  • Operation guide
    • Activate Service
    • Manage File System
      • Create file system
      • Delete a file system
      • View file system details
      • Set File System Capacity Upper Limit
    • Mount and Access
      • Add mount target
      • Mount and Unmount CFS on BCC
        • Mount and Unmount on Linux System
          • Mount and Unmount SMB Protocol CFS on Single BCC
          • Batch mounting and unmounting NFS CFS on multiple BCC
          • Mounting and unmounting NFS CFS on a single BCC
        • Mount and Unmount SMB Protocol CFS on Windows System
        • Mount CFS File System When Purchasing New BCC
      • Using CFS in CCE
    • Permission Group Management
    • Identity and access management
    • Data encryption
    • Management Tags
    • Backup
    • Monitor and Alarm
      • View monitoring
      • Alarm management
      • Metric definition
    • Cloud Audit
  • Typical Practices
    • Set Different User Permissions for Different Directories
    • Using File Systems Across Regions Or Accounts
    • Use SFTP to Upload and Download CFS File System Data
    • Use Rsync to Sync From Old File System to CFS File System
    • Best Practices for Managing CFS with Terraform
    • Performance Testing Methods
      • Linux System Performance Testing Methods
      • Windows System Performance Testing Methods
  • API Reference
    • API Function Update Records
    • API Overview
    • Interface Overview
    • General Description
    • Service domain
    • Error code
    • File System Related Interfaces
      • Create file system
      • Update file system
      • Query file system
      • Query mount client
      • Drop file system
      • Update file system tags
    • mount target Related Interfaces
      • Create mount target
      • Query mount targets
      • Delete mount target
    • Permission Group-related APIs
      • Create Permission Group
      • Update permission group
      • Query Permission Groups
      • Delete permission group
      • Create permission group rules
      • Update permission group rules
      • Query permission group rules
      • Delete permission group rule
    • Data type
  • Go-SDK
    • Overview
    • Initialization
    • File system
    • Mount target
    • Error handling
  • FAQs
    • Common Questions Overview
    • General Problems
    • Billing Problems
    • NFS protocol questions
    • SMB Protocol Issues
  • Service Level Agreement (SLA)
    • CFS Service Level Agreement (SLA)
  • Document center
  • arrow
  • CFS
  • arrow
  • Quick Start
  • arrow
  • Quick start (Linux)
Table of contents on this page
  • Prerequisites
  • Mounting steps
  • Step 1: Create a CFS file system
  • Step 2: Create mount target
  • Step 3: Mount CFS file system
  • Step 4: Verify the mount
  • Unmounting steps

Quick start (Linux)

Updated at:2025-11-11

This guide explains how to create an NFS file system in the CFS console and mount it to a Baidu Cloud Compute (BCC) instance (Linux) for data reading and writing.

Prerequisites

  1. The Cloud File System (CFS) service has been activated. When signing into the Cloud File System (CFS) console for the first time, you need to activate the CFS service as guided on the page.
  2. The target BCC instance has been created for mounting the CFS file system. For BCC creation methods, refer to: Quick Configuration of Linux Cloud Servers.

Mounting steps

Step 1: Create a CFS file system

  1. Click "Create File System" in the CFS console.
  2. On the Create File System panel, fill in details such as the file system name, availability zone, protocol type, and storage class. For detailed parameter descriptions, refer to Create File System.

Description:

①For optimal performance, it is recommended to deploy CFS file systems in the same availability zone as BCC instances

②This document selects the NFS, indicating that BCC instances running Linux OS will mount and access the CFS file system via NFS

image.png

  1. Click "OK" and follow the on-screen instructions to complete the creation of the CFS file system.

Step 2: Create mount target

  1. Click the File System Name in CFS console to access the Basic Information page
  2. Click Add Mount Target, and select the subnet and permission group in the pop-up page. For more permission group details, refer to Permission Group Management
  1. Click "Confirm" to view the mount target information. Make sure to record the domain name of the mount target (cfs-***.baidubce.com) for future mounting operations.

image.png

Step 3: Mount CFS file system

  1. Sign in to the target BCC instance in the BCC console. This document uses VNC for login. For other login methods, refer to Baidu Cloud Compute (BCC) Login Methods.
  2. Install the NFS client on the target BCC instance. Ensure all commands are run with root permissions.
  • For CentOS/RHEL OS, run the following command:
Bash
1yum install nfs-utils
  • For Ubuntu/Debian OS, run the following command:
Bash
1apt-get install nfs-common
  1. Execute the following mount command in the target BCC instance
Bash
1mount -t nfs4 -o minorversion=1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport <Domain name of a mount target>:/ <client local path>

Description:

  • can be found in the file system’s mount target list (see Step 2);
  • Path of the CFS file system: By default, it is the root directory of CFS (e.g., /). You can modify it to an existing subdirectory (e.g., /dir0);
  • refers to the local path on the client where the mounting will occur. It must be an absolute path beginning with / (e.g., /mnt/cfs), and this path needs to be created in advance.

Example:

Bash
1mount -t nfs4 -o minorversion=1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport cfs-***.baidubce.com:/ /mnt/cfs

Step 4: Verify the mount

  1. Check if the mount is successful using the following command:
Bash
1df -h

If the following information is returned, it indicates the mount is successful

4.png

  1. Once mounted successfully, the CFS file system can be accessed and used like a regular local directory on the BCC.

Unmounting steps

  1. Sign in to the Baidu Cloud Compute (BCC) where the CFS file system is mounted.
  2. Use the "umount" command to detach the file system.
Bash
1umount <target path>
2 ## Among them, <target path> refers to the local path of the CFS file system to be unmounted
  1. Execute the mount -l command to check the unmounting result. If the mounted CFS file system information is not found in the echo, it means the file system's mount directory has been successfully unmounted.

Previous
Getting Started Overview
Next
Quick start (Windows)