For some reason, when I try to rename an mdadm raid array to a textual name, the change doesn't take.
I tried the advice from this serverfault question, but to no avail.
~$ mdadm --version
mdadm - v3.1.4 - 31st August 2010
~$ sudo mdadm --detail /dev/md0
/dev/md0:
Version : 1.2
Creation Time : Tue Sep 27 08:32:32 2011
Raid Level : raid1
Array Size : 1953513424 (1863.02 GiB 2000.40 GB)
Used Dev Size : 1953513424 (1863.02 GiB 2000.40 GB)
Raid Devices : 2
Total Devices : 2
Persistence : Superblock is persistent
Update Time : Sun Oct 2 17:59:37 2011
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
Name : omicron:0 (local to host omicron)
UUID : 75c4a555:482aecd0:ade70dfc:1547926a
Events : 17
Number Major Minor RaidDevice State
0 8 80 0 active sync /dev/sdf
1 8 96 1 active sync /dev/sdg
~$ sudo mdadm --stop /dev/md0
mdadm: stopped /dev/md0
~$ sudo mdadm --assemble /dev/md/alpha --update=name /dev/sd[gf]
mdadm: /dev/md/alpha has been started with 2 drives.
~$ sudo mdadm --detail /dev/md0
/dev/md0:
Version : 1.2
Creation Time : Tue Sep 27 08:32:32 2011
Raid Level : raid1
Array Size : 1953513424 (1863.02 GiB 2000.40 GB)
Used Dev Size : 1953513424 (1863.02 GiB 2000.40 GB)
Raid Devices : 2
Total Devices : 2
Persistence : Superblock is persistent
Update Time : Sun Oct 2 18:06:11 2011
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
Name : omicron:0 (local to host omicron)
UUID : 75c4a555:482aecd0:ade70dfc:1547926a
Events : 17
Number Major Minor RaidDevice State
0 8 80 0 active sync /dev/sdf
1 8 96 1 active sync /dev/sdg
~$ cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active raid1 sdf[0] sdg[1]
1953513424 blocks super 1.2 [2/2] [UU]
md126 : active (auto-read-only) raid1 sdd[0] sde[1]
1953513424 blocks super 1.2 [2/2] [UU]
md127 : active (auto-read-only) raid1 sdb[0] sda[1]
976762496 blocks [2/2] [UU]
unused devices: <none>
As you can see, the name is still reported as omicron:0
and still reachable through the old device file. Trying sudo mdadm --detail /dev/md/alpha
will work, and report the same, wrong, name until the next reboot, when it stops working.
It seems as if when figuring out what name to put in, mdadm gets confused and just creates the device file instead.
ASIDE
Is there any way to make mdadm force an update of the name part of the superblock (i.e. explicitly set the name you want the array to have) without having to explicitly re-create the superblock? (i.e. sudo mdam --zero-superblock /dev/sd[fg]; sudo mdadm --create /dev/md/alpha --raid-devices=2 --level=1 --assume-clean --name=alpha /dev/sd[fg]
)
The problem is that after reboot, despite adding ARRAY /dev/md/alpha metadata=1.2 name=omicron:alpha UUID=c66a267...
to mdadm.conf, the named device file dissapears and is replaced with one of standard format. (/dev/md125 or similar)
How can I make a renamed mdadm array keep its name? - I.e. - How can I make ubuntu persist the device files between boots?