You are not logged in.

#1 2026-09-29 07:04:26

noio-or-something
Member
Registered: 2026-09-29
Posts: 5

Missing or incomplete documentation for mdadm_udev?

I was tweaking a few things, including some stuff about my boot process and - well, I'll get to the point:

The mdadm_udev hook requires the base hook or else md arrays never get assembled on boot, which might result in the boot process getting stuck and the user confused for several hours. I couldn't find any documentation anywhere that spells this out. Looked all over - the wiki's mkinitcpio and RAID articles don't mention it (mdadm points to RAID), and even skimming through the actual file at /usr/lib/initcpio/install/mdadm_udev gave no hint that it's required.

I'm not sure if this is a bug or not. Whether the right move would have been to (figure out how to) send a bug report or edit the wiki accordingly.

Offline

#2 2026-09-29 07:37:51

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,102

Re: Missing or incomplete documentation for mdadm_udev?

https://wiki.archlinux.org/title/Mkinitcpio#Hook_list
base is absolutely required for the busybox approach, it's optional for systemd only - what does your HOOKS array actually look like and do you need the base hook or busybox instead of systemd?

mdadm_udev only adds some files (services, binaries and modules) to the initramfs - you can frame the build function w/ "set -x" / "set +x" to trace the behavior (and see whether it differs based on the base hook)

the boot process getting stuck and

Remove the quiet parameter - can you tell *where* it gets stuck?

Offline

#3 2026-09-30 00:45:52

noio-or-something
Member
Registered: 2026-09-29
Posts: 5

Re: Missing or incomplete documentation for mdadm_udev?

Thanks for your reply! Yeah I should've clarified, I use the systemd approach. The wiki now claims it's the default and personally I try to follow defaults whenever possible.

HOOKS=( base systemd autodetect microcode modconf kms plymouth keyboard block mdadm_udev sd-encrypt filesystems )

Root partition is on md -> luks -> btrfs and is unlocked with tpm2-device=auto on crypttab, placed into the UKI.

With plymouth and quiet off, I just see "A start job is running for /dev/md0" plus the same for the partition within md0, waits for 1m30s. Then sulogin fails likely because base isn't present (SYSTEMD_SULOGIN_FORCE=1 was set). I also ran the build with set -x as suggested and there were no differences (beside the "/tmp/mkinitcpio.randomstring" and other expected differences).

While I was poking at it again I noticed the last sentence in the help text.

This hook loads the necessary modules for a RAID array and uses incremental
assembly via udev at runtime to create the devices. This hook will NOT work
without the udev hook included on the image.

The table in the wiki article implies systemd replaces the need for the udev hook and in another system I have it working fine like that.

And... just to be completely 100% sure, I tried adding udev without base. Didn't work, of course.

Offline

#4 2026-09-30 08:00:17

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,102

Re: Missing or incomplete documentation for mdadm_udev?

wiki now claims it's the default

It is.
It's also OTR to not work w/ some setups (eg. ZFS)

If we can figure what's wrong w/ your setup the result should be a bug against mkinitcpio or a comment in the wiki.

systemd replaces the need for the udev hook and in another system I have it working fine like that

Is the other system also encrypted & using tpm?
Both are legit raids (multiple disks)?

Offline

#5 2026-10-01 21:49:46

noio-or-something
Member
Registered: 2026-09-29
Posts: 5

Re: Missing or incomplete documentation for mdadm_udev?

seth wrote:

Is the other system also encrypted & using tpm?
Both are legit raids (multiple disks)?

It's not encrypted. I don't use that system often so I misremembered.

I did some experimenting to try narrowing it down.
On that system, I set up a RAID volume on the side and added it to the boot process. Encountered no issues regardless of the base hook being there or not.
On a new VM, I put the root partition on luks on md. No tpm, just manual password entry. Same issue, resolved by adding base. I decrypted it so the root partition was on md only. Once again, same issue: base hook required.
The failure's the same each time. "A start job is running for ...", "Timed out waiting for device ...". Add the base hook back and it succeeds.

I think this narrows it down to just the mdadm_udev hook being the issue. It seems to need something either in the already accessible root partition, or provided by base, or else it fails.

Offline

#6 2026-10-01 22:15:58

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,102

Re: Missing or incomplete documentation for mdadm_udev?

https://gitlab.archlinux.org/archlinux/ … type=heads
=> /usr/lib/initcpio/install/base
Possibly one of

    add_binary kmod
    for applet in {dep,ins,rm,ls}mod mod{probe,info}; do
        add_symlink "/usr/bin/$applet" kmod
    done

    add_binary blkid
    map add_binary mount umount

You could comment the other additions and see whether the hook is still sufficient - then try to narrow it down.
I don't expect it to be mount/umount either

Offline

#7 Yesterday 00:37:39

noio-or-something
Member
Registered: 2026-09-29
Posts: 5

Re: Missing or incomplete documentation for mdadm_udev?

None of those worked, but busybox itself did. I got some outside help at this point and was sent a bit of code that logs each usage of busybox. It captured one thing only:

/bin/sh -c -- modprobe md_mod

If needed, I put debug logs for that part of the boot process here: https://pastebin.com/sVqGCRVj - search for "busybox called". At this point I have no ideas on how to dig any deeper.

Also: the fsck hook did something via /bin/sh too, but I didn't look into it.

Offline

#8 Yesterday 06:16:19

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,102

Re: Missing or incomplete documentation for mdadm_udev?

What if you remove the base package and add md_mod to the MODULES ?

Offline

#9 Yesterday 18:12:51

noio-or-something
Member
Registered: 2026-09-29
Posts: 5

Re: Missing or incomplete documentation for mdadm_udev?

It worked! Both on the VM and my actual machine.

Offline

#10 Yesterday 20:03:53

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,102

Re: Missing or incomplete documentation for mdadm_udev?

Then you found the bug; Is md_mod still added to the initramfs (lsinitcpio will tell) w/o the explicit entry?
Do you have an account at https://gitlab.archlinux.org/archlinux/ … work_items ?

Offline

Board footer

Powered by FluxBB