Skip to contentSkip to conversation

Metadata > 0.90 and auto-assemble

DISCUSSION Joshua Kinard 4 participants 5 messages Feb 22, 2015 – Feb 23, 2015 MD RAID

lore
Share & tools
lore
#0 lore raw

Hi,

I tried a while back to use the newer metadata formats on my mdadm RAID5 on a few machines, and discovered that the kernel auto-assembly will only work with v0.90 metadata, not 1.0 or greater. Is there a solid reason for this? Based one what I can find regarding the differences in the metadata formats, and looking at the existing md code, it seems this is largely just because no one has had the time or motivation to change the code to support auto-assembly on the newer metdata formats.

I am told that the "correct" solution is to embed a small initramfs to bring the RAID arrays online instead, before the real rootfs is loaded. I'd like to avoid this if possible, as I haven't had to use an initramfs for normal booting in the past, as long as I stay on metadata 0.90. So I thought I'd ask what the official stance is on this.

Thanks!,

Signature · 9 lines
Joshua Kinard
Gentoo/MIPS
[email protected]
4096R/D25D95E3 2011-03-28

"The past tempts us, the present confuses us, the future frightens us.  And our
lives slip away, moment by moment, lost in that vast, terrible in-between."

--Emperor Turhan, Centauri Republic
#1 lore raw
Quoted 4 lines · Joshua Kinard

I'd like to
avoid this if possible, as I haven't had to use an initramfs for normal booting in the past, as long as I stay on metadata 0.90. So I thought I'd ask what the official stance is on this.

https://raid.wiki.kernel.org/index.php/Autodetect

Official stance is that it's deprecated, but people still use it.

Signature · 1 line
Chris Murphy
#2 lore raw
Quoted 9 lines · Chris Murphy
Quoted 4 lines · Joshua Kinard

I'd like to
avoid this if possible, as I haven't had to use an initramfs for normal booting in the past, as long as I stay on metadata 0.90. So I thought I'd ask what the official stance is on this.

https://raid.wiki.kernel.org/index.php/Autodetect

Official stance is that it's deprecated, but people still use it.

Yeah, but it's a pretty useful feature. I can't see why autodetect for simple setups (several disks or partitions and building a basic array out of them) is maintained, while userspace autodetect is required for the more complex setups.

But I suppose this has been discussed before in detail, though I cannot find said discussion. The RAID Boot page has this one example only:

"This approach can cause problems in several situations (imagine moving part of an old array onto another machine before wiping and repurposing it: reboot and watch in horror as the piece of dead array gets assembled as part of the running RAID array, ruining it); kernel autodetect is correspondingly deprecated."

Which I find to be rather unconvincing. The cited example is a fault of the user not torching the superblock before moving the disks or trying to use them...and I've done this to myself on several occasions. mdadm --misc --zero-superblock and 'dd' saved the day in less than ~30s.

Are there any other discussions that might be more convincing, or offer up other points of view? Perhaps there's a point I've yet to consider that might be enlightening.

Thanks!,

Signature · 9 lines
Joshua Kinard
Gentoo/MIPS
[email protected]
4096R/D25D95E3 2011-03-28

"The past tempts us, the present confuses us, the future frightens us.  And our
lives slip away, moment by moment, lost in that vast, terrible in-between."

--Emperor Turhan, Centauri Republic
#4 lore raw
In reply to Joshua Kinard
Quoted 16 lines · Joshua Kinard

Hi,

I tried a while back to use the newer metadata formats on my mdadm RAID5 on a few machines, and discovered that the kernel auto-assembly will only work with v0.90 metadata, not 1.0 or greater. Is there a solid reason for this? Based one what I can find regarding the differences in the metadata formats, and looking at the existing md code, it seems this is largely just because no one has had the time or motivation to change the code to support auto-assembly on the newer metdata formats.

I am told that the "correct" solution is to embed a small initramfs to bring the RAID arrays online instead, before the real rootfs is loaded. I'd like to avoid this if possible, as I haven't had to use an initramfs for normal booting in the past, as long as I stay on metadata 0.90. So I thought I'd ask what the official stance is on this.

Quoted 8 lines

Thanks!,

--
Joshua Kinard
Gentoo/MIPS
[email protected]
4096R/D25D95E3 2011-03-28

I cannot speak to any of the reasons to support it or not but I'm a Gentoo guy since late 2002 who avoided the initramfs for the longest time. I finally bit the bullet and learned how to build it into my kernels so there are no extra files and except for a recent problem with Gentoo devs making changes to busybox defaults it's worked very well. The nice thing about building it into the kernel is that old kernels continue to work perfectly as best I can tell.

Anyway, from my perspective it was worth learning. I'm just a user type, not a dev of any type.

Cheers,
Mark

#3 lore raw
In reply to Joshua Kinard
Quoted 7 lines · On Sun, 22 Feb 2015 16:54:12 -0500 Joshua Kinard <[email protected]> wrote:
Quoted 6 lines · Chris Murphy
Quoted 4 lines · Joshua Kinard

I'd like to
avoid this if possible, as I haven't had to use an initramfs for normal booting in the past, as long as I stay on metadata 0.90. So I thought I'd ask what the official stance is on this.

Quoted 7 lines
Quoted 3 lines

https://raid.wiki.kernel.org/index.php/Autodetect

Official stance is that it's deprecated, but people still use it.

Yeah, but it's a pretty useful feature. I can't see why autodetect for simple setups (several disks or partitions and building a basic array out of them) is maintained, while userspace autodetect is required for the more complex setups.

The in-kernel autodetect is only maintained because tearing it out and throwing it away (my preferred option) would be a user-visible regression, and those are not permitted.

The user-space version is more general and more flexible. If the kernel-space version works for you, you can keep using it. But if you want features added to it, you are out of luck.

As others have said, creating a simple initrd is really not that hard. Once you spend the time to make it work, you will find that it "just works" and wonder why you ever cared before.

There is even a README.initramfs in the mdadm source. It was written 10 years ago so I cannot promise it is 100% correct, but it is a reasonably good and very simple starting point.

NeilBrown

Quoted 20 lines

But I suppose this has been discussed before in detail, though I cannot find said discussion. The RAID Boot page has this one example only:

"This approach can cause problems in several situations (imagine moving part of an old array onto another machine before wiping and repurposing it: reboot and watch in horror as the piece of dead array gets assembled as part of the running RAID array, ruining it); kernel autodetect is correspondingly deprecated."

Which I find to be rather unconvincing. The cited example is a fault of the user not torching the superblock before moving the disks or trying to use them...and I've done this to myself on several occasions. mdadm --misc --zero-superblock and 'dd' saved the day in less than ~30s.

Are there any other discussions that might be more convincing, or offer up other points of view? Perhaps there's a point I've yet to consider that might be enlightening.

Thanks!,