You are not logged in.

#1 2015-09-18 19:14:22

sveatlo
Member
Registered: 2015-08-04
Posts: 2

mdadm not reassembling array on boot

Hi,
I'm currently using arch on my Asus UX51VZ laptop for almost a month. I have a fakeraid setup with two 256GB SSDs using mdadm. I was using this configuration without any problems. However after I've accidentally reinstalled linux-4.1.6 package and rebooted I was greeted with a message saying unable to find root device UUID: .... (this UUID is in both fstab and lsblk -f output).
I've booted a live usb form where I can successfully both assemble the RAID device and see all of my data (chroot is working as well). I've checked /etc/mkinitcpio.conf (mdadm_udev is in its place) and run mkinitcpio -p linux (which run with no errors). I've also tried reinstalling grub, but with no success either. Later I've reinstalled mdadm, dmraid and also update to linux-4.2 but nothing changed.
Can anybody see what might be wrong? Any help will be greatly appreciated.

My mdadmd.conf:

# mdadm configuration file
#
# mdadm will function properly without the use of a configuration file,
# but this file is useful for keeping track of arrays and member disks.
# In general, a mdadm.conf file is created, and updated, after arrays
# are created. This is the opposite behavior of /etc/raidtab which is
# created prior to array construction.
#
#
# the config file takes two types of lines:
#
#       DEVICE lines specify a list of devices of where to look for
#         potential member disks
#
#       ARRAY lines specify information about how to identify arrays so
#         so that they can be activated
#
# You can have more than one device line and use wild cards. The first
# example includes SCSI the first partition of SCSI disks /dev/sdb,
# /dev/sdc, /dev/sdd, /dev/sdj, /dev/sdk, and /dev/sdl. The second
# line looks for array slices on IDE disks.
#
#DEVICE /dev/sd[bcdjkl]1
#DEVICE /dev/hda1 /dev/hdb1
#
# If you mount devfs on /dev, then a suitable way to list all devices is:
#DEVICE /dev/discs/*/*
#
#
# The AUTO line can control which arrays get assembled by auto-assembly,
# meaing either "mdadm -As" when there are no 'ARRAY' lines in this file,
# or "mdadm --incremental" when the array found is not listed in this file.
# By default, all arrays that are found are assembled.
# If you want to ignore all DDF arrays (maybe they are managed by dmraid),
# and only assemble 1.x arrays if which are marked for 'this' homehost,
# but assemble all others, then use
#AUTO -ddf homehost -1.x +all
#
# ARRAY lines specify an array to assemble and a method of identification.
# Arrays can currently be identified by using a UUID, superblock minor number,
# or a listing of devices.
#
#       super-minor is usually the minor number of the metadevice
#       UUID is the Universally Unique Identifier for the array
# Each can be obtained using
#
#       mdadm -D <md>
#
#ARRAY /dev/md0 UUID=3aaa0122:29827cfa:5331ad66:ca767371
#ARRAY /dev/md1 super-minor=1
#ARRAY /dev/md2 devices=/dev/hda1,/dev/hdb1
#
# ARRAY lines can also specify a "spare-group" for each array.  mdadm --monitor
# will then move a spare between arrays in a spare-group if one array has a failed
# drive but no spare
#ARRAY /dev/md4 uuid=b23f3c6d:aec43a9f:fd65db85:369432df spare-group=group1
#ARRAY /dev/md5 uuid=19464854:03f71b1b:e0df2edd:246cc977 spare-group=group1
#
# When used in --follow (aka --monitor) mode, mdadm needs a
# mail address and/or a program.  This can be given with "mailaddr"
# and "program" lines to that monitoring can be started using
#    mdadm --follow --scan & echo $! > /run/mdadm/mon.pid
# If the lines are not found, mdadm will exit quietly
#MAILADDR root@mydomain.tld
#PROGRAM /usr/sbin/handle-mdadm-events

ARRAY /dev/md/imsm0 metadata=imsm UUID=4f9f485d:ad8c1ad3:0f95a3c8:35e49dc6
ARRAY /dev/md/RAID0SYS_0 container=/dev/md/imsm0 member=0 UUID=a703574c:86157ccd:2f213f57:810ea8e5

My 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=""

# 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="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 autodetect block mdadm_udev keyboard fsck resume filesystems 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="lz4"

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

My fstab:

# /dev/md126p3
UUID=41cf124a-3aca-4d61-9b23-5e51cd88445e       /               ext4            rw,relatime,stripe=64,data=ordered      0 1

# /dev/md126p4
UUID=cbacfa26-0890-46bc-ae68-22d613f0cf5e       /home           ext4            rw,relatime,stripe=64,data=ordered      0 2

# /dev/md126p1
UUID=22B4-3DED          /boot           vfat            rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro    0 2

# /dev/md126p2
UUID=34aeb345-fa3a-4dad-bacd-c97fe5a13a3f       none            swap            defaults        0 0

lsblk -f output from chroot from usb drive:

NAME        FSTYPE LABEL UUID MOUNTPOINT
sda                           
└─md126                       
  ├─md126p1                   /boot
  ├─md126p2                   [SWAP]
  ├─md126p3                   /
  └─md126p4                   /home
sdb                           
└─md126                       
  ├─md126p1                   /boot
  ├─md126p2                   [SWAP]
  ├─md126p3                   /
  └─md126p4                   /home
sdc                           
├─sdc1                        
└─sdc2                        
loop0                         
loop1                         
loop2                         
loop3                         

blkid output:

/dev/sda: TYPE="isw_raid_member"
/dev/sdb: TYPE="isw_raid_member"
/dev/sdc1: UUID="2015-07-13-20-38-48-00" LABEL="MJRO0813" TYPE="iso9660" PTUUID="18247d08" PTTYPE="dos" PARTUUID="18247d08-01"
/dev/sdc2: SEC_TYPE="msdos" LABEL="MISO_EFI" UUID="C8E1-3936" TYPE="vfat" PARTUUID="18247d08-02"
/dev/loop0: TYPE="squashfs"
/dev/loop1: TYPE="squashfs"
/dev/loop2: TYPE="squashfs"
/dev/loop3: TYPE="squashfs"
/dev/md126: PTUUID="bdb2552b-bac3-4691-a6e3-8f11574b11a5" PTTYPE="gpt"
/dev/md126p1: UUID="22B4-3DED" TYPE="vfat" PARTLABEL="EFI System" PARTUUID="938e8f67-7259-4c02-a841-b04f7f6fd1e8"
/dev/md126p2: UUID="34aeb345-fa3a-4dad-bacd-c97fe5a13a3f" TYPE="swap" PARTLABEL="Linux swap" PARTUUID="8dc3fde4-ecba-42a0-ac5f-37b11917755d"
/dev/md126p3: UUID="41cf124a-3aca-4d61-9b23-5e51cd88445e" TYPE="ext4" PARTLABEL="Linux filesystem" PARTUUID="cad3a0ba-365e-49de-a117-c526b1fadd8c"
/dev/md126p4: UUID="cbacfa26-0890-46bc-ae68-22d613f0cf5e" TYPE="ext4" PARTLABEL="Linux /home" PARTUUID="6ae8c946-bdbf-4f0d-aabe-9cc3b291ace4"

I can also post any additional info, you needed.

Offline

#2 2015-09-20 17:23:55

mmturk
Member
Registered: 2015-03-17
Posts: 2

Re: mdadm not reassembling array on boot

Did you find a way to fix this? I'm having the same problem. My raid0 (intel rapid storage) is no longer detected after upgrade to mdadm 3.3.4. This is not related to the kernel but to the mdadm package. Here's the relevant bug report (closed): https://bugs.archlinux.org/task/46295

The reason is suspected to be this commit: http://git.neil.brown.name/?p=mdadm.git … bb07e1f88d

They have changed the way mdadm handles fakeraid which in turn cannot detect some fakeraid setups (that's what i understand) mine included.

Offline

#3 2015-09-29 18:32:58

jonnybel
Member
Registered: 2011-11-21
Posts: 20

Re: mdadm not reassembling array on boot

I seem to be having the same problem... Has anyone figured out a fix without downgrading the mdadm package?

Last edited by jonnybel (2015-09-29 18:44:04)

Offline

#4 2015-09-29 19:22:12

chrisberkhout
Member
Registered: 2014-04-24
Posts: 5
Website

Re: mdadm not reassembling array on boot

This will do it:

sudo pacman -Syu   # update to latest
sudo vim /usr/lib/udev/rules.d/64-md-raid-assembly.rules   # and prepend '/usr/bin/env IMSM_NO_PLATFORM=1 ' to usages of '/usr/bin/mdadm'
sudo mkinitcpio -p linux   # rebuild your init image

Beware that interoperability may be compromised by setting that. See the mdadm man page for more details.

Also, upgrading/reinstalling the mdadm package in the future will override the changes to the rules file, then after the next mkinitcpio you may not be able to boot. So, you may want to add mdadm to the IgnorePkg list in /etc/pacman.conf to avoid surprises.

It doesn't seem like IMSM_NO_PLATFORM=1 is a good default, so I'm not sure what should be done to the mdadm packag to properly resolve this issue.

Offline

#5 2015-09-30 09:12:38

seqizz
Member
Registered: 2011-04-04
Posts: 37

Re: mdadm not reassembling array on boot

chrisberkhout wrote:

This will do it:

sudo pacman -Syu   # update to latest
sudo vim /usr/lib/udev/rules.d/64-md-raid-assembly.rules   # and prepend '/usr/bin/env IMSM_NO_PLATFORM=1 ' to usages of '/usr/bin/mdadm'
sudo mkinitcpio -p linux   # rebuild your init image

Beware that interoperability may be compromised by setting that. See the mdadm man page for more details.

Also, upgrading/reinstalling the mdadm package in the future will override the changes to the rules file, then after the next mkinitcpio you may not be able to boot. So, you may want to add mdadm to the IgnorePkg list in /etc/pacman.conf to avoid surprises.

It doesn't seem like IMSM_NO_PLATFORM=1 is a good default, so I'm not sure what should be done to the mdadm packag to properly resolve this issue.


Thanks! I really want to hug you. It's working again. Is there a bug report for this?

Couldn't believe just a simple upgrade can break whole boot by not recognizing d*mn root disk..


Creeds matter very little… The optimist proclaims that we live in the best of all possible worlds; and the pessimist fears this is true. So I elect for neither label. - James Branch Cabell

Offline

#6 2015-10-08 18:22:30

netkrash
Member
From: Viña del Mar, Chile.
Registered: 2003-03-19
Posts: 95

Re: mdadm not reassembling array on boot

excelent, this solves the issue, thank you so much!


GNU/Linux: Share & Enjoy!

Offline

#7 2022-05-15 15:28:00

matvey00z
Member
Registered: 2022-05-15
Posts: 1

Re: mdadm not reassembling array on boot

chrisberkhout wrote:

Also, upgrading/reinstalling the mdadm package in the future will override the changes to the rules file, then after the next mkinitcpio you may not be able to boot. So, you may want to add mdadm to the IgnorePkg list in /etc/pacman.conf to avoid surprises.

Or you can add a pacman hook for patching the udev rule. Here's what I use for myself: https://github.com/matvey00z/arch-intel-raid

$ cat /etc/pacman.d/hooks/89-mkinitcpio-preinstall.hook
[Trigger]
Type = Path
Operation = Install
Operation = Upgrade
Target = usr/lib/udev/rules.d/64-md-raid-assembly.rules

[Action]
Description = Patching initrd mdadm command
When = PostTransaction
Exec = /bin/bash /etc/pacman.d/hooks/89-mkinitcpio-preinstall.sh

$ cat /etc/pacman.d/hooks/89-mkinitcpio-preinstall.sh
#/bin/bash

sed -i -E \
    's$"(/usr/bin/mdadm|/sbin/mdadm)$"/usr/bin/env IMSM_NO_PLATFORM=1; \1$g' \
    /usr/lib/udev/rules.d/64-md-raid-assembly.rules

Offline

Board footer

Powered by FluxBB