Debian – Prevent Debian from auto-assembling RAID at boot

debianinitramfsraidstartup

I set up a Debian wheezy (7.6), installed openmediavault, and created a software RAID 5 with that. It is listed at /dev/md127.
Now I want to move that to a virtual XEN VM. To do so, I have to stop Debian to automatically assemble the RAID at startup, so I can put it through to the VM via xm block-attach, and I don't get that to work. No matter what I try, there is still md127 listed under /dev/, and after every boot I can manually end it via mdadm --stop /dev/md127. But even after that, it is still listed under /dev/.

What I already tried:

  • /etc/mdadm/mdadm.conf: commented out array line:

    #ARRAY /dev/md0 metadata=1.2 name=masterbox:MainRaid UUID=3f620e6d:4e655d66:b931eb71:baf7cf3a  
    ARRAY /dev/md0 name=Null
    
  • moved /libs/udev/rules.d/64-md-raid.rules to /root/

  • update-initramfs u
  • commented out the line in /etc/fstab
  • disassembled RAID manually via mdadm --stop /dev/md127
  • set kernel parameter raid=noautodetect in /etc/default/grub:

    GRUB_CMDLINE_LINUX_DEFAULT="quiet raid=noautodetect"  
    
  • rebooted

  • disabled mdadm services at boot

Here's also the log from dmesg:

[    3.448121] md: md127 stopped.
[    3.452518] md: bind<sda>
[    3.452747] md: bind<sdc>
[    3.452933] md: bind<sdb>

[    3.954794] md: raid6 personality registered for level 6
[    3.954797] md: raid5 personality registered for level 5
[    3.954799] md: raid4 personality registered for level 4
[    3.955417] bio: create slab <bio-1> at 1
[    3.955436] md/raid:md127: device sdb operational as raid disk 0
[    3.955439] md/raid:md127: device sdc operational as raid disk 2
[    3.955442] md/raid:md127: device sda operational as raid disk 1
[    3.955740] md/raid:md127: allocated 3228kB
[    3.955988] md/raid:md127: raid level 5 active with 3 out of 3 devices, algorithm 2
[    3.955991] RAID conf printout:
[    3.955993]  --- level:5 rd:3 wd:3
[    3.955996]  disk 0, o:1, dev:sdb
[    3.955999]  disk 1, o:1, dev:sda
[    3.956000]  disk 2, o:1, dev:sdc
[    3.956044] md127: detected capacity change from 0 to 6000916561920

… How can I bring Debian to not touch the RAID drives at all, so I can pass them to my VM?

Best Answer

This is an old question, but since I searched quite long for a solution, I want to share my result:

# /etc/mdadm/mdadm.conf
ARRAY <ignore> UUID=3f620e6d:4e655d66:b931eb71:baf7cf3a

From man mdadm.conf:

ARRAY

    The ARRAY lines identify actual arrays.  The second word on the line may be the name of the device where the array is normally assembled, such as /dev/md1 or /dev/md/backup.  If the name does not start with a slash ('/'), it is treated as being in /dev/md/.  Alternately the word <ignore> (complete with angle brackets) can be given in which case any array which matches the rest of the line will never be automatically assembled.  If no device name is given, mdadm will use various heuristics to determine an appropriate name.

Related Question