Results 1 to 7 of 7

Thread: mdadm changes the name of my new array to md127...

  1. #1
    Join Date
    Oct 2010
    Beans
    59

    mdadm changes the name of my new array to md127...

    THIS THREAD HAS BEEN SOLVED! SEE EDIT AT THE BOTTOM OF THIS ORIGINAL POST!

    Hello everyone,

    This has been bugging me for some time now. Every time I create a new array using mdadm the name is changed from what I originally specified.

    Here's what I'm doing.

    Created the array from two new disks:

    Code:
    mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sdc1 /dev/sdd1
    Made the filesystem:

    Code:
    mkfs.ext3 /dev/md0
    Updated mdadm.conf:

    Code:
    mdadm --detail --scan >> /etc/mdadm/mdadm.conf
    Added the array to /etc/fstab:

    Code:
    /dev/md0 /mnt/mymountpoint ext3 defaults 0 1
    Everything looks great... until I reboot the machine.

    Upon reboot I receive the message that the filesystem on /dev/md0 is either missing or busy. I skip this... and then discover that my new array is no longer called /dev/md0.

    Now, it is /dev/md127.

    What am I doing wrong? This happens every time I create an array and on multiple different systems. I'm assuming that I'm just being an idiot here but your help is greatly appreciated as I would prefer for my arrays to retain the name I specify when creating them.

    Thank you!

    SOLVED:

    For anyone that may Google this thread:

    Yes, running 'sudo update-initramfs -u' fixed the problem for me!

    Thanks for the help, everyone!
    Last edited by ooboontwo; March 27th, 2015 at 06:15 PM. Reason: SOLVED!

  2. #2
    Join Date
    Nov 2009
    Location
    Catalunya, Spain
    Beans
    14,570
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: mdadm changes the name of my new array to md127...

    I have no idea why it happens, but it might be related to using the --detail --scan to make the entry in mdadm.conf. Now that I am thinking about it, something similar happened to me recently but only for a new array after using --detail --scan to make the entry. Two arrays that were created during OS install kept their names.

    Searching on google, I solved it like this: Open mdadm.conf and in the ARRAY definition for md0 keep only the /dev/md0 and the UUID. Nothing else. Delete the device name (machine name) if it's there. Save and close the file and reboot.

    That solved it for me. One blog I found says the /dev/mdX and the UUID are enough in the ARRAY definition. mdadm uses the uuid to assemble the array anyway so it makes sense.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 18.04 LTS 64bit

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

    Re: mdadm changes the name of my new array to md127...

    Darko's directions are correct. After you update your mdadm.conf file, you should also update your initramfs like this.
    Code:
    sudo update-initramfs -u

  4. #4
    Join Date
    Nov 2009
    Location
    Catalunya, Spain
    Beans
    14,570
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: mdadm changes the name of my new array to md127...

    Yes, I forgot the initramfs update. Thanks rubylaser.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 18.04 LTS 64bit

  5. #5
    Join Date
    Feb 2015
    Beans
    3

    Re: mdadm changes the name of my new array to md127...

    Using the UUID in the fstab is always the best practice

  6. #6
    Join Date
    Oct 2010
    Beans
    59

    Re: mdadm changes the name of my new array to md127...

    Thank you for the replies, everyone. I haven't had a chance to test it out but I will as soon as I can! Hoping this solves the problem. Thanks again!

  7. #7
    Join Date
    Oct 2010
    Beans
    59

    Re: mdadm changes the name of my new array to md127...

    For anyone that may Google this thread:

    Yes, running 'sudo update-initramfs -u' fixed the problem for me!

    Thanks for the help, everyone!

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
  •