Linux Ubuntu 11.10 mdadm Raid 5 - Incorrect Raid Array Name

Having recently configured a Linux storage server using mdadm in Ubuntu 11.10 I experienced some problems with the array device name being rest to md127.

Configuration

I have three 1TB drives /dev/sda, /dev/sdd, /dev/sdc that are included in the RAID 5 Array using the followin mdadm command:

sudo mdadm --create /dev/md9 --level=5 --raid-devices=3 /dev/sda1 /dev/sdc1 /dev/sdd1

Issue

Once I reboot the server the array is shown as /dev/md127

Resolution;

Add the array conficguration into the /etc/mdadm/mdadm.conf file using:

sudo mdadm -Db /dev/md9 >> /etc/mdadm/mdadm.conf

The resuting mdadm.conf file will look like 

# 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
ARRAY /dev/md9 metadata=1.2 spares=1 name=spcw-linux:9 UUID=e37cd4ee:f8458d49:037bddd2:71c11c8d

It seems that the name argument is responsible for the changing of the name from md9 to md127 so edit this line and remove all the unnecessary stuff. My line now looks like this:

ARRAY /dev/md9 UUID=e37cd4ee:f8458d49:037bddd2:71c11c8d.

In addition I changed the DEVICE line to just include the partitions that I wanted in my array

DEVICE /dev/sda1 /dev/sdc1 /dev/sdd1

Last but not least update the initramfs so that ubuntu knows about the array at boot

sudo update-initramfs -u

Published in Linux