You are not logged in.

#1 2011-07-03 18:26:36

DeKay
Member
Registered: 2008-11-15
Posts: 14

[Solved] mdadm fails in initrd when trying to assemble root array

Hi.  I installed arch on my new core i5 setup with a Gigabyte Z68 based motherboard using the 2010 net-based ISO.  I have two 640GB sata disks that I have set up for raid0 for /boot, /swap, and root partitions, plus a Windows 7 setup.  I am also using grub2, since I couldn't get grub to work for the life of me in this setup. 

Waiting 10 seconds for device /dev/disk/by-uuid/6c49f82c-22bb-4a02-9bcd-df719fd6516f …
Root device ‘/dev/disk/by-uuid/6c49f82c-22bb-4a02-9bcd-df719fd6516f’ doesn’t exist. Attempting to create it.
ERROR: Unable to determine major/minor number of root device ‘/dev/disk/by-uuid/6c49f82c-22bb-4a02-9bcd-df719fd6516f’.
You are being dropped to a recovery shell.

I can boot into a livecd, chroot, and assemble the array just fine, but I can't do it from the recovery shell because it is complaining that the drives are busy.  My chainloaded Windows 7 grub entry boots up with no problems.

Things I have tried:

  • disabling uuids in the grub config file and using dev numbers instead

  • unedited /lib/initcpio/install/mdadm vs the tweaked version I list below

  • no autodetect hook in /etc/mkinitcpio.conf.  Also tried adding md_mod MODULE.

  • uncommenting "#DEVICE partitions" in /etc/mdadm.conf and deleting the UUID lines at the bottom of the file

  • pacman -Syu.  System is up-to-date and running kernel 2.6.39

  • anything else I can think of

Installed grub2 as per the wiki using this.  It reports installation with no errors detected.

  • grub-mkconfig -o /boot/grub/grub.cfg

  • grub-install --no-floppy --modules="raid" /dev/sda

  • grub-install --no-floppy --modules="raid" /dev/sdb

Various changes to mkinitcpio and friends were followed with:

pacman -Sf kernel26

Some details of various files with comments stripped out.  All this stuff collected after booting the livecd and chrooting.

/etc/mkinitcpio.conf

MODULES="raid1 dm_mod"
BINARIES=""
FILES=""
HOOKS="base udev autodetect pata scsi sata mdadm filesystems"

/boot/grub/grub.cfg

menuentry 'Arch Linux, with Linux vmlinuz26' --class archlinux --class gnu-linux --class gnu --class os {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod raid
    insmod mdraid1x
    insmod part_msdos
    insmod part_msdos
    insmod ext2
    set root='(mduuid/506f0dacb1bc6ef6944930bf3f382d2a)'
    search --no-floppy --fs-uuid --set=root 6cd00358-a8d6-4ea4-8e07-d7c485acd6a5
    echo    'Loading Linux vmlinuz26 ...'
    linux    /vmlinuz26 root=/dev/disk/by-uuid/6c49f82c-22bb-4a02-9bcd-df719fd6516f ro  
    echo    'Loading initial ramdisk ...'
    initrd    /kernel26.img
}

/lib/initcpio/install/mdadm (see https://bbs.archlinux.org/viewtopic.php?id=121327)

install ()
{
    MODULES=" $(checked_modules "drivers/md/*" | grep -v "dm-") "
    BINARIES=""
    FILES=""
    add_binary "/sbin/mdadm" 
    add_file "/lib/udev/rules.d/64-md-raid.rules"
}

/etc/mdadm.conf

#DEVICE partitions
ARRAY metadata=imsm UUID=5be8632b:10e0d417:50017c6e:5e58f073
ARRAY /dev/md/Volume0 container=5be8632b:10e0d417:50017c6e:5e58f073 member=0 UUID=2397ffc3:315893d9:dabcf9a7:b244effd
ARRAY /dev/md/0 metadata=1.2 UUID=506f0dac:b1bc6ef6:944930bf:3f382d2a name=archiso:0
ARRAY /dev/md/1 metadata=1.2 UUID=e19437cb:257b25d6:4e97c524:d2887d3d name=archiso:1
ARRAY /dev/md/2 metadata=1.2 UUID=0b7b2e44:9152d237:00edd81f:febbfe5b name=archiso:2

ls -lF /dev/disk/by-uuid  (Question: Why don't numbers here match /etc/mdadm.conf?)

total 0
lrwxrwxrwx 1 root root  9 Jul  3 04:32 6bc3f3e1-a048-465f-a8c1-fcde83461082 -> ../../md1
lrwxrwxrwx 1 root root  9 Jul  3 04:32 6c49f82c-22bb-4a02-9bcd-df719fd6516f -> ../../md2
lrwxrwxrwx 1 root root  9 Jul  3 04:32 6cd00358-a8d6-4ea4-8e07-d7c485acd6a5 -> ../../md0
lrwxrwxrwx 1 root root 10 Jul  3 04:31 845d207e-16de-4c40-8dd1-d0898b7cae1d -> ../../sdc1
lrwxrwxrwx 1 root root 10 Jul  3 04:31 9E1EBE0E1EBDDF87 -> ../../sdb2
lrwxrwxrwx 1 root root 10 Jul  3 04:31 DE6CD6F46CD6C685 -> ../../sda1

blkid

/dev/sda1: LABEL="System Reserved" UUID="DE6CD6F46CD6C685" TYPE="ntfs" 
/dev/sda2: UUID="9E1EBE0E1EBDDF87" TYPE="ntfs" 
/dev/sda3: UUID="506f0dac-b1bc-6ef6-9449-30bf3f382d2a" UUID_SUB="bc52740f-6214-233a-077a-9c27b8fe4afd" LABEL="archiso:0" TYPE="linux_raid_member" 
/dev/sda5: UUID="e19437cb-257b-25d6-4e97-c524d2887d3d" UUID_SUB="5963e006-f1e2-95af-7923-8668772564b2" LABEL="archiso:1" TYPE="linux_raid_member" 
/dev/sda6: UUID="0b7b2e44-9152-d237-00ed-d81ffebbfe5b" UUID_SUB="2438c30d-8736-794e-776e-15a8cac54048" LABEL="archiso:2" TYPE="linux_raid_member" 
/dev/sdb1: LABEL="System Reserved" UUID="DE6CD6F46CD6C685" TYPE="ntfs" 
/dev/sdb2: UUID="9E1EBE0E1EBDDF87" TYPE="ntfs" 
/dev/sdb3: UUID="506f0dac-b1bc-6ef6-9449-30bf3f382d2a" UUID_SUB="49897d1b-c39b-14c6-48e4-e7d651df3125" LABEL="archiso:0" TYPE="linux_raid_member" 
/dev/sdb5: UUID="e19437cb-257b-25d6-4e97-c524d2887d3d" UUID_SUB="632896ec-3df0-26a2-2af7-8e474ff63515" LABEL="archiso:1" TYPE="linux_raid_member" 
/dev/sdb6: UUID="0b7b2e44-9152-d237-00ed-d81ffebbfe5b" UUID_SUB="f9755894-bd8d-1312-d4a1-b447d7897573" LABEL="archiso:2" TYPE="linux_raid_member" 
/dev/sdc1: UUID="845d207e-16de-4c40-8dd1-d0898b7cae1d" TYPE="ext4" 
/dev/sdd1: LABEL="ARCH_201005" TYPE="udf" 
/dev/loop0: TYPE="squashfs" 
/dev/loop1: TYPE="squashfs" 
/dev/md0: UUID="6cd00358-a8d6-4ea4-8e07-d7c485acd6a5" TYPE="ext4" 
/dev/md1: UUID="6bc3f3e1-a048-465f-a8c1-fcde83461082" TYPE="swap" 
/dev/md2: UUID="6c49f82c-22bb-4a02-9bcd-df719fd6516f" TYPE="ext4"

I'd appreciate any help.  I've spent a couple days now trying to sort this out and it is killing me.  Thanks in advance.

Last edited by DeKay (2011-07-09 15:24:43)

Offline

#2 2011-07-03 19:06:36

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [Solved] mdadm fails in initrd when trying to assemble root array

What does ...cat /proc/mdstat have to say?

My ls -IF doesn't agree with mdadm either but I am booted into raid0.

My raid iuses grub2 but is not as complex as yours.

Last edited by lilsirecho (2011-07-03 19:15:28)


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#3 2011-07-03 19:22:08

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [Solved] mdadm fails in initrd when trying to assemble root array

Perhaps the mkinitcpio file has to be setup.................


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#4 2011-07-03 20:45:40

DeKay
Member
Registered: 2008-11-15
Posts: 14

Re: [Solved] mdadm fails in initrd when trying to assemble root array

lilsirecho, thanks for looking at this.  When you say "Perhaps the mkinitcpio file has to be setup", what would you change from what I showed in my original message?  I did add the mdadm hook and the raid and dm_mod modules.  As for your other question:

cat /proc/mdstat after failure in initrd

Personalities : [raid1] 
md126 : active (read-only) raid1 sda[1] sdb[0]
     625129472 blocks super external:/md127/0 [2/2] [UU]

md127 : inactive sdb[1](S) sda[0](S)
     4514 blocks super external::imsm

unused devices: <none>

cat /proc/mdstat within chroot for comparison

Personalities : [raid1] 
md2 : active raid1 sda6[0] sdb6[1]
      419906777 blocks super 1.2 [2/2] [UU]
      
md1 : active raid1 sda5[0] sdb5[1]
      9766392 blocks super 1.2 [2/2] [UU]
      
md0 : active raid1 sda3[0] sdb3[1]
      40150 blocks super 1.2 [2/2] [UU]
      
unused devices: <none>

And just for grins, here is /etc/fstab

# 
# /etc/fstab: static file system information
#
# <file system>        <dir>         <type>    <options>          <dump> <pass>
devpts                 /dev/pts      devpts    defaults            0      0
shm                    /dev/shm      tmpfs     nodev,nosuid        0      0
/dev/md0 /boot ext4 defaults 0 1
/dev/md1 swap swap defaults 0 0
/dev/md2 / ext4 defaults 0 1

Offline

#5 2011-07-03 21:46:19

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [Solved] mdadm fails in initrd when trying to assemble root array

Perhaps your grub is identifying the devices in a different order than you expect.  Bios sequences are "guessed" in grub AFAICT.  This would generate a different uuid based on the bios sequence according to googling ...

CONFIG_EDD may be a module in the kernel and has some info on the system.

Basically, it is grub and bios sequencing which introduces the differences.  Sata is usually first.  In my machine I think that is correct, however, I recall that if I have a drive in IDE, it becaomes Hd0 and may then be first....

Most of my use is sata based and the order is stable.

With just three devices connected to sata ports, the order is predictable.  I can select the bios boot order by channel ID's ...on my mobo..C2m,C2s,c3m c3s for the four sata ports.

I will take a gander at my grub2, which I haven't inspected and might have some info about the sequence in that file.


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#6 2011-07-03 22:04:45

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [Solved] mdadm fails in initrd when trying to assemble root array

My grub at boot prompt :

set root= (hd0,1)
linux/vmlinuz26 root=/dev/disk/by-uuid/03ec1B30-80bb-4c2c-96ad-52206b6-a68b2\ rootfstype=ext3 ro
initrd/kernel26.img

This uuid is not the mdadm uuid for md0.

The boot device is sda1, sdb1 is swap and  /root  is md0 ( sda2/sdb2).

It is likely the uuid for sda.  I will check that.


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#7 2011-07-03 22:25:48

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [Solved] mdadm fails in initrd when trying to assemble root array

Here is a list of block id's for my raid system:

sh-4.2# blkid /dev/sdb1
/dev/sdb1: UUID="45345eb2-a5e6-46de-bc91-e842bfb7dfdd" TYPE="swap"
sh-4.2# blkid /dev/sda1
/dev/sda1: UUID="b4dfdae5-12f3-4a1c-8580-9e49badbcc09" TYPE="ext2"
sh-4.2# blkid /dev/sda2
/dev/sda2: UUID="03f68724-8228-9c81-4805-28ac779171a6" UUID_SUB="b43e1830-5cf8-5916-d34c-f6d735ecd6d3" LABEL="(none):0" TYPE="linux_raid_member"
sh-4.2# blkid /sdb2
sh-4.2# blkid /dev/sdb2
/dev/sdb2: UUID="03f68724-8228-9c81-4805-28ac779171a6" UUID_SUB="d7cbc06e-3d48-0ed2-87c4-4f138e7f1d49" LABEL="(none):0" TYPE="linux_raid_member"
sh-4.2# blkid /dev/md0
/dev/md0: UUID="03ec1b30-80bb-4c2c-96ad-53360b6a68b2" TYPE="ext3"
sh-4.2#

Should you search your system for the same data may give you some help.


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#8 2011-07-03 23:19:31

DeKay
Member
Registered: 2008-11-15
Posts: 14

Re: [Solved] mdadm fails in initrd when trying to assemble root array

lilsirecho, you said earlier that "This uuid is not the mdadm uuid for md0", but it is (03ec1b...).  Mine is consistent with that (md2 is my root at 6c49f82..., as you can see from the blkid data in my first message.  The differences in the grub root don't seem to be the problem as I am getting past that point.  So I believe I am doing the same thing you are doing, but the problem is that my md2 root is not properly assembling in initrd while yours is.  What does your /etc/mdadm.conf look like?

Offline

#9 2011-07-03 23:44:26

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [Solved] mdadm fails in initrd when trying to assemble root array

Mdadm.conf

ARRAY /dev/md0 metadata=1.2 name=(none):0 UUID=03f68724:82289c81:480$
ARRAY /dev/md0 metadata=1.2 name=(none):0 UUID=03f68724:82289c81:480$


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#10 2011-07-04 00:08:39

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [Solved] mdadm fails in initrd when trying to assemble root array

Further info...

sh-4.2# mdadm --examine /sdb2
mdadm: cannot open /sdb2: No such file or directory
sh-4.2# mdadm --examine /dev/sdb2
/dev/sdb2:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Array UUID : 03f68724:82289c81:480528ac:779171a6
           Name : (none):0
  Creation Time : Sat Jul  2 10:43:31 2011
     Raid Level : raid0
   Raid Devices : 2

Avail Dev Size : 31083727 (14.82 GiB 15.91 GB)
    Data Offset : 2048 sectors
   Super Offset : 8 sectors
          State : clean
    Device UUID : d7cbc06e:3d480ed2:87c44f13:8e7f1d49

    Update Time : Sat Jul  2 10:43:31 2011
       Checksum : 7bc8ffdc - correct
         Events : 0

     Chunk Size : 512K

   Device Role : Active device 1
   Array State : AA ('A' == active, '.' == missing)
sh-4.2# mdadm --examine /dev/sda2
/dev/sda2:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Array UUID : 03f68724:82289c81:480528ac:779171a6
           Name : (none):0
  Creation Time : Sat Jul  2 10:43:31 2011
     Raid Level : raid0
   Raid Devices : 2

Avail Dev Size : 31083727 (14.82 GiB 15.91 GB)
    Data Offset : 2048 sectors
   Super Offset : 8 sectors
          State : clean
    Device UUID : b43e1830:5cf85916:d34cf6d7:35ecd6d3

    Update Time : Sat Jul  2 10:43:31 2011
       Checksum : d0cc17ca - correct
         Events : 0

     Chunk Size : 512K

   Device Role : Active device 0
   Array State : A


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#11 2011-07-04 00:33:42

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [Solved] mdadm fails in initrd when trying to assemble root array

More info:


/etc/fstab: static file system information
#
# <file system>        <dir>         <type>    <options>          <d$
devpts                 /dev/pts      devpts    defaults            0$
shm                    /dev/shm      tmpfs     nodev,nosuid        0$
UUID=03ec1b30-80bb-4c2c-96ad-53360b6a68b2 / ext3 defaults 0 1
UUID=45345eb2-a5e6-46de-bc91-e842bfb7dfdd swap swap defaults 0 0
UUID=b4dfdae5-12f3-4a1c-8580-9e49badbcc09 /boot ext2 defaults 0 1


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#12 2011-07-04 00:51:05

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [Solved] mdadm fails in initrd when trying to assemble root array

More info:


sh-4.2# mdadm --misc --detail /dev/md0
/dev/md0:
        Version : 1.2
  Creation Time : Sat Jul  2 10:43:31 2011
     Raid Level : raid0
     Array Size : 31083520 (29.64 GiB 31.83 GB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

    Update Time : Sat Jul  2 10:43:31 2011
          State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
  Spare Devices : 0

     Chunk Size : 512K

           Name : (none):0
           UUID : 03f68724:82289c81:480528ac:779171a6
         Events : 0

    Number   Major   Minor   RaidDevice State
       0       8        2        0      active sync   /dev/sda2
       1       8       18        1      active sync   /dev/sdb2
sh-4.2#


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#13 2011-07-04 17:06:27

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [Solved] mdadm fails in initrd when trying to assemble root array

I include my ..cat /proc/mdstat:


sh-4.2# cat /proc/mdstat
Personalities : [raid0]
md0 : active raid0 sda2[0] sdb2[1]
      31083520 blocks super 1.2 512k chunks
     
unused devices: <none>


I note your post includes data referencing ...Personalities as (raid 1)

A note on grub limits...2TB... Dunno your sizes for sure.....

I don't know the particulars for grub2 but grub 0.9 has 2TB limit.

Perhaps there should only be one raid 1 and two others as raid0?

Don't fathom why chroot allows differences.

Not enough background experience to determine if the 2TB limit applies to each element or the total of all elements in the raid .

Perhaps it doesn't apply anyway(likely) since your problem hasn't been involved with grub when creating raid in mdadm.....

Just a bunch of irrelevant thoughts!!!!!


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#14 2011-07-04 18:11:09

DeKay
Member
Registered: 2008-11-15
Posts: 14

Re: [Solved] mdadm fails in initrd when trying to assemble root array

My drives are 640GB so no issue there.  And there shouldn't be any limitation on quantities of RAID0 vs RAID1.

I am getting tired of fighting with this.  Unless someone can offer some insight to what is wrong with my setup by this evening, I think I'll reinstall without RAID and, once I've got something running, try converting over.  This is a new install, so it would be faster to try this than continue trying to figure out what is going on.

Offline

#15 2011-07-05 17:01:45

99Percent
Member
Registered: 2011-06-11
Posts: 32

Re: [Solved] mdadm fails in initrd when trying to assemble root array

what do you want to assemble? a raid0 or a raid1? It seems you have both drives on raid1 that will make the second drive always a copy of the first drive and therefore the second drive "disappears".

try adding raid0 besides raid1 in /etc/mkinitcpio.conf:

MODULES="raid 0 raid1 dm_mod"

See how I set up my raid0 in this thread: https://bbs.archlinux.org/viewtopic.php?id=121650

Offline

#16 2011-07-09 15:22:30

DeKay
Member
Registered: 2008-11-15
Posts: 14

Re: [Solved] mdadm fails in initrd when trying to assemble root array

I finally figured this out.  I had specified the two drives to be in a RAID configuration within the BIOS.  When that is going, it looks like you can't take the softraid approach and MUST use fakeraid instead.  I followed https://wiki.archlinux.org/index.php/Fakeraid and it worked perfectly.

Last edited by DeKay (2011-07-09 15:25:13)

Offline

Board footer

Powered by FluxBB