For most Linux users, it may often be faced with a problem involving UUID, for example when dealing with the file /etc/fstab which uses UUID as a partition device identifier. The question arises in us how to see the UUID of a linux partition? Before we learn more about “how to display UUID on Linux” we should learn first to know what UUID is.
What is the UUID
UUID (universally unique identifier) is a 128-bit number used to identify a computer system, for example to identify hardware or partitions. When the computer creates an UUID, the 128bit row of numbers generated is not regulated by an international authority agency, so that even though the name is unique (different from the others), it does not rule out the possibility of 2 similar UUIDs occurring on a different computer system. so guarantee Unique this only happens on the computer system concerned, while for different computer systems it is possible to appear the same UUID.
In this article, we will focus on learning how to display UUID information from a linux partition, as well as to view information other than UUID for example partition labels and partition types.
Related Linux command line in this article:
To see the syntax for writing the blkid command, you can type
sudo blkid --help as follows:
tanto@belajarlinux:~$ sudo blkid -help blkid from util-linux 2.27.1 (libblkid 2.27.0, 02-Nov-2015) Usage: blkid -L
How to display the specified UUID partition
The simplest command is with
blkid <dev> as follows:
tanto@belajarlinux:~$ sudo blkid /dev/sda6 /dev/sda6: UUID="5f342f4e-080a-4c4a-808f-41935be6de62" TYPE="ext4" PTTYPE="dos" PARTUUID="7be342ff-06"
How to display the UUID for all partitions
How to display the UUID for all partitions, just type
sudo blkid as follows:
tanto@belajarlinux:~$ sudo blkid /dev/sda3: LABEL="DATA" UUID="B0BE85C9BE858914" TYPE="ntfs" PARTUUID="7be342ff-03" /dev/sda2: LABEL="WINDOWS7" UUID="E4A624ACA62480E2" TYPE="ntfs" PARTUUID="7be342ff-02" /dev/sda1: LABEL="System Reserved" UUID="BA6818C068187D77" TYPE="ntfs" PARTUUID="7be342ff-01" /dev/sda5: UUID="d98ed6fa-6fad-4318-8f26-26cb20cf7ea7" TYPE="swap" PARTUUID="7be342ff-05" /dev/sda6: UUID="5f342f4e-080a-4c4a-808f-41935be6de62" TYPE="ext4" PTTYPE="dos" PARTUUID="7be342ff-06"