You are not logged in.

#1 2015-11-10 00:00:32

madman_xxx
Member
From: PL
Registered: 2013-07-31
Posts: 35

raid0 / mdadm - mkinitcpio fails to autodetect all modules

Hello,

after recent update I couldn't boot my system. It turned out the mkinitcpio script does not include all the necessary modules to assemble my RAID0 volume. Looking up the sources I found:

/usr/lib/initcpio/install/autodetect

...
45:    # scan for md raid devices
46:    md_devs=(/sys/class/block/md*/md/level)
47:    if [[ -e $md_devs ]]; then
48:        quiet "found %d mdadm arrays to scan" "${#md_devs[*]}"
49:        mapfile -t mods < <(awk '{ gsub(/raid[456]/, "raid456"); print; }' "${md_devs[@]}")
50:        for m in "${mods[@]}"; do
51:            _autodetect_cache["$m"]=1
52:        done
53:    fi
...

This successfuly detects the required raid0 module, but misses its dependency, dm-mod

/usr/lib/initcpio/install/mdadm_udev

...
4: add_checked_modules -f 'dm-' 'drivers/md/*'
...

Because the autodetection finds only the raid0 module, this adds nothing, as no 'dm-' - prefixed modules were previously detected.

OK, great - I know where the problem lies, but I have difficulties with the decision where actually should the fix be applied:

  1. The autodetection should also check for modules' dependencies and include them

  2. If autodetection finds any RAID volume, it should include dm-mod by default.

  3. The udev_adm hook should include dm-mod by default

Any pros and cons of the above options are highly anticipated.

Offline

#2 2015-11-10 03:39:36

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: raid0 / mdadm - mkinitcpio fails to autodetect all modules

FWIW, I include those modules in my initrd explicitly so as not to rely on autodetection (among other critical modules):

MODULES="ext4 dm_mod dm_crypt aes_x86_64 raid1"

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2015-11-10 23:58:45

madman_xxx
Member
From: PL
Registered: 2013-07-31
Posts: 35

Re: raid0 / mdadm - mkinitcpio fails to autodetect all modules

jasonwryan wrote:

FWIW, I include those modules in my initrd explicitly so as not to rely on autodetection (among other critical modules):

MODULES="ext4 dm_mod dm_crypt aes_x86_64 raid1"

Yeah, I have a similiar configuration now, but it's an ugly workaround; In your case ext4 and raid1 are 99 % autodetected, so they shouldn't be there. I think that's against the idea behind autodetection.

Also, I can see that aes_x86_64, which is not autodetected, is a dependency of aesni_intel, so you have another incarnation of the problem described here... So all this would mean that including dependent modules is the right way to go. Will contact the mkinitcpio maintainers to get their opinion.

Offline

Board footer

Powered by FluxBB