Mounting and unmounting NFS CFS on a single BCC

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
  • Operation guide
  • arrow
  • Mount and Access
  • arrow
  • Mount and Unmount CFS on BCC
  • arrow
  • Mount and Unmount on Linux System
  • arrow
  • Mounting and unmounting NFS CFS on a single BCC
Table of contents on this page
  • Prerequisites
  • Mounting steps
  • Step I: Obtain domain name of a mount target
  • Step II: Install NFS client
  • Step III: Mount NFS protocol file system
  • Manually mount an NFS file system
  • Automatically mount a NFS file system
  • Step IV: View mounted NFS file systems
  • Unmounting steps

Mounting and unmounting NFS CFS on a single BCC

Updated at:2025-11-11

Once you’ve created a CFS NFS file system, you need to mount it on Baidu Cloud Compute (BCC) to allow shared access across multiple BCC instances. This guide explains how to mount a CFS NFS file system using a Linux BCC instance.

Prerequisites

  1. The target BCC instance (Linux) has been created for mounting the CFS file system. For BCC creation methods, refer to: Quick Configuration of Linux Cloud Servers.
  2. An NFS file system has been created with a mount target added. For detailed steps, refer to: Create File System, Add Mount Target.

Mounting steps

Step I: Obtain domain name of a mount target

Once the mount target has been created, you can start using the file system. Click the Manage button in the operation toolbar of the file system list to access the mount target information page, as demonstrated below:

image.png

After logging into the virtual machine or container, use the mount target’s domain name to perform file system operations.

Step II: Install NFS client

Most operating systems do not include an NFS client by default, so you will need to manually install the NFS client before mounting the file system.

Log in to Baidu Cloud Compute (BCC) and run the required commands to install the NFS client.

  • For CentOS/RHEL OS, run the following command:
Shell
1yum install nfs-utils
  • For Ubuntu/Debian OS, run the following command:
Shell
1apt-get install nfs-common

All the above commands require root privileges to execute.

Step III: Mount NFS protocol file system

Manually mount an NFS file system

It is recommended to use the following command to mount the file system (root permissions required):

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:

  • <Domain name of a mount target> can be found in the file system’s mount target list (see Step I);
  • 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);
  • <Client local path> refers to the client’s local path for mounting. It must be an absolute path beginning with / (e.g., /mnt/cfs) and must already exist prior to mounting.

Parameters in the command are explained in the table below (for more parameters, refer to NFS Document):

Option Description
minorversion This refers to the minor version number of the mount protocol. The value must be 1, indicating the use of the NFS 4.1 protocol.
rsize Set the maximum byte size of data that a client file read request can receive. If this value is set too small, it will result in decreased read throughput.
Recommended value: 1048576.
wsize Set the maximum byte size that a client file write request can send. If this value is set too small, it will result in decreased write throughput.
Recommended value: 1048576.
hard The client retry option offers two values: hard and soft, with hard being the default value if unspecified. Under the
hard option, the client will retry indefinitely before the server responds, ensuring data integrity. Under the soft option, the client will retry for a period before giving up and then return an error to the client. If this option is enabled, it is recommended to increase the timeo value to reduce the risk of data corruption.
Recommended value: hard.
timeo Time that the client waits for a response before retrying an NFS request, in deciseconds (0.1 s). The value should not be lower than 150, that is, 15 seconds.
Recommended value: 600.
retrans Count of client retry requests. Exceeding this count will trigger further recovery operations.
Recommended value: 2.
noresvport Options for use privileged port numbers: resvport and noresvport, with resvport being the default value.
resvport indicates using privileged ports (1-1023), noresvport indicates not using privileged ports (>1023). Non-privileged port numbers have a wider range, which can reduce service unavailability issues caused by port allocation problems.
Recommended value: noresvport.

Automatically mount a NFS file system

Manually mounted file systems will lose their mount information after a system reboot. To enable automatic mounting during system startup, follow the steps below.

Modify /etc/fstab and add the following content (root permission required):

Bash
1<Mount target address>:/ <client local path> nfs4 minorversion=1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,_netdev 0 0

Compared to manual mounting, automatic mounting includes an additional parameter _netdev. This parameter requires the OS to attempt mounting the file system only after the network is ready. If this parameter is not specified, the risk of mount failure will increase.

Step IV: View mounted NFS file systems

Use the following command to view mounted file systems:

Shell
1cat /proc/mounts

To view the file system capacity information, use the following command:

Shell
1df -h

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.
Shell
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
Batch mounting and unmounting NFS CFS on multiple BCC
Next
Mount and Unmount SMB Protocol CFS on Windows System