All Products
Search
Document Center

:Mount an NFS file system on RDS Custom

Last Updated:Jun 20, 2026

This topic describes how to mount a Network File System (NFS) file system on an RDS Custom instance. You can mount an NFS file system on multiple RDS Custom instances to enable the instances to share access to the file system.

Prerequisites

  • An RDS Custom instance is created. For more information, see Create an RDS Custom instance.

  • A Network Attached Storage (NAS) file system is created in the region in which the RDS Custom resides. In this topic, an Extreme NAS file system is created. For more information, see Create an Extreme NAS file system.

  • A mount target is created for the NAS file system, and the domain name of the mount target is obtained. The mount target must reside in the same virtual private cloud (VPC) as the RDS Custom instance. For more information, see Manage mount targets.

Procedure

  1. Connect to an RDS Custom instance For more information, see Connect to an RDS Custom instance.

  2. Install the NFS client.

    Before you mount an NFS file system on Linux, you must install an NFS client. You need to install the NFS client on each Linux server only once. You do no need to install the NFS client the next time you mount a file system on the Linux server.

    Operating system

    Installation command

    Alibaba Cloud Linux

    sudo yum install nfs-utils

    CentOS

    Redhat

    Ubuntu

    Run the following installation commands in sequence:

    sudo apt-get update
    sudo apt-get install nfs-common

    Debian

  3. Run the following command to mount the NAS file system:

    sudo mount -t nfs -o
    vers=3,noacl,nolock,proto=tcp,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,
    noresvport file-system-id.region.extreme.nas.aliyuncs.com:/share /mnt

    The following table describes the parameters in the mount command.

    Parameter

    Description

    file-system-id.region.extreme.nas.aliyuncs.com:/share /mnt

    The format is <Domain name of a mount target>:<Directory of the NAS file system> <Mount directory that resides on the current server>. You must configure the parameter based on your business requirements.

    • Domain name of a mount target: To view the domain name, perform the following steps: Log on to the NAS console. On the File System List page, find the file system that you want to manage and click Manage in the Actions column. On the Mount Targets tab, view the domain name of the mount target. For more information, see Manage mount targets.

    • Directory of the NAS file system: If you use an Extreme NAS file system, the directory must start with /share. Examples: /share and /share/subdir. If you specify a subdirectory, make sure that the subdirectory exists in the NAS file system.

    • Mount directory that resides on the current server: a subdirectory of the RDS Custom instance, such as /mnt. Make sure that the subdirectory exists.

      Note

      If you specify a mount directory that resides on the current server and contains data, the data becomes temporarily invisible after the file system is mounted. Only data in the file system is displayed in the mount directory. We recommend that you specify an empty directory.

    vers

    The protocol version of the file system.

    • vers=3: uses NFSv3 to mount the file system.

    • vers=4: uses NFSv4 to mount the file system.

      The minorversion option specifies the minor version. For example, NAS supports NFSv4.0, so you must set the minor version to 0 when you use the NFSv4 protocol.

    Note

    Extreme NAS file systems support only NFSv3.

    rsize

    • The size of data blocks that the client can read from the file system.

    • Recommended value: 1048576.

    wsize

    • The size of data blocks that the client can write to the file system.

    • Recommended value: 1048576.

    hard

    • If this parameter is disabled and NAS is unavailable, the client may immediately return an error without retrying, which may cause data inconsistency or loss.

    • We recommend that you enable this parameter.

    timeo

    • The period of time for which the NFS client waits before the client retries to send a request. Unit: deciseconds (tenths of a second).

    • Recommended value: 600 (60 seconds).

    retrans

    • The number of times that the NFS client retries to send a request.

    • Recommended value: 2.

    noresvport

    • Specifies that a new TCP port is used to ensure network connectivity between the file system and the Elastic Compute Service (ECS) instance when the network recovers from a failure.

    • We recommend that you enable this parameter.

  4. Run the following command to verify the mount result:

    mount -l

    The file system is mounted if the output includes a line containing your NAS mount target domain name and local path, for example, /mnt. The following is an example:

    systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=35,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=243)
    /dev/vda2 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=winnt,errors=remount-ro)
    sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)
    tracefs on /sys/kernel/debug/tracing type tracefs (rw,relatime)
    tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=12956188k,mode=700)
    01e3xxx.extreme.nas.aliyuncs.com:/share on /mnt type nfs (rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,nolock,noacl,noresvport,proto=tcp,timeo=600,retrans=2,tvers=3,mountport=2049,mountproto=tcp,local_lock=all,addr=172.xxx.xxx.xxx)

    After mounting the file system, run the df -h command to view the capacity of the file system.

    [root@rc-m6d4xxx_yo3b2 ~]# df -h
    Filesystem                                    Size  Used Avail Use% Mounted on
    devtmpfs                                       62G     0   62G   0% /dev
    tmpfs                                          62G     0   62G   0% /dev/shm
    tmpfs                                          62G  548K   62G   1% /run
    tmpfs                                          62G     0   62G   0% /sys/fs/cgroup
    /dev/vda3                                      40G  4.0G   34G  11% /
    /dev/vda2                                     200M  5.8M  195M   3% /boot/efi
    tmpfs                                          13G     0   13G   0% /run/user/0
    01e3xxx_xxxng.extreme.nas.aliyuncs.com:/share   99G  134M   99G   1% /mnt
  5. After the NAS file system is mounted, read data from and write data to the NAS file system on the ECS instance running Linux.

    You can use the NAS file system as if it were a local directory.

    [root@rc-m6d48r6xxx ~]# cd /mnt/
    [root@rc-m6d48r6xxx mnt]# touch testtxt
    [root@rc-m6d48r6xxx mnt]# ll
    total 0
    -rw-r-----  1 root root 0 Mar  5 13:33 testtxt

Related documents

RDS Custom overview