Using Mdadm To Create A Software Mirror On Top Of Multipath Devices (Doc ID 565835.1)

Last updated on OCTOBER 07, 2008

Applies to:

Linux Kernel - Version: 2.6
Linux x86-64
Intel Based Server LINUX


The mdadm(8) tool was used to create a software RAID mirror using two device-mapper-multipath devices:

# /sbin/mdadm /dev/md0 --create --verbose --level=1 --raid-devices=2 /dev/mapper/ocrp1 /dev/mapper/ocrmirrorp1
The setup was then confirmed:
# /sbin/mdadm --detail /dev/md0
  Number   Major   Minor   RaidDevice State
    0     253        2        0      active sync   /dev/dm-2
    1     253        3        1      active sync   /dev/dm-3
Since the actual multipath device names (/dev/dm-N) are shown, the mappings of the more-friendly names (/dev/mapped/ocrp1) are also verified:

# /bin/ls -l /dev/mpath/
lrwxrwxrwx 1 root root 7 Apr 23 11:15 ocrp1 -> ../dm-2
lrwxrwxrwx 1 root root 7 Apr 23 11:15 ocrmirrorp1 -> ../dm-3

# /bin/ls -l /dev/mapper/
brw-rw---- 1 root disk 253,   2 Apr 23 11:15 ocrp1
brw-rw---- 1 root disk 253,   3 Apr 23 11:15 ocrmirrorp1

Since these convenient names map to the same multipath devices, the setup has been proven correct.

After a reboot, mdadm(8) shows the following:

# /sbin/mdadm --detail /dev/md0
Number   Major   Minor   RaidDevice State
  0       8       97        0      active sync   /dev/sdg1
  1       8      113        1      active sync   /dev/sdh1

The RAID is active, but is not using the multipath devices as expected.


Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms