Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#35959 - Cannot assemble Intel Matrix RAID arrays on boot with mdadm

Attached to Project: Arch Linux
Opened by Teo Mrnjavac (teo) - Friday, 28 June 2013, 13:06 GMT
Last edited by Dave Reisner (falconindy) - Friday, 23 August 2013, 01:30 GMT
Task Type Bug Report
Category System
Status Closed
Assigned To No-one
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
This bug happens when Arch is installed on an Intel Rapid Storage (Intel Matrix) RAID array, managed with mdadm. mdadm -As assembles the Intel Matrix container, its arrays and partitions correctly, with the procedure described at http://bertrandbenoit.blogspot.it/2011/07/manage-intel-raid-under-gnulinux-using.html
The only difference from normal Linux soft RAID is passing -e imsm to mdadm so it reads Intel Matrix metadata. This all works fine in a booted environment, but there seems to be no way to assemble the arrays correctly at boot.

Placing the mdadm hook in the HOOKS array in mkinitcpio.conf always leads to a segfault in mdassemble, so all I could try were various combinations of mdadm_udev in HOOKS. None work. In all cases, in the initrd, right after running early hook udev and then uevents, I get a message about /dev/md/RAID0SYS_0p5 (my root partition, tried with /dev/md125p5 and UUID as well) not existing and I'm thrown into the initrd shell. At that time, some of the md devices exist in /dev (in my case only the imsm0 device, which represents the Intel Matrix container, as mdadm sees it). The partitions do not exist anywhere in /dev. I just run mdadm -As (--assemble --scan) and everything is assembled correctly, then I can just exit and boot resumes correctly. No other manual intervention except mdadm -As is needed during boot in the initrd, with the /etc/mdadm.conf as reported below.

As a horrible temporary workaround, I have added the line mdadm -As in /usr/lib/initcpio/init_functions at the beginning of resolve_device(). This at least allows me to boot without manual intervention in the initrd shell every time, but it's obviously not a solution.

Additional info:
* package version(s):
core/linux 3.9.7-1 (base)
core/mkinitcpio 0.14.0-1
core/mdadm 3.2.6-4 (base)

* config and/or log files etc.
% cat /etc/mdadm.conf
ARRAY /dev/md/imsm0 metadata=imsm UUID=8e383f71:53f6e9a6:c92989ef:95f190d1
ARRAY /dev/md/RAID0RST_0 container=/dev/md/imsm0 member=1 UUID=bd2f77ef:7b830080:a86d22f7:b2d5dd1f
ARRAY /dev/md/RAID0SYS_0 container=/dev/md/imsm0 member=0 UUID=aceff348:bdd4eece:0059eec4:e261b3c8

% la /dev/md
total 0
drwxr-xr-x 2 root root 240 28/06/2013 10:08 ./
drwxr-xr-x 19 root root 3200 28/06/2013 10:08 ../
lrwxrwxrwx 1 root root 8 28/06/2013 10:08 imsm0 -> ../md127
lrwxrwxrwx 1 root root 8 28/06/2013 10:08 RAID0RST_0 -> ../md126
lrwxrwxrwx 1 root root 8 28/06/2013 10:08 RAID0SYS_0 -> ../md125
lrwxrwxrwx 1 root root 10 28/06/2013 10:08 RAID0SYS_0p1 -> ../md125p1
lrwxrwxrwx 1 root root 10 28/06/2013 10:08 RAID0SYS_0p2 -> ../md125p2
lrwxrwxrwx 1 root root 10 28/06/2013 10:08 RAID0SYS_0p3 -> ../md125p3
lrwxrwxrwx 1 root root 10 28/06/2013 10:08 RAID0SYS_0p4 -> ../md125p4
lrwxrwxrwx 1 root root 10 28/06/2013 10:08 RAID0SYS_0p5 -> ../md125p5
lrwxrwxrwx 1 root root 10 28/06/2013 10:08 RAID0SYS_0p6 -> ../md125p6
lrwxrwxrwx 1 root root 10 28/06/2013 10:08 RAID0SYS_0p7 -> ../md125p7

The last 3 are in order: root, home, swap. Boot is from UEFI with rEFInd on p1.

Kernel line from rEFInd: options "ro root=/dev/md/RAID0SYS_0p5 rootfstype=ext4 acpi_osi=Linux systemd.unit=graphical.target resume=/dev/md/RAID0SYS_0p7"
Tried with "domdadm" too as suggested by random people on the internet, no effect.

I also tried with different modules in mkinitcpio.conf, no luck.
% cat /etc/mkinitcpio.conf
# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run. Advanced users may wish to specify all system modules
# in this array. For instance:
# MODULES="piix ide_disk reiserfs"
MODULES="md_mod ext4 raid0 asus-nb-wmi"

# BINARIES
# This setting includes any additional binaries a given user may
# wish into the CPIO image. This is run last, so it may be used to
# override the actual binaries included by a given hook
# BINARIES are dependency parsed, so you may safely ignore libraries
BINARIES="/sbin/mdmon"

# FILES
# This setting is similar to BINARIES above, however, files are added
# as-is and are not parsed in any way. This is useful for config files.
FILES=""

# HOOKS
# This is the most important setting in this file. The HOOKS control the
# modules and scripts added to the image, and what happens at boot time.
# Order is important, and it is recommended that you do not change the
# order in which HOOKS are added. Run 'mkinitcpio -H <hook name>' for
# help on a given hook.
# 'base' is _required_ unless you know precisely what you are doing.
# 'udev' is _required_ in order to automatically load modules
# 'filesystems' is _required_ unless you specify your fs modules in MODULES
# Examples:
## This setup specifies all modules in the MODULES setting above.
## No raid, lvm2, or encrypted root is needed.
# HOOKS="base"
#
## This setup will autodetect all modules for your system and should
## work as a sane default
# HOOKS="base udev autodetect block filesystems"
#
## This setup will generate a 'full' image which supports most systems.
## No autodetection is done.
# HOOKS="base udev block filesystems"
#
## This setup assembles a pata mdadm array with an encrypted root FS.
## Note: See 'mkinitcpio -H mdadm' for more information on raid devices.
# HOOKS="base udev block mdadm encrypt filesystems"
#
## This setup loads an lvm2 volume group on a usb device.
# HOOKS="base udev block lvm2 filesystems"
#
## NOTE: If you have /usr on a separate partition, you MUST include the
# usr, fsck and shutdown hooks.
#HOOKS="base udev mdadm_udev autodetect modconf block filesystems keyboard fsck shutdown"
HOOKS="base udev autodetect modconf block mdadm_udev resume filesystems keyboard fsck shutdown"


# COMPRESSION
# Use this to compress the initramfs image. By default, gzip compression
# is used. Use 'cat' to create an uncompressed image.
COMPRESSION="gzip"
#COMPRESSION="bzip2"
#COMPRESSION="lzma"
#COMPRESSION="xz"
#COMPRESSION="lzop"

# COMPRESSION_OPTIONS
# Additional options for the compressor
#COMPRESSION_OPTIONS=""


Steps to reproduce:
1) Install Arch on Intel Matrix Raid/Intel Rapid Storage.
2) Configure RAID as above.
3) Can't boot from partition on RAID array unless manually executing mdadm -As in initrd shell.

From what I gather, some people on other distros have also had trouble booting from imsm.

I realize this is uncomfortable to test. I'm available as teo- on Freenode for testing, debugging and providing any other info you may need.
This task depends upon

Closed by  Dave Reisner (falconindy)
Friday, 23 August 2013, 01:30 GMT
Reason for closing:  Upstream
Additional comments about closing:  Not a packaging bug -- mdadm doesn't properly support all ISW RAID arrays.
Comment by Dave Reisner (falconindy) - Tuesday, 09 July 2013, 02:24 GMT
What happens if you boot without the /etc/mdadm.conf? You'll need to rename it so that mkinitcpio doesn't pick up the file and add it (or modify the install hook in /usr/lib/initcpio/install/mdadm_udev). Do the /dev/md12* nodes get created?

Alternatively, even with the mdadm.conf, does running 'udevadm trigger --action=add' from the rescue shell cause the array to be assembled?
Comment by Teo Mrnjavac (teo) - Tuesday, 09 July 2013, 09:36 GMT
Without an /etc/mdadm.conf, no /dev/md* nodes are created at all. Still without mdadm.conf, 'udevadm trigger --action=add' doesn't seem to have any effect, but mdadm -As assembles the containers and arrays correctly.

With the mdadm.conf added back into the initrd (mkinitcpio picks it up), again no md nodes are created, even with udevadm, but I've noticed that 'udevadm trigger --action=add --verbose' creates them all (which doesn't make sense since --verbose is supposed to just add more output, but I've confirmed that this happens consistently). The reboot right after that surprisingly booted normally without ever dropping to the rescue shell, but the next one dropped to rescue as usual. Race in udevadm maybe?
Comment by Dave Reisner (falconindy) - Tuesday, 09 July 2013, 17:34 GMT
> Race in udevadm maybe?
Unlikely, since all udevadm does here is write 'add' to a bunch of files in sysfs. More likely a kernel bug. Would suggest taking this up with the MD folks.

Loading...