Skip to contentSkip to conversation

Proper partition type for components with V1.x superblocks?

DISCUSSION Peter Rabbitson 6 participants 16 messages Jun 11, 2008 – Jul 7, 2008 MD RAID

lore
Share & tools
lore
#0 lore raw

Hello,

The subject pretty much says it all - it obviously is not 0xFD, since there is nothing to autodetect. Is there some best practice/semi-standard way of marking a raid component partition as such? After reading the specs 0xDA (non-fs data) comes to mind, but I figured I'll ask here.

Thanks

Peter

#1 lore raw
Quoted 3 lines · Peter Rabbitson

The subject pretty much says it all - it obviously is not 0xFD, since there is nothing to autodetect. Is there some best practice/semi-standard way of marking a raid component partition as such?

Nobody really cares about the partition type these days. I usually stick to the default 83 (Linux) for software raid partitions and never encountered any problems.

Andre

Signature · 1 line
The only person who always got his work done by Friday was Robinson Crusoe
#2 lore raw
Quoted 7 lines · Andre Noll
Quoted 1 line · Peter Rabbitson

The subject pretty much says it all - it obviously is not 0xFD, since there is nothing to autodetect. Is there some best practice/semi-standard way of marking a raid component partition as such?

Nobody really cares about the partition type these days. I usually stick to the default 83 (Linux) for software raid partitions and never encountered any problems.

This is a very flawed assumption. You will be surprised how many utilities/live CDs are there in existence, which will selently attempt to mount/fsck a partition based solely on its type. The implications of a commenced mount/fsck on a raid component are not to be uttered here :)

#3 lore raw
Quoted 7 lines · Peter Rabbitson
Quoted 3 lines

Nobody really cares about the partition type these days. I usually stick to the default 83 (Linux) for software raid partitions and never encountered any problems.

This is a very flawed assumption. You will be surprised how many utilities/live CDs are there in existence, which will selently attempt to mount/fsck a partition based solely on its type.

Well, I'd consider those utilities broken by design. If it is the exercise is to break as few utilities/live CDs as possible, I admit you'll have to care about partition types. It's a rather pointless exercise IMHO though.

Andre

Signature · 1 line
The only person who always got his work done by Friday was Robinson Crusoe
#4 lore raw
In reply to Peter Rabbitson
Quoted 7 lines · Peter Rabbitson

Hello,

The subject pretty much says it all - it obviously is not 0xFD, since there is nothing to autodetect. Is there some best practice/semi-standard way of marking a raid component partition as such? After reading the specs 0xDA (non-fs data) comes to mind, but I figured I'll ask here.

I recently wondered if there should be a new partition type.

Partitioning tools look for (and sometimes find!) filesystems on 0x83 partitions so 0x83 is out (anyone splitting a mirror should be happy changing the type back)

I'd rather that rescue disk didn't think 'oh, I'll use that swap partition', so 0x82 is out.

I don't want md trying to autodetect and complaining so, as you say, 0xfd is out.

I think it would be nice to mark them as 0xFC

David

#5 lore raw
Quoted 14 lines · David Greaves
Quoted 7 lines · Peter Rabbitson

Hello,

The subject pretty much says it all - it obviously is not 0xFD, since there is nothing to autodetect. Is there some best practice/semi-standard way of marking a raid component partition as such? After reading the specs 0xDA (non-fs data) comes to mind, but I figured I'll ask here.

I recently wondered if there should be a new partition type.

Partitioning tools look for (and sometimes find!) filesystems on 0x83 partitions so 0x83 is out (anyone splitting a mirror should be happy changing the type back)

Quoted 6 lines

I'd rather that rescue disk didn't think 'oh, I'll use that swap partition', so 0x82 is out.

I don't want md trying to autodetect and complaining so, as you say, 0xfd is out.

I think it would be nice to mark them as 0xFC

Nope. As per [1] (which is linked in [2]): fc VMware Swap partition

What is the process for partition type registration anyway? How did 0xFD come around?

Peter

[1] http://www.win.tue.nl/~aeb/partitions/partition_types-1.html
[2] http://en.wikipedia.org/wiki/Partition_(computing)

#6 lore raw
In reply to Peter Rabbitson
Quoted 7 lines · On Wednesday June 11, [email protected] wrote:

Hello,

The subject pretty much says it all - it obviously is not 0xFD, since there is nothing to autodetect. Is there some best practice/semi-standard way of marking a raid component partition as such? After reading the specs 0xDA (non-fs data) comes to mind, but I figured I'll ask here.

I (almost) alway make arrays out of whole devices, not partitions, so I really never thought about this.

I suspect 0xDA is safest and hence best.
I wonder if this should be suggested in the mdadm man page anywhere.... anyone feel like creating a patch?

NeilBrown

#7 lore raw
Quoted 6 lines · Neil Brown
Quoted 4 lines · On Wednesday June 11, [email protected] wrote:

Hello,

The subject pretty much says it all - it obviously is not 0xFD, since there is nothing to autodetect. Is there some best practice/semi-standard way of marking a raid component partition as such? After reading the specs 0xDA (non-fs data) comes to mind, but I figured I'll ask here.

Quoted 7 lines

I (almost) alway make arrays out of whole devices, not partitions, so I really never thought about this.

I suspect 0xDA is safest and hence best.
I wonder if this should be suggested in the mdadm man page anywhere.... anyone feel like creating a patch?

Why 0xDA?

As far as I know, the closest thing there is to a registry is the list that aeb at least used to maintain.

-hpa

#8 lore raw
Quoted 18 lines · H. Peter Anvin
Quoted 9 lines · Neil Brown
Quoted 7 lines · On Wednesday June 11, [email protected] wrote:

Hello,

The subject pretty much says it all - it obviously is not 0xFD, since there is nothing to autodetect. Is there some best practice/semi-standard way of marking a raid component partition as such? After reading the specs 0xDA (non-fs data) comes to mind, but I figured I'll ask here.

Quoted 7 lines

I (almost) alway make arrays out of whole devices, not partitions, so I really never thought about this.

I suspect 0xDA is safest and hence best.
I wonder if this should be suggested in the mdadm man page anywhere.... anyone feel like creating a patch?

Quoted 4 lines

Why 0xDA?

As far as I know, the closest thing there is to a registry is the list that aeb at least used to maintain.

Actually, if you are going to use version 1 superblocks anyway, then just list the partitions as normal linux partitions. The whole linux-raid-autodetect partition type was originally only for auto detect at bootup. If you weren't using that feature, then standard linux type was good enough. And if you use version 1.1 or 1.2 superblocks, then you really don't have anything to worry about since the location of the superblock and the data start offset means that the partition won't get accidentally recognized as a non-raid partition.

Signature · 6 lines
Doug Ledford <[email protected]>
              GPG KeyID: CFBFF194
              http://people.redhat.com/dledford

Infiniband specific RPMs available at
              http://people.redhat.com/dledford/Infiniband
#9 lore raw
Quoted 6 lines · On Thursday July 3, [email protected] wrote:
Quoted 5 lines · H. Peter Anvin

Why 0xDA?

As far as I know, the closest thing there is to a registry is the list that aeb at least used to maintain.

Yes.
http://www.win.tue.nl/~aeb/partitions/partition_types-1.html
lists 0xDA as

da Non-FS Data

Added on request of John Hardin ([email protected]).

which is the closest we could come to "you won't want to look at or do anything to this partition".

Quoted 9 lines

Actually, if you are going to use version 1 superblocks anyway, then just list the partitions as normal linux partitions. The whole linux-raid-autodetect partition type was originally only for auto detect at bootup. If you weren't using that feature, then standard linux type was good enough. And if you use version 1.1 or 1.2 superblocks, then you really don't have anything to worry about since the location of the superblock and the data start offset means that the partition won't get accidentally recognized as a non-raid partition.

But if you use 1.0, then some well-meaning install program might mount one drive from a raid1 as a filesystem, write to it, and get your RAID all out of sync.

The whole point of this exercise was to find a way to make sure code that took the partition type to mean something didn't make the wrong decision. 0xDA seems the best answer for that.

NeilBrown

#10 lore raw
Quoted 10 lines · Neil Brown
Quoted 8 lines · On Thursday July 3, [email protected] wrote:

Actually, if you are going to use version 1 superblocks anyway, then just list the partitions as normal linux partitions. The whole linux-raid-autodetect partition type was originally only for auto detect at bootup. If you weren't using that feature, then standard linux type was good enough. And if you use version 1.1 or 1.2 superblocks, then you really don't have anything to worry about since the location of the superblock and the data start offset means that the partition won't get accidentally recognized as a non-raid partition.

Quoted 3 lines

But if you use 1.0, then some well-meaning install program might mount one drive from a raid1 as a filesystem, write to it, and get your RAID all out of sync.

The same is true of version 0.90.0 superblocks. It was probably a bad decision to make raid1 arrays mountable as normal filesystems in hindsight, but it did ease a lot of things at the time (like booting from a raid1 device using lilo, the only boot loader back in the day). In any case, given the number of existing 0.90.0 and 1.0 superblock systems out there, any install code that doesn't look for them is just flat deficient. So I can see your point from the stand point of wanting to correct a past mistake, but the flip side of the coin is that even if you do such a thing, any installer will still be buggy and broken for many years to come if it doesn't check for raid superblocks before treating a filesystem like a normal filesystem.

Quoted 6 lines

The whole point of this exercise was to find a way to make sure code that took the partition type to mean something didn't make the wrong decision. 0xDA seems the best answer for that.

NeilBrown

Signature · 6 lines
Doug Ledford <[email protected]>
              GPG KeyID: CFBFF194
              http://people.redhat.com/dledford

Infiniband specific RPMs available at
              http://people.redhat.com/dledford/Infiniband
#11 lore raw
Quoted 13 lines · Doug Ledford

The same is true of version 0.90.0 superblocks. It was probably a bad decision to make raid1 arrays mountable as normal filesystems in hindsight, but it did ease a lot of things at the time (like booting from a raid1 device using lilo, the only boot loader back in the day). In any case, given the number of existing 0.90.0 and 1.0 superblock systems out there, any install code that doesn't look for them is just flat deficient. So I can see your point from the stand point of wanting to correct a past mistake, but the flip side of the coin is that even if you do such a thing, any installer will still be buggy and broken for many years to come if it doesn't check for raid superblocks before treating a filesystem like a normal filesystem.

It certainly helps bootloaders wanting to boot off RAID-1. 1.2 superblocks, at the beginning but with an offset, are fine for that purpose too, but requires special handling.

-hpa

#12 lore raw
In reply to Neil Brown
Quoted 9 lines · Neil Brown
Quoted 4 lines · On Thursday July 3, [email protected] wrote:
Quoted 3 lines · H. Peter Anvin

Why 0xDA?

As far as I know, the closest thing there is to a registry is the list that aeb at least used to maintain.

Yes. http://www.win.tue.nl/~aeb/partitions/partition_types-1.html
lists 0xDA as

Quoted 7 lines

da Non-FS Data

Added on request of John Hardin ([email protected]).

which is the closest we could come to "you won't want to look at or do anything to this partition".

But that's not really what it is, either. The best would be to pick a new partition identifier entirely.

-hpa

#13 lore raw
Quoted 13 lines · H. Peter Anvin
Quoted 12 lines · Neil Brown
Quoted 5 lines · On Thursday July 3, [email protected] wrote:
Quoted 4 lines · H. Peter Anvin

Why 0xDA?

As far as I know, the closest thing there is to a registry is the list that aeb at least used to maintain.

Yes. http://www.win.tue.nl/~aeb/partitions/partition_types-1.html
lists 0xDA as

da Non-FS Data

Quoted 8 lines
Quoted 5 lines

Added on request of John Hardin ([email protected]).

which is the closest we could come to "you won't want to look at or do anything to this partition".

But that's not really what it is, either. The best would be to pick a new partition identifier entirely.

I thought that.
But then I asked why?

Couldn't come up with a decent reason.

non-fs seems to cover everything.

David

#14 lore raw
Quoted 8 lines · David Greaves

I thought that.
But then I asked why?

Couldn't come up with a decent reason.

non-fs seems to cover everything.

Seems nicer to install software.

-hpa

#15 lore raw
In reply to Neil Brown
Quoted 5 lines · Neil Brown

But if you use 1.0, then some well-meaning install program might mount one drive from a raid1 as a filesystem, write to it, and get your RAID all out of sync.

One more thing on this: this is actually fine as long as the RAID code detects the out-of-syncness. This can't be foolproof, of course, but for virtually all filesystems there is *something* in the first megabyte or so (usually within the first 128K) that is touched by almost every write -- the superblock, or its equivalent.

If the RAID code did a sanity check on the first megabyte, it would catch the vast majority of all unintentional desynchronization events.

-hpa