All Products
Search
Document Center

Elastic Compute Service:Overview

Last Updated:Aug 27, 2024

After you attach a new empty data disk to an Elastic Compute Service (ECS) instance, you cannot directly use the disk to store data. To use the disk, you must initialize the disk. The initialization operations include partitioning the disk and mounting file systems on the disk. This topic describes the scenarios in which disks need to be initialized and how to initialize a disk. This topic also describes the partition formats and device names of disks.

Scenarios

You can initialize only the following new data disks that do not contain data:

  • Data disks that are created along with ECS instances that run Linux operating systems

  • Empty data disks that are separately created

Note
  • You do not need to initialize system disks that are created along with ECS instances or data disks that are created along with ECS instances that run Windows operating systems. The system disks are automatically partitioned and file systems are automatically mounted to the system disks.

  • In most cases, a disk created from a snapshot contains data. In this case, you need to only mount file systems on the disk or bring the disk online. For more information, see Step 8 in the "Create a disk from a snapshot" topic.

Procedure

  1. Determine whether a disk needs to be partitioned.

    • If you want to partition the disk, select an initialization method based on the size of the disk.

    • If you do not want to partition the disk, create a file system on the raw disk. This method is applicable only to Linux operating systems.

  2. Select an initialization method based on the size of the disk.

    Initialize a data disk whose size does not exceed 2 TiB

    Operating system

    Initialization tool

    Partition format

    Common file system

    References

    Linux

    • Partition: Parted

    • File system: e2fsprogs

    • GUID Partition Table (GPT) (recommended)

    • MBR

    • Ext4

    • XFS

    Initialize a data disk whose size does not exceed 2 TiB on a Linux instance

    Windows

    Disk Management

    • GPT (recommended)

    • MBR

    NTFS

    Initialize a data disk whose size does not exceed 2 TiB on a Windows instance

    Initialize a data disk whose size exceeds 2 TiB

    Operating system

    Initialization tool

    Partition format

    Common file system

    References

    Linux

    • Partition: Parted

    • File system: e2fsprogs

    GPT

    • Ext4

    • XFS

    The Initialize a data disk whose size exceeds 2 TiB on a Linux instance section in the "Initialize a data disk whose size exceeds 2 TiB" topic

    Windows

    Disk Management

    GPT

    NTFS

    The Initialize a data disk that is larger than 2 TiB on a Windows instance section in the "Initialize a data disk whose size exceeds 2 TiB" topic

Partition formats

Data disks support the MBR and GPT partition formats. The following table describes the differences between the two partition formats.

Partition format

Maximum partition size

Number of partitions

Description

MBR

2 TiB

An MBR disk can have one of the following groups of partitions:

  • Four primary partitions

  • Three primary partitions and one extended partition

    You can create an unlimited number of logical partitions in an extended partition.

MBR partitions are classified into primary, extended, and logical partitions.

GPT

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

Note

An Alibaba Cloud GPT disk can be up to 32 TiB in size.

  • Linux: unlimited

  • Windows: 128

All partitions are primary partitions. No extended partitions or logical partitions exist.

Important

An MBR partition can be up to 2 TiB in size. A GPT partition can be up to 18 EiB in size. If your data disk is larger than 2 TiB in size or if you may need to resize your data disk to larger than 2 TiB, you must use the GPT partition format.

Device names of data disks on Linux instances

By default, data disks that are attached to Linux instances are automatically assigned device names based on the following naming conventions:

  • I/O optimized instance:

    • The device names of data disks that are attached by using the Non-Volatile Memory Express (NVMe) protocol are in the /dev/nvmeXn1 format. Examples: /dev/nvme1n1, /dev/nvme2n1, and /dev/nvme3n1. For information about disks that support the NVMe protocol, see NVMe disks.

    • The device names of data disks that are attached by using protocols other than the NVMe protocol are in the /dev/vd[b-z] format. Examples: /dev/vdb, /dev/vdc, and /dev/vdd.

  • Non-I/O optimized instances: The device names of data disks that are attached to non-I/O optimized Linux instances are in the /dev/xvd[b-z] format. Examples: /dev/xvdb, /dev/xvdc, and /dev/xvdd.