Mailinglist Archive: opensuse-bugs (2746 mails)

< Previous Next >
[Bug 826727] New: mkinitrd selects wrong md device from where to mount root file system
  • From: bugzilla_noreply@xxxxxxxxxx
  • Date: Tue, 25 Jun 2013 19:39:50 +0000
  • Message-id: <>

Summary: mkinitrd selects wrong md device from where to mount
root file system
Classification: openSUSE
Product: openSUSE 12.3
Version: Final
Platform: x86-64
OS/Version: openSUSE 12.3
Status: NEW
Severity: Major
Priority: P5 - None
Component: Basesystem
AssignedTo: bnc-team-screening@xxxxxxxxxxxxxxxxxxxxxx
ReportedBy: martti.laaksonen@xxxxxxxxxxxxx
QAContact: qa-bugs@xxxxxxx
Found By: ---
Blocker: ---

User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:21.0) Gecko/20100101

In a LVM root system, where there are several (>10) LVM logical volumes created
on top different MD devices, mkinitrd creates an invalid mdadm.conf which
activates wrong MD device during boot so the kernel is not able mount its root
file system.

In my system I have the following LVM and MD setup:
darkside:~ # pvs
PV VG Fmt Attr PSize PFree
/dev/md2 sys lvm2 a-- 80.00g 0
/dev/md3 virtual lvm2 a-- 93.07g 18.07g
darkside:~ # vgs
VG #PV #LV #SN Attr VSize VFree
sys 1 4 0 wz--n- 80.00g 0
virtual 1 9 1 wz--n- 93.07g 18.07g
darkside:~ # lvs
LV VG Attr LSize Pool Origin Data% Move Log Copy%
home sys -wi-ao--- 40.00g
root sys -wi-ao--- 20.00g
tmp sys -wi-ao--- 10.00g
var sys -wi-ao--- 10.00g
centos5 virtual -wi-a---- 10.00g
centos6 virtual owi-a-s-- 10.00g
centos6-snap virtual swi-a-s-- 10.00g centos6 11.30
debian-6 virtual -wi-a---- 10.00g
freebsd9 virtual -wi-a---- 10.00g
scientific6 virtual -wi-a---- 10.00g
zfs1 virtual -wi-a---- 5.00g
zfs2 virtual -wi-a---- 5.00g
zfs3 virtual -wi-a---- 5.00g
darkside:~ # lvdisplay -c
darkside:~ #
darkside:~ # cat /etc/mdadm.conf
DEVICE containers partitions
ARRAY /dev/md/0 UUID=b7155105:16de1826:2f21e0a9:e303082c
ARRAY /dev/md/1 UUID=fee74ee8:6d2c68d9:8cbaec5a:01978ab6
ARRAY /dev/md/2 UUID=d309bc4b:e43890f1:b60bc8d9:d4c76f77
ARRAY /dev/md/3 UUID=8d2857fb:7c3ead15:caa04a0d:1e290036
darkside:~ # ll /dev/md*
brw-rw---- 1 root disk 9, 0 Jun 25 17:35 /dev/md0
brw-rw---- 1 root disk 9, 1 Jun 25 17:35 /dev/md1
brw-rw---- 1 root disk 9, 2 Jun 25 17:35 /dev/md2
brw-rw---- 1 root disk 9, 3 Jun 25 17:35 /dev/md3

total 0
lrwxrwxrwx 1 root root 6 Jun 25 17:35 0 -> ../md0
lrwxrwxrwx 1 root root 6 Jun 25 17:35 1 -> ../md1
lrwxrwxrwx 1 root root 6 Jun 25 17:35 2 -> ../md2
lrwxrwxrwx 1 root root 6 Jun 25 17:35 3 -> ../md3
darkside:~ #

But the mdadm.conf generated for the initrd looks like shown below:
AUTO -all
ARRAY /dev/md/3 metadata=1.2 name=darkside.localnet:3
ARRAY /dev/md/1 metadata=1.0 name=linux:1

Reproducible: Always

Steps to Reproduce:
1. Create several MD devices (RAID configuration shouldn't matter in this case)
during initial installation, e.g.
md0 - /boot
md1 - swap
md2 - LVM2
2. Create a LVM volume group and several logical volumes on top of the md2
devices (root file system is on one of the LVs), e.g.
3. Create another MD device (md3) after installation, add it to another LVM
volume group, and create several logical volumes on it so that there will be
more than 10 logical volumes in total (both volume groups combined).
4. Run mkinitrd
5. Boot the system using the generated initrd image.
Actual Results:
The system boot fails when the kernel tries mount root file system, because the
MD device containing the root file system hasn't been activated.

Expected Results:
The correct MD device containing root file system is activated during boot.

Modifying the /usr/lib/mkinitrd/scripts/ where volume group name
is resolved by making sed match from the end of the line, like shown below

vg_name=$(lvdisplay -c 2> /dev/null | sed -n

seems to fix the problem.

Actually, the match anything part at the beginning then becomes redundant and
could be removed altogether.

Configure bugmail:
------- You are receiving this mail because: -------
You are on the CC list for the bug.

< Previous Next >
Follow Ups