find uuid in linux

How To Find UUID of Storage Devices In Linux

UUID are 128 bit long number represented by 32 bit hexadecimal digits and which are used in software development to uniquely identify the information. UUID is also a property of the disk partition itself. Let’s see how to find uuid of storage devices.

Check Out :  how to change owner and group of directory

UUID = cca0c020-aab7-426e-a7a6-5bcfa1a6f14a

you can generate random uuid by below command and you need to set this uuid of storage device in /etc/fstab. if anything goes wrung in this file, So your machine won’t be boot up then you have to check the mounted storage devices in this file.

/dev/mapper/centos-swap   swap   swap    defaults   0 0

you can use storage device name instead of UUID to define in /etc/fstab. Please make sure to run mount -a command before rebooting the machine. this will show you the error.

cat /proc/sys/kernel/random/uuid

Now there’re many ways to find out this,

ls -l /dev/disk/by-uuid

Check Out : How To Install NFS Server For File Sharing On Linux

you can get uuid of particular storage devices.

blkid /dev/dm-3

lsblk -f

you can also use this command to get the information.

hwinfo –block | grep by-uuid | awk ‘{print $3,$7}’

That’s it.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

two × 5 =