LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-05-2015, 09:50 PM   #1
machejc
LQ Newbie
 
Registered: Apr 2015
Location: San Francisco Bay Area
Posts: 3

Rep: Reputation: Disabled
Trouble Re-Building RAID 5 with mdadm


I am running Fedora 15 and lost a disk drive (dev/sde1) on my 4 device RAID 5.

I replaced the failed drive with a new one and re-added that drive in.

Code:
# # mdadm --manage /dev/md127 -a /dev/sde1
mdadm: added /dev/sde1
Now the current status is:

Code:
# mdadm --detail /dev/md127
/dev/md127:
        Version : 0.90
  Creation Time : Tue Sep 30 13:58:53 2008
     Raid Level : raid5
  Used Dev Size : 976759936 (931.51 GiB 1000.20 GB)
   Raid Devices : 4
  Total Devices : 4
Preferred Minor : 127
    Persistence : Superblock is persistent

    Update Time : Sun Apr  5 19:10:48 2015
          State : active, degraded, Not Started
 Active Devices : 3
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 1

         Layout : left-symmetric
     Chunk Size : 64K

           UUID : 653d0b4b:86db92d1:2be201d9:114acb0f
         Events : 0.4860502

    Number   Major   Minor   RaidDevice State
       0       8       33        0      active sync   /dev/sdc1
       1       8       17        1      active sync   /dev/sdb1
       2       0        0        2      removed
       3       8       49        3      active sync   /dev/sdd1

       4       8       65        -      spare   /dev/sde1
How do I remove the Number 2 removed and get /dev/sde1 to be re-added into the /dev/md127 RAID 5 and have it start rebuilding?
 
Old 04-06-2015, 05:23 AM   #2
Keruskerfuerst
Senior Member
 
Registered: Oct 2005
Location: Horgau, Germany
Distribution: Manjaro KDE, Win 10
Posts: 2,199

Rep: Reputation: 164Reputation: 164
You should use the option --re-add.
 
Old 04-06-2015, 01:35 PM   #3
machejc
LQ Newbie
 
Registered: Apr 2015
Location: San Francisco Bay Area
Posts: 3

Original Poster
Rep: Reputation: Disabled
It did not work. Now what?

How do I get rid of the Number 2 removed device?

Code:
# mdadm --manage /dev/md127 --remove /dev/sde1
mdadm: hot removed /dev/sde1 from /dev/md127
#
# mdadm --detail /dev/md127
/dev/md127:
        Version : 0.90
  Creation Time : Tue Sep 30 13:58:53 2008
     Raid Level : raid5
  Used Dev Size : 976759936 (931.51 GiB 1000.20 GB)
   Raid Devices : 4
  Total Devices : 3
Preferred Minor : 127
    Persistence : Superblock is persistent

    Update Time : Mon Apr  6 11:28:44 2015
          State : active, degraded, Not Started
 Active Devices : 3
Working Devices : 3
 Failed Devices : 0
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 64K

           UUID : 653d0b4b:86db92d1:2be201d9:114acb0f
         Events : 0.4860504

    Number   Major   Minor   RaidDevice State
       0       8       33        0      active sync   /dev/sdc1
       1       8       17        1      active sync   /dev/sdb1
       2       0        0        2      removed
       3       8       49        3      active sync   /dev/sdd1
#
# mdadm --manage /dev/md127 --re-add /dev/sde1
mdadm: --re-add for /dev/sde1 to /dev/md127 is not possible
#
# mdadm --manage /dev/md127 --re-add /dev/sde1
mdadm: --re-add for /dev/sde1 to /dev/md127 is not possible
# mdadm --detail /dev/md127
/dev/md127:
        Version : 0.90
  Creation Time : Tue Sep 30 13:58:53 2008
     Raid Level : raid5
  Used Dev Size : 976759936 (931.51 GiB 1000.20 GB)
   Raid Devices : 4
  Total Devices : 3
Preferred Minor : 127
    Persistence : Superblock is persistent

    Update Time : Mon Apr  6 11:28:44 2015
          State : active, degraded, Not Started
 Active Devices : 3
Working Devices : 3
 Failed Devices : 0
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 64K

           UUID : 653d0b4b:86db92d1:2be201d9:114acb0f
         Events : 0.4860504

    Number   Major   Minor   RaidDevice State
       0       8       33        0      active sync   /dev/sdc1
       1       8       17        1      active sync   /dev/sdb1
       2       0        0        2      removed
       3       8       49        3      active sync   /dev/sdd1

Last edited by machejc; 04-06-2015 at 01:37 PM.
 
Old 04-06-2015, 09:18 PM   #4
machejc
LQ Newbie
 
Registered: Apr 2015
Location: San Francisco Bay Area
Posts: 3

Original Poster
Rep: Reputation: Disabled
Fixed!!

Code:
# mdadm --stop /dev/md127
# mdadm --assemble  -f -R /dev/md127
The new drive was accepted by the RAID and is rebuilding.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Recover mdadm RAID after failure during RAID level change Caetel Linux - General 1 11-07-2013 10:38 PM
Broken raid 5 (11 drives in mdadm) -- data recovery/raid reconstruction needed -- ple jml48197 Linux - Server 4 07-27-2010 12:57 PM
mdadm trouble & resetting a partition as ext3 instead of raid ternarybit Linux - Software 4 10-29-2009 10:30 AM
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 - Software

All times are GMT -5. The time now is 02:26 AM.

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