A UUID (universally unique identifier) is an identifier that allows an entity to be uniquely identified across computers. The UUID is frequently used to identify storage partitions (such as a drive or a USB stick) or the folder where a program is installed.

The UUID is a 128-bit number that is typically represented as a 32-character string. It could be something like a5a5b816-7b6f-11e9-be4a-2a86e4085a59. The UUID allows an object to be uniquely identified regardless of where it is or whatever system it is on. This avoids object definition conflicts between systems.

 

UUID Versions

UUID has 5 different versions. Each of these versions has a different structure and features. UUID versions are:

  1. UUID Version 1 : is created using MAC addresses and timestamps. This version is comprised of a MAC address and a timestamp. This version is suitable for many systems, however it may constitute a security risk owing to the unique MAC address generation.
  2. UUID Version 2: This version is created using Domain Name Service (DNS) and Person Object (PO) IDs. This version is a combination of a DNS or PO ID and a timestamp. This version is mainly used for organizations.
  3. UUID Version 3: This version is a combination of a namespace and a directory. This version consists of a combination of the hash values of a namespace and an array. This version is used for data hashing.
  4. UUID Version 4: This version is generated using a randomly generated array. This version consists of a randomly generated string of 128 bits. This version is usually random data
  5. UUID Version 5 consists of a combination of a namespace and a directory. This version consists of a combination of the hash values of a namespace and an array. This version is used for data hashing. Version 5 works similarly to UUID Version 3 but uses a more advanced hash function. In this way, UUID Version 5 works more reliably and less erroneously.

UUID Timestamps

A timestamp combination is used to generate UUID Version 1 and UUID Version 2. The timestamp is created based on a timestamp in these versions, and it comprises the first 60 bits of the UUID. The timestamp is generated in milliseconds using the Coordinated Universal Time (UTC) zone. This is the timestamp combination:

0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                          time_low                             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|       time_mid                |         time_hi_and_version   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|clk_seq_hi_res |  clk_seq_low  |         node (0-1)            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                         node (2-5)                            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

The time_low: 32 bit function generates the first 32 bits of the UUID.

The second 16 bits of the UUID are made up of time_mid: 16 bits.

The third 16-bit of the UUID is time_hi_and_version: 16-bit, which also indicates the version of the UUID.

clk_seq_hi_res: 8-bit enables for less precise timestamp expression.

clk_seq_low: An 8-bit timestamp can be expressed with less precision. node: 48 bits refers to the MAC address (UUID Version 1) or the PO ID (UUID Version 2).

With the blkid (?) command, the UUID is typically used to identify system partitions or folders where a program is installed. This command displays the UUID of the partitions discovered on the system as well as the file system with which these partitions are partitioned. The blkid command can also be used to modify the UUID of a system partition. This is a key consideration when updating a partition's UUID. When the UUID of a partition is changed, all connections and configurations for that partition must be modified as well.

UUID is commonly used in operating systems like Linux and Unix. It is, nonetheless, used in Windows and other operating systems. The UUID is also utilized between systems to perform file sharing and data backup procedures. When the UUID of a partition is changed, all connections and configurations for that partition must be modified as well. For example, if the UUID of a volume connection is altered, the link will no longer function properly. As a result, updating the UUID should be done with caution.

Many file systems also use the UUID. UUID is also used in file systems such as ext4 and btrfs. The UUID of a file or folder can be altered in these file systems. This procedure, however, should be performed with caution because it has the potential to corrupt the file system structure.

The UUID is also utilized between systems to perform file sharing and data backup procedures. For example, when backing up or moving a partition to another system, the UUID of that partition is used. This ensures that the partition being backed up or cloned does not clash with another partition on the same system. At the same time, if the backed up or duplicated partition clashes with another partition on the same system, the UUID allows these partitions to be recognized from one another. This ensures that the partitions that have been backed up or duplicated can be used correctly.