LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-12-2021, 04:42 PM   #1
farmkid
LQ Newbie
 
Registered: Apr 2012
Posts: 3

Rep: Reputation: Disabled
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?
 
Old 05-12-2021, 06:45 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,145

Rep: Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why can't I mount this md0 raid? (mdadm and software raid) cruiserparts Linux - Software 35 01-05-2013 03:35 PM
Broken raid 5 (11 drives in mdadm) -- data recovery/raid reconstruction needed -- ple jml48197 Linux - Server 4 07-27-2010 12:57 PM
[SOLVED] Software RAID (mdadm) - RAID 0 returns incorrect status for disk failure/disk removed Marjonel Montejo Linux - General 4 10-04-2009 06:15 PM
Dell/Intel ICH7 soft-RAID and mdadm raid-level mistake PhilipTheMouse Linux - General 0 03-14-2009 05:59 PM
RAID mdadm - Sending E-Mails on RAID Failure? rootking Linux - General 1 12-25-2007 03:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration