Results 1 to 9 of 9

Thread: [10.04] mdadm.conf & initrd

  1. #1
    Join Date
    Jul 2010
    Beans
    12

    [10.04] mdadm.conf & initrd

    Having issues on a fresh 10.04 install: on boot I felt into the initramfs shell saying the (RAID5) root mount point is not found.

    After hours of research, I found that the mdadm.conf from initrd was guilty : I had to run a liveCD to extract and modify my initramfs, forcing /dev/sd[abc]x instead of the UUID style for the array detection into mdadm.conf. Automatic array assembly by superblock's UUID doesn't seem to work on initramfs, despite correct UUIDs (double checked): the same mdadm.conf is successfully mounting my arrays under LiveCD (sudo mdadm --assemble --scan).


    The caveats is that I have to do it each time my initrd is updated ! Any ideas on how to fix this permanently ?

  2. #2
    Join Date
    Jun 2006
    Location
    Nux Jam
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: [10.04] mdadm.conf & initrd

    there are lot of raid issues around, and os-probe is not fixed yet

  3. #3
    Join Date
    Jul 2010
    Beans
    12

    Re: [10.04] mdadm.conf & initrd

    Quote Originally Posted by dino99 View Post
    there are lot of raid issues around, and os-probe is not fixed yet
    Maybe. But how to force initramfs tools to put MY settings instead ?

  4. #4
    Join Date
    Dec 2006
    Beans
    Hidden!

    Re: [10.04] mdadm.conf & initrd

    Quote Originally Posted by nono240 View Post
    I found that the mdadm.conf from initrd was guilty : I had to run a liveCD to extract and modify my initramfs, forcing /dev/sd[abc]x instead of the UUID style for the array detection into mdadm.conf. Automatic array assembly by superblock's UUID doesn't seem to work on initramfs, despite correct UUIDs (double checked): the same mdadm.conf is successfully mounting my arrays under LiveCD (sudo mdadm --assemble --scan).
    I am experiencing the exact same problem. My RAID volumes assemble just fine in Rescue mode off the install CD, but initramfs can't seem to accomplish the task.

    Would you mind explaining your solution in a little more depth?

    Thanks,
    Last edited by plwrenn; July 7th, 2010 at 03:04 PM. Reason: typo

  5. #5
    Join Date
    Jul 2010
    Beans
    12

    Re: [10.04] mdadm.conf & initrd

    Quote Originally Posted by plwrenn View Post
    Would you mind explaining your solution in a little more depth?

    1- Run your LiveCD
    2- Mount your /boot partition if any
    3- Extract your initrd to a temporary folder
    4- Edit your etc/mdadm.conf to not use UUID but device name instead:

    Find and replace :
    ARRAY /dev/md1 UUID=xxxxxxxxxxxxxxxxxxxxxxx
    by
    ARRAY /dev/md1
    /dev/sd[abc]1

    5- Repack your initrd.

    It works for me.

  6. #6
    Join Date
    Dec 2006
    Beans
    Hidden!

    Re: [10.04] mdadm.conf & initrd

    Yeah, that works for me too!

    Which project do you think I should file a bug report with? initramfs-tools or mdadm

    Doing that every time a kernel update drops will get old quickly.

  7. #7
    Join Date
    Jul 2010
    Beans
    12

    Re: [10.04] mdadm.conf & initrd

    Quote Originally Posted by plwrenn View Post
    Yeah, that works for me too!

    Which project do you think I should file a bug report with? initramfs-tools or mdadm

    Doing that every time a kernel update drops will get old quickly.

    Not sure about the guilty, maybe none of both since UUID style array detection is working once booted. So it's maybe a missing module into initramfs. What do you think ?

  8. #8
    Join Date
    Dec 2006
    Beans
    Hidden!

    Re: [10.04] mdadm.conf & initrd

    Quote Originally Posted by nono240 View Post
    So it's maybe a missing module into initramfs. What do you think ?
    Maybe so, but I really don't know either.

    I copied the edited mdadm.conf from the initrd image to /etc/mdadm/mdadm.conf. That's the file that the mdadm hook in initramfs-tools pulls when building the initrd for a new kernel.

    That should prevent us from having to repack the initrd after each kernel upgrade.
    Last edited by plwrenn; July 8th, 2010 at 04:44 PM. Reason: typo

  9. #9
    Join Date
    Jul 2009
    Beans
    10

    Re: [10.04] mdadm.conf & initrd

    Hey guys,

    I know this thread is getting to be months old, but I thought I would share my tutorial with you. I have spend DAYS trying to get this configured correctly. I still have flickers of problems with mdadm on 10.04. Every once in awhile when I reboot I will get a waiting for disk press s to skip. OR, like you said I will get dropped into initramfs. It is rare that it even happens, and i'm not sure what actually causes it. And if I do a hard reboot, it boots up just fine. Here is what I have found to be the most successfull:

    (starting with two drives that i will be raiding together for storage):

    ****THIS WILL DESTROY EVERYTHING ON THE DISKS:****

    Drive one:
    fdisk /dev/sdb
    d to delete any partitions
    w to write changes
    fdisk /dev/sdb
    d to make sure no more partitions exist
    n for new partition
    p for primary
    1 for partition number 1
    defaults the rest of the way
    t to add flag
    fd to add raid flag
    w to write changes

    format partition:
    mkfs.ext4 /dev/sdb1

    Drive 2:
    Repeat all the above steps for /dev/sdc

    <---Create RAID Using mdadm--->

    mdadm --create /dev/md0 --level=0 --raid-devices=2 /dev/sdb1 /dev/sdc1


    it will show a warning and ask if you want to continue to create the array? y

    cat /proc/mdstat

    to make sure array is done being created.

    mkfs.ext4 /dev/md0

    wait for it to complete

    mdadm --auto-detect

    to detect array

    mdadm --detail --scan


    The output will look something like this (depending on your arrays):
    mdadm: md device /dev/md/d0 does not appear to be active.
    ARRAY /dev/md0 level=raid1 num-devices=2 metadata=00.90 UUID=02a3fb05:e090a494:1b1a320b:21b9bdd9


    copy the "ARRAY" line above to mdadm.conf right under # definitions of existing MD arrays (remove "metadata=00.90" from the line though).
    ARRAY /dev/md0 level=raid1 num-devices=2 UUID=02a3fb05:e090a494:1b1a320b:21b9bdd9

    now get the UUID of your array from BLKID and add it to fstab as such:
    UUID=bcceef2f-fad8-41bc-893d-f29b65a2cf0f /YourMountPoint ext4 defaults 0 0

    # mount -a

    Hope this helps someone, and if anyone figures out if i am missing something that is causing to drop to initramfs or waiting for disk errors every once in awhile on boot, please share!

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •