mdadm puts wrong devices in array on boot Correct mdadm.conf file

107

Solution 1

I think I found it, it was a problem with my mdadm.conf file not being specific enough and possibly confusing for the OS.

So I read this: http://manpages.ubuntu.com/manpages/hardy/man5/mdadm.conf.5.html

And I found that if I use this

DEVICE partitions

Then:

This will cause mdadm to read /proc/partitions and include all devices and partitions found therein

So I've changed it to

DEVICE /dev/sd[abcd]1

Solution 2

You probably need to rebuild your initrd so that it has the correct mdadm.conf file in it because the boot process has to use that version until it can get the root filesystem mounted.

What you need to do is something like this:

mkinitrd /boot/initrd-<kernel-version>.img <kernel-version>

I'm assuming here that the CentOS version you're using is still using mkinitrd - if it has switched to dracut then you will want:

dracut /boot/initramfs-<kernel-version>.img <kernel-version>

In either case you will need to rename the old file first before you can build the new one.

Solution 3

mdadm should be able to asseble a md device. It seems as it is seeing some wrong drives:

md127 : inactive sda[2] sdb[3]

That looks like it's taking the whole sda and sdb disks for the raid array, and not the partitions sda1 sdb1 sdc1 sdd1.

What does blkid show? what does mdadm -E /dev/sda or mdadm -E /dev/sdb show?

Maybe there is something strange going on with the superblocks.

As TomH said you should also try to rebuild initrd.

Share:
107

Related videos on Youtube

grp zeneszerzo
Author by

grp zeneszerzo

Updated on September 18, 2022

Comments

  • grp zeneszerzo
    grp zeneszerzo over 1 year

    I have a very simple LINQ expression here, but I don't see why it doesn't work.

    I have a function like this:

    public FileResult ImageForMovie(Int32? ID)
    {
        String image = _entities.Movies
                                .Where(x => x.movie_ID == ID)
                                .Select(x => x.filename)
                                .First();
    
        return File("~/images/" + image, "image/jpg");
    }
    

    I don't get any errors, but the selection doesn't give any results. The view is okay, because if I write directly the image source, it gives the picture.

  • beatbreaker
    beatbreaker almost 13 years
    The root file system is getting mounted no problems so I don't know if this step is necessary. The raid is on a different mount just for storage.
  • beatbreaker
    beatbreaker almost 13 years
    Ok blkid is here along with mdadm -E pastebin.com/gUM3S5dm I think I can see that md0 now has a completely different UUID in that output so I'll try that
  • Jure1873
    Jure1873 almost 13 years
    The two UIDs should be the same, so try fixing that and see if it helps. But I don't know an easy way to do that.