All Products
Search
Document Center

Elastic Compute Service:Create a disk from a snapshot

Last Updated:Mar 25, 2024

Use a snapshot to create a disk. The data on the new disk is the same as the data that existed on the source disk when the snapshot was created. Snapshot-based disk creation allows you to quickly replicate disks for environment cloning or data backup. You can use a snapshot to create system disks or data disks. This topic describes how to create a disk from a snapshot.

Limits

When you create a disk from a snapshot, take note of the following limits:

  • Disks are independent of each other and cannot be merged by formatting. Before you create disks, we recommend that you determine the number and capacity of disks that you need based on your business requirements.

  • We recommend that you do not use Logical Volume Manager (LVM) to create logical volumes across multiple disks. A snapshot can back up the data of only a single disk. If you create a logical volume across multiple disks by using LVM, data discrepancies may occur when you roll back the disks.

  • If you create a disk from a snapshot and attach the new disk to the Elastic Compute Service (ECS) instance to which the source disk of the snapshot is attached, the UUID of the new disk conflicts with the UUID of the source disk. In this case, you must change the UUID of the new disk. For more information, see Change the UUID of a disk.

  • You can use a snapshot that resides in one zone to create disks in another zone. For example, you can use a snapshot that resides in Hangzhou Zone A to create disks in Hangzhou Zone B.

Procedure

You can go to the disk buy page from the Disks or Snapshots page to create a disk from a snapshot. In this example, the Snapshots page is used.

  1. Log on to the ECS console.

  2. In the left-side navigation pane, choose Storage & Snapshots > Snapshots.

  3. In the top navigation bar, select the region and resource group to which the resource belongs. 地域

  4. Click the Disk Snapshots tab.

  5. Find the snapshot from which you want to create a disk. In the Actions column, click Create Disk.

  6. On the disk buy page, configure parameters.

    Information about a snapshot is automatically populated. Configure other parameters. For information about the parameters, see Create a disk from a snapshot, which describes how to go to the disk buy page from the Disks page to create a disk from a snapshot.

    After the disk is created, you can view the disk on the Disks page. However, the disk cannot be directly used on an Elastic Compute Service (ECS) instance. To use the disk, perform the operations that are described in the "What to do next" section of this topic.

What to do next

In most cases, a disk that is created from a snapshot contains data and does not need to be initialized. To use the new disk that is created from a snapshot on an instance, you need to only perform the following operations based on the operating system of the instance:

  • Linux instance:

    1. If the disk is attached to a Linux instance, log on to the instance and run the following command to perform the mount operation:

      mount <Disk partition name> <Mount point>
      • <Disk partition name>: You can log on to the instance to which the source disk of the snapshot is attached and run the df -h command to query the disk partition name.

      • <Partition mount point>: You can specify an existing directory as the mount point or run the mkdir -p <Mount point of the partition> command to create a directory as the mount point. The mount point must start with a forward slash (/) and contain letters or digits. Example: /mnt.

    2. Writes the new partition information to the /etc/fstab file. This way, the partition is automatically mounted on system startup.

      For more information, see Step 4: Configure the disk partition to automatically mount on instance startup.

  • If the disk is attached to a Windows instance, log on to the instance and connect the disk online in the Disk Management window. For more information, see Step 1 to Step 4 in Initialize a data disk up to 2 TiB in size on a Windows instance.