All Products
Search
Document Center

Elastic Compute Service:Attach a data disk

Last Updated:Jun 20, 2026

To use a data disk, you must first attach it to an ECS instance and then initialize it.

Prerequisites

  • If the multi-attach feature is not enabled for a cloud disk, you can attach it to only one ECS instance.

    Go to the Disks page in the ECS console. Click the ID of a cloud disk to go to its details page. If the Multi-attach field shows Not Supported, the feature is not enabled.
  • The ECS instance must be in the Running or Stopped state and must not be expired.

Procedure

  1. Go to ECS console - Instances. In the top-left corner, select the region and resource group for the target resource.

  2. Click the ID of the target instance to go to its details page.

  3. Click the Block Storage tab, and then click Attach Disk.

  4. On the Attach Disk page, configure the following parameters and click Next.

    Parameter

    Description

    Disk

    Select the cloud disk to attach.

    You can attach only a cloud disk that is in the same zone as the instance. This restriction does not apply to a zone-redundant ESSD.

    Release Disk with Instance

    • If selected, the cloud disk is released with the instance.

    • If not selected, the cloud disk is retained when the instance is released.

    Important

    If you attach a system disk that was detached from another instance, the instance referred to in the Release Disk with Instance setting is the original ECS instance to which the system disk was attached, not the current instance.

    Delete Automatic Snapshots While Releasing Disk

    Selecting this option deletes the disk's automatic snapshots when the disk is released. This applies to manual releases, releases with an instance, and system disk replacements, regardless of the snapshots' expiration status.

  5. On the initialization page, verify the cloud disk information and click Initialize Now.

    The Return to the Cloud Assistant operation page feature is in invitational preview. If you accidentally close this page or choose to initialize later, you may only be able to initialize the disk from the command line.
  6. After attaching a data disk, you must initialize it. Alibaba Cloud offers two initialization methods:

    • Initialize from the console (recommended): Use Cloud Assistant to initialize the disk and mount a file system directly from the console. This method is convenient and does not require you to run commands manually.

    • Initialize from the command line: Log on to the instance and run commands to manually initialize the disk and mount a file system. This method offers more flexibility and is broadly applicable.

    Initialize from the console (recommended)

    1. On the disk status check page, check if the cloud disk has been initialized.

      If you have not granted permissions to Cloud Assistant, follow the on-screen instructions to grant the required permissions.
      If the page displays a Cloud Assistant Query or Task Failure or Cloud Assistant is not installed message, initialize the cloud disk from the command line.

      If the Current Status column displays To be initialized, the disk is not initialized. If it displays Awaiting File System Mount, the disk has been initialized.

      Not initialized

      Important

      Creating partitions and file systems erases all data on the disk. Ensure the disk is empty before proceeding.

      1. On the disk status check page, configure the parameters, select the risk acknowledgment checkbox, and then click OK.

        Parameter

        Description

        Size

        The total size of all partitions cannot exceed the capacity of the cloud disk.

        Mount point

        The mount point must be a unique, empty path that starts with a forward slash (/). You can specify a custom path. Mounting to a non-empty directory hides its existing content, which can disrupt your services.

        Add Partition

        If needed, click Create Partition to create multiple partitions. You can create a maximum of 5 partitions on each cloud disk.

      2. When the page displays the message The disk check is complete and the disk can be used as expected., the disk is initialized and the file system is mounted.

        Important

        This is a temporary mount that becomes invalid after the instance restarts. To ensure that data remains accessible after a restart, log on to the instance and configure automatic partition mounting on system startup.

      Initialized

      1. On the disk status check page, configure a mount point and click Manually Mount.

        Parameter

        Description

        Mount point

        The mount point must be a unique, empty path that starts with a forward slash (/). You can specify a custom path. Mounting to a non-empty directory hides its existing content, potentially disrupting your services.

      2. When the page displays the message The disk check is complete and the disk can be used as expected., the file system is mounted.

        Important

        This is a temporary mount that becomes invalid after the instance restarts. To ensure that data remains accessible after a restart, log on to the instance and configure automatic partition mounting on system startup.

    Initialize from the command line

    If automatic initialization from the console is not supported, you can manually initialize the cloud disk from the command line:

FAQ

  • How do I return to the Cloud Assistant operation page?

    This feature is in invitational preview and is available only to select customers in specific scenarios.

    1. On the Block Storage tab of the instance details page, enable the Cloud Assistant detection feature.

      If the Cloud Assistant detection feature is not available, initialize the cloud disk from the command line.

      Click the gear icon in the upper-right corner of the Block Storage tab. In the Customize Columns dialog box, set Cloud Assistant Detection to Enabled.

    2. Return to the Cloud Assistant initialization page.

      • If the cloud disk is not initialized: Under In-system Status Check for the target cloud disk, click 0/3 Check Passed, and then click Initialize to return to the page.

      • If the cloud disk is initialized but a file system is not mounted (for Linux instances): Under In-system Status Check for the target cloud disk, click 1/3 Check Passed, and then click Mount File System to return to the page.

  • How do I choose partition and file system types?

    • Select a partition format. Use GPT for disks larger than 2 TiB, as MBR does not support them.

      Partitions help with data management and logical isolation. If you do not need to create partitions, you can directly select a file system type.

      Partition format

      Maximum partition capacity

      Number of partitions

      Description

      GPT (Recommended)

      18 EiB (1 EiB = 1,048,576 TiB)

      The maximum capacity of an Alibaba Cloud cloud disk is 64 TiB.

      128

      All partitions are primary partitions. No distinction is made between extended and logical partitions.

      MBR

      2 TiB

      MBR supports the following partition schemes:

      • Four primary partitions

      • Three primary partitions and one extended partition

      • Partitions are categorized as primary, extended, and logical.

      • An extended partition cannot be used directly. It must be divided into logical partitions. There is no upper limit on the number of logical partitions.

    • Select a file system type. For example, ext4 is better suited for handling small files than xfs.

      File system type

      Maximum file size

      Use cases

      ext4

      16 TiB

      Handles small files effectively, suitable for scenarios with a large number of small files. Examples include general-purpose servers, desktop systems, development and testing environments, small log servers, internal management systems, and small database servers.

      xfs

      8 EiB

      The maximum capacity of an Alibaba Cloud cloud disk is 64 TiB.

      Delivers better performance for large directories and files. Suitable for scenarios such as large database servers (MySQL/PostgreSQL), high-performance computing (HPC), storage-intensive applications (like video and image storage), high-concurrency write operations, and big data analytics platforms.

  • Why are some cloud disk types unavailable?

    Different instance families support different types of cloud disks. You can call the DescribeAvailableResource API operation to query the supported disk types.

  • Why is the disk attachment limit reached?

    The maximum number of cloud disks that can be attached varies by instance type. You can call the DescribeInstanceTypes API to query this information.

  • How to attach a disk to multiple instances?

    You can use the multi-attach feature to attach a single ESSD or ESSD AutoPL cloud disk to multiple ECS instances that support the NVMe protocol within the same zone.

    • This feature can be enabled only when you create a stand-alone cloud disk.

    • When using the multi-attach feature, you must use a cluster file system. Standard file systems like ext4 or xfs do not synchronize data across instances, which will lead to data inconsistency.

  • Why can't I find the target disk?

    • Except for zone-redundant ESSDs, the cloud disk to be attached must be in the same zone as the target instance.

    • Different instance families support different types of cloud disks. You can call the DescribeAvailableResource API operation to query the supported disk types.