Change UUID of the Cloned Disk in linux

 
If you’ve cloned a disk, such as by using dd, you might want to be able to mount both the original and the clone at the same time. To make sure that the UUIDs don’t clash, first generate a new UUID, and then assign it to the new disk with tunefs:

  #uuidgen
... 79fb806d-4350-4b8c-8bc3-f3bb0c6b56f2

  #tune2fs -U 79fb806d-4350-4b8c-8bc3-f3bb0c6b56f2 /dev/sdc1

Now mount the new disk:

#mount -U 79fb806d-4350-4b8c-8bc3-f3bb0c6b56f2 /mnt/clonedis
 
 

5 comments:

  1. On debian/ubuntu system, you have install the following packages inorder to use this command.

    #apt-cache search uuidgen
    uuid-runtime - runtime components for the Universally Unique ID library

    #apt-get install uuid-runtime

    #uuidgen
    283c3d2f-56b0-4bbf-b699-bfb676f7f38b

    ReplyDelete
  2. corrected grammar mistake,

    On debian/ubuntu system, you have to install the following packages in-order to use this command.

    #apt-cache search uuidgen
    uuid-runtime - runtime components for the Universally Unique ID library

    #apt-get install uuid-runtime

    #uuidgen
    283c3d2f-56b0-4bbf-b699-bfb676f7f38b

    ReplyDelete
  3. Works like a charm on CentOS 6.2. Thank you.

    ReplyDelete
  4. Thanks for Visit and Ur comments !!

    ReplyDelete
  5. Only works on ext partitions. What about when you've cloned something else (like linux_raid_member_disk)?

    ReplyDelete

Blogger Tips and TricksLatest Tips And TricksBlogger Tricks