All of lore.kernel.org
 help / color / mirror / Atom feed
* Disk identifiers
@ 2020-12-05  5:59 H
  2020-12-05  6:50 ` Peter Grandi
  0 siblings, 1 reply; 6+ messages in thread
From: H @ 2020-12-05  5:59 UTC (permalink / raw)
  To: Linux RAID Mailing List

Are disk identifiers important in Linux (CentOS)? I have two disks that used to be in a Intel fake RAID1 configuration and I now see have identical disk identifiers of 00000000-0000-0000-0000000000. I now want to use only one of them and later use mdraid for a software RAID1 configuration.

Googling suggests that: (1) disk identifiers are /not/ important and (2) they are using the format 0x12345678. However fdisk -l displays the disk identifiers of my disks in the long UUID format. Further, another disk in the system does use a long UUID.

Last, googling suggests there is confusion between disk identifiers and partition UUIDs. I am specifically asking about the former.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Disk identifiers
  2020-12-05  5:59 Disk identifiers H
@ 2020-12-05  6:50 ` Peter Grandi
  2020-12-05 16:56   ` H
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Grandi @ 2020-12-05  6:50 UTC (permalink / raw)
  To: list Linux RAID

> Are disk identifiers important in Linux (CentOS)? [...]  Last,
> googling suggests there is confusion between disk identifiers
> and partition UUIDs. I am specifically asking about the
> former.

That "disk identifiers" is not specific. Which one do you mean
among disk serial numbers, disk WWNs, disk label identifiers?
Also apart from partition identifiers there are also partition
lavbels, MD set identifiers, MD member identifiers, and filetree
labels and identifiers.  Not all of these are present in every
case.

It may be interesting to have a look at the contents of the
'/dev/disk/by-*/' directories.

As to the importance of any of these it depends on which
specific configuration goals you have. Each of them has some
advantages and disadvantages.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Disk identifiers
  2020-12-05  6:50 ` Peter Grandi
@ 2020-12-05 16:56   ` H
  2020-12-05 19:08     ` Peter Grandi
  0 siblings, 1 reply; 6+ messages in thread
From: H @ 2020-12-05 16:56 UTC (permalink / raw)
  To: list Linux RAID

On 12/05/2020 01:50 AM, Peter Grandi wrote:
>> Are disk identifiers important in Linux (CentOS)? [...]  Last,
>> googling suggests there is confusion between disk identifiers
>> and partition UUIDs. I am specifically asking about the
>> former.
> That "disk identifiers" is not specific. Which one do you mean
> among disk serial numbers, disk WWNs, disk label identifiers?
> Also apart from partition identifiers there are also partition
> lavbels, MD set identifiers, MD member identifiers, and filetree
> labels and identifiers.  Not all of these are present in every
> case.
>
> It may be interesting to have a look at the contents of the
> '/dev/disk/by-*/' directories.
>
> As to the importance of any of these it depends on which
> specific configuration goals you have. Each of them has some
> advantages and disadvantages.

I was referring to what fdisk -l calls "disk identifier". Interestingly enough I found neither the all-zeroes or the third disk with a UUID disk identifier in any of the /dev/disk/by-* subdirectories.

Could it be used somewhere else?


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Disk identifiers
  2020-12-05 16:56   ` H
@ 2020-12-05 19:08     ` Peter Grandi
  2020-12-05 21:01       ` H
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Grandi @ 2020-12-05 19:08 UTC (permalink / raw)
  To: list Linux RAID

[...]

> 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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Disk identifiers
  2020-12-05 19:08     ` Peter Grandi
@ 2020-12-05 21:01       ` H
  2020-12-05 22:05         ` Peter Grandi
  0 siblings, 1 reply; 6+ messages in thread
From: H @ 2020-12-05 21:01 UTC (permalink / raw)
  To: list Linux RAID

On 12/05/2020 02:08 PM, Peter Grandi wrote:
> [...]
>
>> 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.

This is the output from fdisk -l where it is called "Disk identifier":

Disk /dev/sda: 256.1 GB, 256060514304 bytes, 500118192 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: gpt
Disk identifier: 00000000-0000-0000-0000-000000000000

and the output from another disk:

Disk /dev/sdc: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt
Disk identifier: EF1A3010-0A15-5A4B-A6FC-1B0EA869D0A7

Thus the disk identifier in the first case is not, as I had mentioned seeing in my first e-mail, something like 0x12345678, but rather a UUID-like number.

Should I change the disk identifier for the first disk to something else than all-zeroes? And, if so, should I use a UUID-like number since fdisk presents it as such or should I use a 8-character string?

I


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Disk identifiers
  2020-12-05 21:01       ` H
@ 2020-12-05 22:05         ` Peter Grandi
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Grandi @ 2020-12-05 22:05 UTC (permalink / raw)
  To: list Linux RAID

>> [...] For MBR/DOS type labels that is a pretty obscure field
>> at offset 0x1B8 on the disk, and it is a 32b field. [...]
>> GPT/EFI labels instead have 128b fields which are usually
>> filled with UUID-structured random values [...]

> This is the output from fdisk -l where it is called "Disk
> identifier":
[...]
> Disk label type: gpt
> Disk identifier: 00000000-0000-0000-0000-000000000000
[...]
> Disk label type: gpt
> Disk identifier: EF1A3010-0A15-5A4B-A6FC-1B0EA869D0A7

Reading carefully the output might help, as well as discovering
that recent versions of 'fdisk' and 'gdisk' handle both DOS and
GPT labels (in different degrees). Using the 'm' command of
'fdisk' show it can handle also other types of labels.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-12-05 22:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-05  5:59 Disk identifiers H
2020-12-05  6:50 ` Peter Grandi
2020-12-05 16:56   ` H
2020-12-05 19:08     ` Peter Grandi
2020-12-05 21:01       ` H
2020-12-05 22:05         ` Peter Grandi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.