FS#25566 - [linux,mdadm] After update to kernel 3.0, mdadm 3.2.2-3 soft raid not start

Attached to Project: Arch Linux
Opened by Nevyansk (gardarea51) - Sunday, 14 August 2011, 08:41 GMT
Last edited by Tobias Powalowski (tpowa) - Saturday, 17 September 2011, 10:36 GMT
Task Type Bug Report
Category Kernel
Status Closed
Assigned To Tobias Powalowski (tpowa)
Thomas Bächler (brain0)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
Hello!
Yesterday i update&upgrade my system up to kernel 3.0. I haved soft raid 1 (mdadm). After reboot raid not start i i going to ramfs$. Before i see messages:

triggering uevents.. udevd[243]: failed to execute '/sbin/mdadm '/sbin/mdadm' --incremental /dev/sdb1: no such file or directory

And so on for each patritions. After:

Running HOOK [mdadm]
mdadm: Can not start array: no such device

In mkinitcpio.conf i verified HOOKS=(...sata mdadm filesystems...). But.. I installed the new system, copied the initrd image to target system. And i see "udev waiting 10 xrconds for /dev/md1... error.. ramfs$. I see cat /proc/mdstat - raid conctructed! But it not load. I checked all the settings: /boot/grub/menu.lst, /etc/fstab/, /etc/mdadm.conf, they are true, but system not start.

Additional info:
* config and/or log files etc. (I am writing from memory .. )
/boot/grub/menu.lst
# (0) Arch Linux
title Arch Linux
root (hd0,0)
kernel /vmlinuz26 root=/dev/md3 md=1,/dev/sda1,/dev/sdb1 md=3,/dev/sda3,/dev/sdb3 ro vga=773
initrd /kernel26.img

/etc/fstab
/dev/md1 /boot ext4 defaults 0 1
/dev/md2 swap swap defaults 0 0
/dev/md3 / ext4 defaults 0 1

/etc/mdadm.conf
ARRAY /dev/md1 level=raid1 num-devices=2 UUID=dde9e6ac:7f32795c:52419904:51489ef3
ARRAY /dev/md2 level=raid1 metadata=1.2 num-devices=2 UUID=25d42d8a:c3567d8e:2760e202:b0790d8e
ARRAY /dev/md3 level=raid1 metadata=1.2 num-devices=2 UUID=87660c29:51a92156:ad112320:06debf3d

Steps to reproduce:
I could not run the system on an array, so I had to disconnect a drive from the array, repartition it, restore these files above (md1>sda1,md2>sda2,md3>sda3) and run the system with the 1st disc.

Let me remind you that this happened after the update, it's bug?

[root@tux ~]# pacman -Qi mdadm
Название : mdadm
Версия : 3.2.2-3
URL : http://www.cse.unsw.edu.au/~neilb/source/mdadm/
Лицензии : GPL
Группы : base
Предоставляет : Нет
Зависит от : glibc
Дополнительно : Нет
Требуется пакетами : Нет
Конфликтует с : mkinitcpio<0.7
Заменяет : raidtools
Размер установленного : 972,00 K
Сборщик : Tobias Powalowski <tpowa@archlinux.org>
Архитектура : i686
Дата сборки : Ср. 03 авг. 2011 12:56:54
Дата установки : Сб. 13 авг. 2011 23:44:04
Причина установки : Явно установлен
Установочный скрипт : Yes
Описание : A tool for managing/monitoring Linux md device arrays, also known as Software RAID

[root@tux ~]# pacman -Qi linux
Название : linux
Версия : 3.0.1-1
URL : http://www.kernel.org/
Лицензии : GPL2
Группы : base
Предоставляет : kernel26
Зависит от : coreutils linux-firmware module-init-tools>=3.16 mkinitcpio>=0.7
Дополнительно : crda: to set the correct wireless channels of your country
Требуется пакетами : Нет
Конфликтует с : kernel26
Заменяет : kernel26
Размер установленного : 55156,00 K
Сборщик : Thomas Bächler <thomas@archlinux.org>
Архитектура : i686
Дата сборки : Сб. 06 авг. 2011 20:55:48
Дата установки : Сб. 13 авг. 2011 14:05:49
Причина установки : Явно установлен
Установочный скрипт : Yes
Описание : The Linux Kernel and modules
This task depends upon

Closed by  Tobias Powalowski (tpowa)
Saturday, 17 September 2011, 10:36 GMT
Reason for closing:  Fixed
Additional comments about closing:  mdadm-3.2.2-4
Comment by Jelle van der Waa (jelly) - Monday, 15 August 2011, 10:57 GMT
is your mkinitcpio image valid?
Comment by Nevyansk (gardarea51) - Monday, 15 August 2011, 11:02 GMT
Yes, he was right. But.. He was with another system, it is portable (fallback-image i686 -> i686)? And any case, after updating the array is not working from native mkinitcpio image (non-fallback).
Comment by Frantic Fan (Frantic) - Thursday, 25 August 2011, 20:10 GMT
I've had the exact same problem.

Updated from 2.6 to 3.0 kernel and my root array was failing to boot due to missing /sbin/mdadm.

Resolution:
We assume /dev/md0 is your root and you mdadm --assemble it on the livecd.
mount /dev/md0 /mnt/
mkinitcpio -b /mnt/ -p linux # use /mnt/ as root, build an image using the linux preset
Now your image has /sbin/mdadm.

What is causing it:
When you updated via pacman, kernel was updated before mdadm.
The old mdadm hook used /sbin/mdassemble to assemble the arrays.
mkinitcpio was ran before the mdadm package was updated, hence you get the bug.
I'm not 100% sure on this, but it looks like this in my case, since I see in my pacman.log that mkinitcpio complained about an old mdadm hook format, and it didn't complain when I rebuilt my image.

To check your image contents, bsdtar -tf /mnt/boot/image.img
Comment by Thomas Bächler (brain0) - Thursday, 25 August 2011, 21:59 GMT
The times when mdassemble was used for RAID is loooong ago. Very long. I doubt you would get that problem when upgrading now.
Comment by Nevyansk (gardarea51) - Friday, 26 August 2011, 03:25 GMT
Hello!
I also boot from liveCD and consctruct array, but command:
mkinitcpio -b /mnt/ -p linux # use /mnt/ as root, build an image using the linux preset
I forget /mnt as root.. =) Whatever it was, not only I ran into this problem. Thanks for solution! This may help other people, I decided not to risk it and put it on the server other Linux system, it should have been done on this day, time... time. =)
Comment by Tobias Powalowski (tpowa) - Wednesday, 14 September 2011, 09:54 GMT
should be fixed with 3.2.2-4, please confirm.

Loading...