Skip to contentSkip to conversation

Strange raid device numbering

DISCUSSION J.A. Magallón 2 participants 2 messages Oct 7, 2010 – Oct 8, 2010

lore
Share & tools
lore
#0 lore raw

Hi...

I'm running kernel 2.6.36-rc6.
I have just built a simple raid0 array with two disks, and I followed what I had always done:

raid=/dev/md0
ndisk=2
disks="/dev/sda1 /dev/sdb1"
block=4
chunk=256

stride=$((chunk/block))
stripe=$((stride*ndisk))

for i in $disks
do

    mdadm --zero-superblock --force $i

done
mdadm -C -f -v $raid --level=0 --chunk=$chunk -n $ndisk $disks sleep 5
mdadm -S $raid
mdadm --assemble $raid $disks
mkfs.ext4 -b $((block*1024)) -E stride=$stride,stripe-width=$stripe $raid

Strangely, after I reboot, the system insists in numbering it as md127, instead of md0.

Why ?
How can I force it to be md0 ? (its half aesthetics, half curiosity...)

TIA

Signature · 2 lines
J.A. Magallon <jamagallon()ono!com>     \               Software is like sex:
                                         \         It's better when it's free
#1 lore raw

Hi J.A.,

Quoted 5 lines · J.A. Magallón

Hi...

I'm running kernel 2.6.36-rc6.
I have just built a simple raid0 array with two disks, and I followed what I had always done:

[snip /]

Quoted 5 lines

Strangely, after I reboot, the system insists in numbering it as md127, instead of md0.

Why ?
How can I force it to be md0 ? (its half aesthetics, half curiosity...)

I'm gonna guess that you have some combination of an initramfs, and/or you don't have an /etc/mdadm.conf, and/or you haven't updated your initramfs with the latest copy of it.

Raid auto-assembly in the kernel uses the minor numbers in the superblock (if it can). Assembly by mdadm without instructions from mdadm.conf uses minor numbers from 127 and down. (This may have changed in mdadm in the last few months, but I recently switched from kernel auto-assembly to initramfs assembly, so I can't say for sure.)

I've chosen to *not* use mdadm.conf, and find all of my devices with "LABEL=" syntax.

HTH,

Phil