Find The Label/UUID/ID for Your Hard Disk

ls /dev/disk/by-label -lah 
ls /dev/disk/by-id -lah 
ls /dev/disk/by-uuid -lah

and to set it to something or something else, the partition must not be mounted.

sudo tune2fs --label LABEL /dev/sda2

To generate a new UUID use the command below.

uuidgen

To change the uuid on ext2, ext3 or ext4 partitions use something like the following, remember to change the X to the correct drive and N to the correct partition number

sudo tune2fs /dev/sdXN -U (output from uuidgen)

Leave a Reply

Your email address will not be published. Required fields are marked *