All Products
Search
Document Center

File Storage NAS:Mount a Alibaba Cloud NAS file system when you create an ECS instance

Last Updated:Dec 30, 2025

Learn how to mount a File Storage NAS (NAS) file system when you create an Elastic Compute Service (ECS) instance.

Prerequisites

Background information

The easiest way to mount a NAS file system is to configure it when you create a new Elastic Compute Service (ECS) instance. You can mount up to five NAS file systems during instance creation.

Limitations

  • Image: Automatic mounting is supported only on ECS instances that use an official Alibaba Cloud image. This feature is not supported for custom images created from snapshots.

  • Mount path: Only the root directory of a NAS file system can be mounted. Mounting subdirectories is not supported.

Note

If this configuration does not meet your requirements, manually mount the NAS file system after you create the ECS instance. For more information, see Mount a file system on an ECS instance.

Mount a single NAS file system

  1. Log on to the ECS console.

  2. Create an ECS instance. For more information, see Use the custom launch tab to create an instance.

    On the Custom Launch page, configure the following key parameters:

    • Region: Select the region where your NAS file system is located.

    • Network and Zone: Select the same Virtual Private Cloud (VPC), vSwitch, and Availability Zone as your NAS file system. For optimal performance, select the Availability Zone where your NAS file system resides.

    • Instance: Select an instance type based on your business requirements.

    • Image: Select an image based on your business requirements. For Linux, CentOS 7.6 is recommended. For Windows, Windows Server 2019 Datacenter is recommended.

    • Storage: In the NAS File System section, click Add File System and configure the parameters.

      image

      Label

      Parameter

      Description

      File System

      • For Linux images, you can select only file systems that use the Network File System (NFS) protocol.

      • For Windows images, you can select only file systems that use the Server Message Block (SMB) protocol.

      Mount Target

      • The mount target connects the ECS instance to the NAS file system. The mount target must be in the same VPC as the ECS instance.

      • If no mount targets are available, create one first. For more information, see Create a mount target.

      Mount Path

      The local path on the ECS instance for mounting the file system. For example, enter /mnt for a Linux instance or Z: for a Windows instance.

      Protocol Type

      • If you are mounting an NFS file system, select NFSv3 or NFSv4.0. Select NFSv3 for most use cases that do not require file locking.

      • If you are mounting an SMB file system, select SMB.

Mount multiple NAS file systems

To mount multiple NAS file systems on the new ECS instance, click Add File System again for each additional file system. Note the following:

  • Mount Target:

    • All mount targets must belong to the same Virtual Private Cloud (VPC).

    • If no mount targets are available in the selected VPC, you can create them. For more information, see Create a mount target.

  • Mount Path:

    • Each mount path must be unique.

    • For Linux images, mount paths can be nested. For example, you can use /mnt and /mnt/sub.

Note

If you need to mount more than five file systems, submit a ticket.

Verify the mount

After the ECS instance is created, the system automatically mounts the NAS file system. The system also automatically remounts the file system when the instance restarts. To verify the mount:

Linux instances

  1. Connect to the ECS instance.

  2. To view information about the mounted NAS file system, run the df -h command.Linux_ECSIn the output, Used shows the used capacity, and Size shows the maximum capacity of the file system. Billing is not based on the maximum capacity.

Note

The automatic mount configuration is saved in the /etc/fstab file. You can edit this file to change the mount path. For more information, see Mount an NFS file system on a Linux ECS instance.

Windows instances

  1. Connect to the ECS instance.

  2. Open File Explorer. The SMB file system appears as a mapped network drive.

    If the drive does not appear, enter \\192.168.xx.xx\myshare in the File Explorer to access the drive. 192.168.xx.xx is the IP address of the server. Replace it with the actual IP address.

    Windows_ECS

Note

The automatic mount configuration is saved in a startup script, such as C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\my_mount.bat. Modify this script as needed.