LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 01-13-2006, 09:33 AM   #1
Pastorino
Member
 
Registered: Jul 2004
Distribution: RHEL 6.2
Posts: 35

Rep: Reputation: 17
Fedora's RAID-1: how to recover from a crash?


Hello everyone,

I have installed Fedora Core 1 and Core 3 on my servers and, in all installations, I'm using software RAID-1. I usually configure four partitions:

/dev/md0 ==> /boot
/dev/md1 ==> /
/dev/md2 ==> /var
/dev/md3 ==> swap

Well, after a long time feeling secure, one of the hard disks of one of the servers crashed. So I shut the server down, removed the crashed HD, turned the server on with the remaining HD, and, to my dismay, it didn't work. The remaining HD was corrupted.

Did I do something wrong? What should I do in the case of a crash? By the way, the HDs are not hot-pluggable.

Thanks,

Juliano Pastorino
 
Old 01-14-2006, 07:12 AM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Partition the new drive to match the old drive, then start each array (for example):

/sbin/mdadm /dev/md0 --fail /dev/hda1 --remove /dev/hda1
/sbin/mdadm /dev/md0 --add /dev/hda1

You can check the status of the array with:

cat /proc/mdstat

or

/sbin/mdadm -D /dev/md0

Last edited by macemoneta; 01-14-2006 at 07:13 AM.
 
Old 01-18-2006, 12:25 PM   #3
Pastorino
Member
 
Registered: Jul 2004
Distribution: RHEL 6.2
Posts: 35

Original Poster
Rep: Reputation: 17
Hi macemoneta,

Thanks a lot for your help. Just to be sure, I would like to know if I should follow the steps below:

1) When I notice that a HD has failed, I first execute:

/sbin/mdadm /dev/md0 --fail /dev/hda1 --remove /dev/hda1

for each partition.

2) Then I turn off the server, remove the old HD, install de new HD, and turn on the server.

3) Then I partition the new HD, and execute:

/sbin/mdadm /dev/md0 --add /dev/hda1

for each partition.

Is that correct?

Thanks,

Pastorino
 
Old 01-18-2006, 04:23 PM   #4
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
That'll do it. Make sure you have the mdadm command installed on your distribution. If not, the old (pre-mdadm) way was with:

/sbin/raidhotremove /dev/md0 /dev/hda1
...
/sbin/raidhotadd /dev/md0 /dev/hda1

Either way will work, but using the mdadm command is preferred.
 
  


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
Software RAID to recover data from HW RAID ocschwar Linux - Hardware 5 02-25-2005 10:05 PM
Need to recover data from XP crash TravisB General 3 10-15-2004 10:03 PM
Server crash, trying to recover mysql data from old HD? Vatoloco Linux - Software 2 06-20-2004 11:15 AM
How can I recover from crash? glore Linux - Newbie 3 04-27-2004 09:49 AM
Recover from a crash Scrotonomous Linux - Newbie 2 05-17-2003 11:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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