Thread (6 messages) 6 messages, 2 authors, 2020-12-05

Re: Disk identifiers

From: Peter Grandi <hidden>
Date: 2020-12-05 19:09:43

[...]
I was referring to what fdisk -l calls "disk
identifier". [...]
That's not a very fruitful approach :-). The real disk
identifiers are the serial number or WWN.

What 'fdisk' reports is the identifier of the "label" (called by
'fdisk' "Disklabel", which is a metadata block which usually
contains the partition table, and of which there are several
types).

For MBR/DOS type labels that is a pretty obscure field at offset
0x1B8 on the disk, and it is a 32b field. I personally use it
to store 4 characters, but it can be any 32-bit value.

That value matters a lot more to MS-Windows than to GNU/Linux,
which basically ignores it. I find that value used under
'/dev/disk/by-partuuid/' where it is used to prefix the number
of the partition for DOS/MBR labeled disks. BTW the entries
under '/dev/disk/' seem to me a "legacy" mess.

GPT/EFI labels instead have 128b fields which are usually filled
with UUID-structured random values, and those are not ignored
and usually appear under '/dev/disk/by-uuid'.

For MD raid sets I like to use GPT labels and refer to RAID set
members by partition name, where I give those partitions
meaningful proper-name prefixes. But that's another story.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help