Results 1 to 4 of 4

Thread: mdadm changes from /dev/md0 to /dev/md/<ip-address>:0 on reboot of EC2

  1. #1
    Join Date
    Oct 2011
    Beans
    3

    mdadm changes from /dev/md0 to /dev/md/<ip-address>:0 on reboot of EC2

    I am using the Ubuntu 64 bit AMI and I have been trying to get an EBS raid setup. I can set it up fine the first time:

    Code:
    sudo mdadm --create --verbose /dev/md0 --level=10 --raid-devices=4 /dev/xvdg /dev/xvdh /dev/xvdi /dev/xvdj
    And it works as expected:

    Code:
    sudo mdadm --detail --scan
    ARRAY /dev/md0 metadata=1.2 name=ip-10-194-231-137:0 UUID=11e83c1e:93f9be80:23012aeb:c0ea17b3
    But when I reboot the instance and do a scan it shows:

    Code:
    ARRAY /dev/md/ip-10-194-231-137:0 metadata=1.2 name=ip-10-194-231-137:0 UUID=11e83c1e:93f9be80:23012aeb:c0ea17b3
    Where is it getting the
    Code:
    /ip-10-194-231-137:
    from? How do I get it to just be
    Code:
    /dev/md0
    on reboot?

  2. #2
    Join Date
    Jul 2010
    Location
    Michigan, USA
    Beans
    2,136
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: mdadm changes from /dev/md0 to /dev/md/<ip-address>:0 on reboot of EC2

    I'm betting your /etc/mdadm/mdadm.conf file isn't setup correctly. What's the output of this?

    Code:
    cat /etc/mdadm/mdadm.conf
    You can create a proper file like this
    Code:
    echo "DEVICE partitions" > /etc/mdadm/mdadm.conf
    echo "HOMEHOST fileserver" >> /etc/mdadm/mdadm.conf
    echo "MAILADDR  youruser@gmail.com" >> /etc/mdadm/mdadm.conf
    mdadm --detail --scan >> /etc/mdadm/mdadm.conf

  3. #3
    Join Date
    Oct 2011
    Beans
    3

    Re: mdadm changes from /dev/md0 to /dev/md/<ip-address>:0 on reboot of EC2

    Most of the config file are stock from the apt-get install, except the last two lines which I added:

    Code:
    # mdadm.conf
    #
    # Please refer to mdadm.conf(5) for information about this file.
    #
    
    # by default, scan all partitions (/proc/partitions) for MD superblocks.
    # alternatively, specify devices to scan, using wildcards if desired.
    DEVICE partitions
    
    # auto-create devices with Debian standard permissions
    CREATE owner=root group=disk mode=0660 auto=yes
    
    # automatically tag new arrays as belonging to the local system
    HOMEHOST <system>
    
    # instruct the monitoring daemon where to send mail alerts
    MAILADDR root
    
    # definitions of existing MD arrays
    
    # This file was auto-generated on Tue, 13 Mar 2012 23:07:43 +0000
    # by mkconf $Id$
    
    DEVICES /dev/xvdg /dev/xvdh /dev/xvdi /dev/xvdj
    ARRAY /dev/md0 metadata=1.2 name=ip-10-194-231-137:0 UUID=11e83c1e:93f9be80:23012aeb:c0ea17b3
    I got the ARRAY information from doing a `mdadm --detail /dev/md0` when I created the raid initially.

    I just tried rebooting again and now I am getting `/dev/md127` when I do a `df -h`. I tried removing the `name=` as it talks about in another post and it still shows up as `/dev/md127`.

    But, when I did `sudo update-initramfs -u` and restarted it seemed to pick things up correctly. I'm not sure if removing the `name=` portion of the conf file was needed, but the update seems to have done the trick.

  4. #4
    Join Date
    Jul 2010
    Location
    Michigan, USA
    Beans
    2,136
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: mdadm changes from /dev/md0 to /dev/md/<ip-address>:0 on reboot of EC2

    Nope, the sudo update-initramfs -u is what fixed your problem, but you shouldn't have needed to run it unless you changed something with your array. Oh well, please mark the thread as solved under the thread tools at the top.

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
  •