Help Center/ Elastic Volume Service/ Best Practices/ Changing the UUID of an EVS Disk
Updated on 2025-08-04 GMT+08:00

Changing the UUID of an EVS Disk

A UUID conflict may occur when you create a new EVS disk from a snapshot and then attach the disk to the original Linux server. This is because the new disk and the original disk share the same UUID. A UUID conflict may cause the following issues:

  • If the new data disk is created from a system disk snapshot and attached to the original Linux server, the server will boot from the newly attached data disk.
  • If you want to mount an xfs file system, the xfs file system cannot be mounted.

To solve the preceding issues, you can perform the following steps to change the UUID of the new disk:

  1. Remotely log in to the ECS.

    For how to log in to an ECS, see Logging In to an ECS.

  2. Check the file system format and the disk UUID.

    blkid
    /dev/vda1: UUID="77c49bb7-1279-434b-b971-c486dd68cce7" TYPE="ext4" PARTUUID="23c4b6da-01" 
    /dev/vdb1: UUID="77c49bb7-1279-434b-b971-c486dd68cce7" TYPE="ext4" PARTUUID="23c4b6da-01"
    /dev/vdc1: UUID="a1b2c3d4-e5f6-7890-a458-ca1234567890" TYPE="xfs" LABEL="xfs_data"
    /dev/vdd1: UUID="a1b2c3d4-e5f6-7890-a458-ca1234567890" TYPE="xfs" LABEL="xfs_data"
    • If information similar to the preceding example is returned, the newly created disk and the original disk have the same UUID.
    • If the returned TYPE value is"ext4" "ext3", or "ext2", go to 4.
    • If the returned TYPE value is "xfs", go to 5.

  3. Check the file system.

    e2fsck -f /dev/vdb1

    • For an ext2, ext3, or ext4 file system, go to 4.
    • If an xfs file system, go to 5.

  1. Change the UUID of the ext2, ext3, or ext4 file system.

    1. Generate a new UUID for the disk.

      uuidgen | xargs tune2fs /dev/vdb1 -U

    2. Check whether the UUID has been changed.

      blkid

      If information similar to the following is returned, the UUID of the new EVS disk has been changed.

      /dev/vda1: UUID="77c49bb7-1279-434b-8971-c486dd60cce2" TYPE="ext4" PARTUUID="23c4b6da-01" 
      /dev/vdb1: UUID="fa79812d-4f12-4722-9fa9-9ee492d6ee8e" TYPE="ext4" PARTUUID="23c4b6da-01"
    3. Mount the EVS disk to the ECS.

      mount /dev/vdb1 /mnt

    4. Configure the /etc/fstab file by referring to Creating and Mounting a File System to configure auto mount at startup for the new disk.

  1. Change the UUID of the xfs file system.

    1. Generate a new UUID for the disk.

      xfs_admin -U generate /dev/vdd1

    2. Check whether the UUID has been changed.

      blkid

      If information similar to the following is returned, the UUID of /dev/vdb1 has been changed.

      /dev/vdc1: UUID="a1b2c3d4-e5f6-7890-a458-ca1234567890" TYPE="xfs" LABEL="xfs_data"
      /dev/vdd1: UUID="12345678-90ab-cdef-1234-567890abcdef" TYPE="xfs" LABEL="xfs_data"
    3. Mount the EVS disk to the ECS.

      mount /dev/vdb1 /mnt

    4. Configure the /etc/fstab file by referring to Creating and Mounting a File System to configure auto mount at startup for the new disk.