LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-02-2011, 09:46 AM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
Question Drive Failure on Software RAID


My Linux server has two identical 750 GB SATA drives & I received notification that the server has experienced a drive failure on /dev/sda. Each identical drive has three partitions on it:

/dev/sda:
  1. sda1 = swap
  2. sda2 = /boot
  3. sda3 = /

/dev/sdb:
  1. sdb1 = swap
  2. sdb2 = /boot
  3. sdb3 = /

Then I have three /dev/md0-1-2 (Software RAID) partitions:
  • /dev/md0 = swap
  • /dev/md1 = /boot
  • /dev/md2 = /

Now you can see my failure listed below:

Code:
root ~ # cat /proc/mdstat 
Personalities : [raid1] 
      
md2 : active raid1 sdb3[1]
      731977536 blocks [2/1] [_U]
      
md1 : active raid1 sdb2[1]
      96320 blocks [2/1] [_U]
      
md0 : active raid1 sda1[0] sdb1[1]
      497856 blocks [2/2] [UU]
      
unused devices: <none>
So from above it appears that /dev/sda has failed and now is replaced by a new identical spare drive. My question is how do I force the new drive /dev/sda to synchronize and repair the RAID?
 
Old 01-02-2011, 10:04 AM   #2
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,859
Blog Entries: 14

Rep: Reputation: 285Reputation: 285Reputation: 285
Sorry, I misread the question! How did you remove and replace the drive?

Does something like mdadm -a /dev/md2 /dev/sda3 not work?

Last edited by mostlyharmless; 01-02-2011 at 10:13 AM. Reason: Misread initially, early senility no doubt
 
Old 01-02-2011, 12:20 PM   #3
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
OK so I wanted to make sure I explain this:

I powered my server off and manually removed /dev/sda to emulate a drive failure. I powered the server back on and it booted fine however the RAID array was in a degraded state which is obvious since /dev/sda is missing. I then powered the server back off and re-added /dev/sda however the mdadm doesn't automatically initialize the drive. I had to manually re-add it with:

Code:
mdadm --manage /dev/md1 --add /dev/sda3
mdadm --manage /dev/md2 --add /dev/sda4
So now it appears to be re-synchronizing the mirror:

Code:
root ~ # cat /proc/mdstat 
Personalities : [raid1] 
      
md2 : active raid1 sda3[2] sdb3[1]
      731977536 blocks [2/1] [_U]
      [>....................]  recovery =  0.5% (4303744/731977536) finish=194.1min speed=62469K/sec
My question now is if this drive /dev/sda was completely brand new and didn't have any partition tables on it, would I need to create them on the newly replaced /dev/sda or should 'mdadm' simply be able to do it w/o me having to run fdisk.
 
Old 01-02-2011, 02:56 PM   #4
brak44
Member
 
Registered: Aug 2010
Location: Brisbane Australia
Distribution: Centos, Fedora
Posts: 87

Rep: Reputation: 24
My question now is if this drive /dev/sda was completely brand new and didn't have any partition tables on it, would I need to create them on the newly replaced /dev/sda or should 'mdadm' simply be able to do it w/o me having to run fdisk.[/QUOTE]

You will need to use the sfdisk command to set up the partitions.
e.g. if sda is completely brand new

sfdisk -d /dev/sdb | sfdisk /dev/sda

will copy the partition info from sdb to sda
 
Old 01-02-2011, 03:49 PM   #5
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,859
Blog Entries: 14

Rep: Reputation: 285Reputation: 285Reputation: 285
Agree with the above!
 
  


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
[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
Dual drive failure in RAID 5 (also, RAID 1, and LVM) ABL Linux - Server 6 05-27-2009 08:01 PM
Software RAID Failure? carlosinfl Linux - General 3 07-13-2007 10:06 PM
Will not boot RAID drive after PS failure. webguyinternet Linux - Server 0 10-04-2006 02:59 PM
RH9 Software Raid 1 hard drive failure - GRUB loader errors Mynar Linux - Newbie 1 01-28-2004 10:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:05 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