MDADM Cannot mount / or /overlay using preinit script at boot

I'm testing out this: Extroot with RAID1 to mount my md0 using a preinit script but the extroot is always mounted before, no matter what I set it to as priority like 71_ or 50_

It seems that rc.d overwrites this, has anyone an idea about the preinit scripts and mdadm ?

My ideal was to do LVM on md0 but it seems that LVM is not possible (at all) in this case so I wanted to do a extroot on md then which is no option as well.

I hope someone can help out!


Is there really no-one with an asnwer ? I see non-working solutions everywhere so people like to have this working!

To make usage of mdraid you need support from the OS. Beside that the answer was given already:

Feel free to implment this. IMO this would be a waste of time. Extroot is slow anyway even with a software raid. Most devices running out of space are lacking cpu and ram also.


As you can see someone says he does use it, but after that I don't see anything else worthy.

You might think raid1 is overkill, I'm not into speed (then I would zo RAID10 ofcourse), I'm into reliabillity and HA for extroot. No downtime!

I see. Feel free to make your own build with configuration files included. Don't forget to adjust uuids.

This cannot be implemented universally. You would need the uuid of the drive the user is adding in advance. What would work only if you format blindly every attached drive with a specific uuid which cannot be random. But uuids have to be random to avoid conflicts.

Extroot cannot be an automatic process also.


Sure I already did, the problem is that mdadm is always started to late. I also tested this with LVM as I wanted to use this as well. Both compbined and seperated.

So I'm trying to figure out, why do people say they have/had it working but it doesn't seem to ? Raid itself runs fine after starting, love it!

The "bottleneck" is either the hardware (cpu, ssd or hdd, i/o interfaces) and/or the processes/services (waiting for other processes to finish; other dependent process is starting before/after) launching on startup.

You did already what can be done with changing priority. As this thread is older things could have changed. You have to look into the scripts in /lib/preinit to see what is going on.

But if I look at the 71_myload_raid script I see it is relaying on initramfs/initrd. OpenWrt is not using initramfs/initrd by default. It might be the writer is using a x86 based system using initramfs? So the issue is there.

1 Like

Strange thing is I see it starting in the logs, it cannot find the mountpoint for extroot, then it mounts extroot normally and you I see mdadm stopped and being started again.

So in some way it is started.

Need to investigate, tips/examples are welcome so I can update some topic here and there so more people can use it.

Perhaps you should stop using OpenWrt for weird things it wasn't designed to support, replacing it with a general-purpose Linux distribution.

1 Like

Perhaps you don't like to improve things, I do and lots of people with me :wink:

(why are there so many packages for openWRT anyhow and what are you doing here then ?!)

Not really.
It's just I've seen many people who try to achieve their goal using unsuitable tools.
They spend days and weeks and mostly fail.
But, even if they eventually succeed, the wasted time is rarely worth the effort.
And typically, they could get the same result working out of the box with the right tools.

1 Like

openwrt has supported initrd for a loooooooong time... as has the buildroot and compiling in kernel modules needed at boottime...

only an absence of skills, patience and a willingness to learn stand between you and your goal.... improve your skills and knowledge, then you can look at improving those of others... and / or passing an informed judgement on what is and is not available...

1 Like

Already spend quite some time on it... as it's running smooth I can look into the startup more as needed to do some more fancy stuff on Linux clusters in the time between :slight_smile:

It's worth the effort, trust me, lots of reasons for it!