what is the Disk identifier (GUID)?

BalrogMithrandir

New Member
Joined
Mar 29, 2019
Messages
5
Reaction score
3
Credits
0
When I fire up command :
`gdisk /dev/nvme0`, and input `p`,
I got these:
```
Disk /dev/nvme0n1: 500118192 sectors, 238.5 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): E37EBCC8-2251-420B-B2A6-3B515E3D2892
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 500118158
Partitions will be aligned on 2048-sector boundaries
Total free space is 2669 sectors (1.3 MiB)

Number Start (sector) End (sector) Size Code Name
1 2048 976895 476.0 MiB EF00 primary
2 976896 500117503 238.0 GiB 8300 primary
```

And i do not know what the `Disk identifier (GUID): E37EBCC8-2251-420B-B2A6-3B515E3D2892` is . And will it change if I change the partion?

Thank you !
 


The purpose of a UUID (or GUID) is to assign a unique ID number to something without any central authority. There are over 3.4x10^38 possible values to a 128-bit number, so the chances are pretty small that any two partitions anywhere on earth will ever be assigned the same randomly selected number.

You can set it to a new random value when you format the partition with the -U random switch to the various mkfs commands. Or you can pick your own number and set it.

I think it's not changed when you reformat the partition if you don't specify it. Though I can't remember for sure, and the man page doesn't say. (But of course, you could always save the existing number and set again it if needed.)

The advantage is that you can specify it in your /etc/fstab file and it won't change, even if the device name does. Sometimes when you add a new disk to your system, the new disk inexplicably displaces and renames and existing disk. But that won't matter if you mount by UUID. Entries in /etc/fstab look like this:
Code:
UUID=4e03f420-61b6-3627-35df-9219c6de4d19   /  ext4  defaults 1 1
 

Members online


Latest posts

Top