LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   add drive to RAID with mdadm (https://www.linuxquestions.org/questions/linux-newbie-8/add-drive-to-raid-with-mdadm-4175695046/)

farmkid 05-12-2021 04:42 PM

add drive to RAID with mdadm
 
I have a computer with 7 X 1TB drives in a RAID 5 that I setup several years ago with mdadm. One of the drives has failed and I replaced it with another drive just like it. Using mdadm, I failed and removed the bad drive and added the new one, but I can't seem to get it to work. I have used mdadm when I setup the RAID, then now as I'm trying to repair it, but not at all other than that, so I'm hoping it's just some simple thing that I'm not doing right.

mdadm reports that there are two raids, md126 and md127. md127 is a container and md126 is the RAID drive. The new drive is part of the md127, but when I try to add it to md126, I get "mdadm: Cannot add disks to a 'member' array, perform this operation on the parent container". When I restart the computer, the array rebuilds, which takes about 3-4 hours, but when it's done, the array still shows one drive short and degraded. Here is the output of mdadm -D on both:
sudo mdadm -D /dev/md126
/dev/md126:
Container : /dev/md/imsm0, member 0
Raid Level : raid5
Array Size : 5567516672 (5.19 TiB 5.70 TB)
Used Dev Size : 927919488 (884.93 GiB 950.19 GB)
Raid Devices : 7
Total Devices : 6

State : clean, degraded
Active Devices : 6
Working Devices : 6
Failed Devices : 0
Spare Devices : 0

Layout : left-asymmetric
Chunk Size : 64K

Consistency Policy : resync


UUID : c7c51517:869aaaba:675efe34:e87a8a6b
Number Major Minor RaidDevice State
- 0 0 0 removed
5 8 16 1 active sync /dev/sdb
4 8 32 2 active sync /dev/sdc
3 8 48 3 active sync /dev/sdd
2 8 64 4 active sync /dev/sde
1 8 80 5 active sync /dev/sdf
0 8 96 6 active sync /dev/sdg


sudo mdadm -D /dev/md127
/dev/md127:
Version : imsm
Raid Level : container
Total Devices : 7

Working Devices : 7


UUID : 2d6cd7de:5557f12a:b0b6e10f:8bfe5287
Member Arrays : /dev/md/data_0

Number Major Minor RaidDevice

- 8 0 - /dev/sda
- 8 16 - /dev/sdb
- 8 32 - /dev/sdc
- 8 48 - /dev/sdd
- 8 64 - /dev/sde
- 8 80 - /dev/sdf
- 8 96 - /dev/sdg

/dev/sda is the new drive.
What do I need to do to repair this RAID?

syg00 05-12-2021 06:45 PM

IMSM is as its name suggests Intel storage manager. This is an example of external (to mdadm) metadata and is why you have a container. Never used it, but I suspect when you failed the drive in mdadm it notified imsm and it did likewise as it shows only 6 drives.
Have a look at this for some background. I don't know how to add the drive to the container, whether that needs to be done in the BIOS for the option ROM, or whether normal mdadm commands work on the container. I suspect you'd need to do that first before adding it back to the "member" as that message calls it.


All times are GMT -5. The time now is 12:29 PM.