All Products
Search
Document Center

Elastic Compute Service:Change the UUID of a disk

Last Updated:May 15, 2026

When a snapshot-created disk is attached to the same ECS Linux instance as the source disk, UUID conflicts may cause boot or mount failures. Change the new disk's UUID to resolve this.

Background

A snapshot-created disk shares the UUID of its source disk. Attaching both disks to the same Linux instance causes a UUID conflict with the following potential issues:

  • If the new disk is created from a system disk snapshot and attached as a data disk, the OS may boot from the data disk instead of the system disk.

  • If your disk uses an XFS file system, the mount operation fails because of the UUID conflict, returning an error message such as "mount: wrong fs type, bad option, bad superblock on /dev/vdd1".

See Create a disk from a snapshot.

After attaching the snapshot-created disk in the ECS console, log on to the instance and change the new disk's UUID before mounting it. Run blkid to identify the file system type, then follow the corresponding method:

Change the UUID of an ext2, ext3, or ext4 file system

Note

This example uses /dev/vdb1 as the snapshot-created disk. Replace it with your actual device name.

  1. Connect to an ECS instance.

    For more information, see Connect using VNC.

  2. Query the UUIDs of all disks:

    blkid

    The output shows that the new disk and the source disk share the same UUID.uuid信息

  3. Check the file system:

    e2fsck -f /dev/vdb1
  4. Generate a new UUID for the disk:

    uuidgen | xargs tune2fs /dev/vdb1 -U
  5. Verify that the UUID has changed:

    blkid

    The output shows that the UUID of /dev/vdb1 has changed.uuid已变动

  6. Mount the disk. Replace /mnt with your mount point.

    mount /dev/vdb1 /mnt
  7. To mount the disk automatically on startup, configure /etc/fstab.

Change the UUID of an XFS file system

Note

This example uses /dev/vdd1. Replace it with your actual device name.

  1. Connect to an ECS instance.

    For more information, see Connect using VNC.

  2. Query the UUIDs of all disks:

    blkid

    The output shows that the new disk and the source disk share the same UUID.xfs-uuid

  3. Generate a new UUID for the disk:

    xfs_admin -U generate /dev/vdd1
  4. Verify that the UUID has changed:

    blkid

    The output shows that the UUID of /dev/vdd1 has changed.uuid结果-xfs

  5. Mount the disk. Replace /mnt with your mount point.

    mount /dev/vdd1 /mnt
  6. To mount the disk automatically on startup, configure /etc/fstab.