Are you facing the error 'mdadm failed to run_array' while executing a command on Debian or Ubuntu Linux?
This guide is for you.
Just recently, we received a request from our customer where he received an error “Failed to RUN_ARRAY /dev/md0 invalid argument” while running the below command:
mdadm -Ac partitions /dev/md0 -m dev
In this context, we shall look into how to rebuild the array on Linux operating system using mdadm command.
What triggers 'mdadm failed to run_array' error?
Here are the different causes for this error message to occur:
1. It indicates that the RAID metadata is lost or is no longer consistent.
2. If the kernel does not support the raid mode that we are trying to utilize.
3. If the directory ‘/lib/module/$(uname -r)’ is missing then the Raid module cannot load.
How to resolve 'mdadm failed to run_array' error message ?
Apply the tips given below to resolve this error.
1. The following command can fix the issue if the other two drivers are known to be good. /proc/mdstat file will provide RAID status and make sure RAID is active.
We run the below command at a shell prompt to fix this issue:
$ mdadm -A /dev/md0 -f –update=summaries /dev/sda1 /dev/sdb1
2. Another way to resolve this error is, first, we check if CONFIG_MD_RAID* is set (look at /boot/config*). CONFIG_MD_RAID0=m represents that the raid0 support is built as a module (m for module). And md: personality for level 0 doesn’t load, which means the module is not loaded.
We run the below command to load it:
$ modprobe raid0
Then we should be able to create the array.
3. To check if md support is available in the kernel config file, we execute the command given below:
$ grep _MD_ /boot/config-`uname -r`
It would be present as modules.