The Problem
After replacing issue disk on software RAID, mdadm Fails to Start the RAID Array with Error – “not enough to start the array” and Software Raid State is showing “active, FAILED, Not Started”
“mdadm –detail /dev/md0” showing only 4 disks are active and 8 removed disks.
# mdadm --detail /dev/md0 State : active, FAILED, Not Started Active Devices : 4 Working Devices : 4 Failed Devices : 0 Spare Devices : 0 Number Major Minor RaidDevice State 0 0 0 0 removed 2 0 0 2 removed 4 0 0 4 removed 6 0 0 6 removed 8 0 0 8 removed 10 0 0 10 removed 12 0 0 12 removed 14 0 0 14 removed 8 9 9 8 active sync /dev/md9 9 9 10 9 active sync /dev/md10 10 9 11 10 active sync /dev/md11 11 9 12 11 active sync /dev/md12
The Solution
There was some issue in the connectivity to disk and Disk has been replaced, after that only 4 devices where showing in sync and other disks were showing removed.
For a software RAID function properly, minimum devices should be present in active state to start the Array. It would be required to assemble the mdraid array using -f (force) option, when -f option is used with mdadm -A command, it will try to assemble the array,
If the metadata on some devices appears to be out-of-date. Mdadm cannot find enough working devices to start the array, but can find some devices that are recorded as having failed.
1. Here we need to stop complete md0 as few disks are showing as active.
mdadm: Found some drive for an array that is already active: /dev/md0 mdadm: giving up.
2. Make sure to have valid backup of the data present on mdraid array mount point before trying to reassemble it. Stop the array:
# mdadm -S /dev/md0 mdadm: stopped /dev/md0
3. Assemble the pre-existing array:
# mdadm -A -f /dev/md0 mdadm: /dev/md0 has been started with 12 drives.
4. Verify status of md0:
# mdadm --detail /dev/md0 /dev/md0: Version : 1.2 Creation Time : Wed May 23 09:34:49 2018 Raid Level : raid0 Array Size : 9373701120 (8939.46 GiB 9598.67 GB) Raid Devices : 12 Total Devices : 12 Persistence : Superblock is persistent Update Time : Wed May 23 09:34:49 2018 State : clean Active Devices : 12 Working Devices : 12 Failed Devices : 0 Spare Devices : 0 Chunk Size : 512K Events : 0 Number Major Minor RaidDevice State 0 9 1 0 active sync /dev/md1 1 9 2 1 active sync /dev/md2 2 9 3 2 active sync /dev/md3 3 9 4 3 active sync /dev/md4 4 9 5 4 active sync /dev/md5 5 9 6 5 active sync /dev/md6 6 9 7 6 active sync /dev/md7 7 9 8 7 active sync /dev/md8 8 9 9 8 active sync /dev/md9 9 9 10 9 active sync /dev/md10 10 9 11 10 active sync /dev/md11 11 9 12 11 active sync /dev/md12