LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-30-2007, 01:49 PM   #1
Andrew_OC
LQ Newbie
 
Registered: Nov 2006
Posts: 26

Rep: Reputation: 15
Question RAID 1 Array recovery ?


OK, updated my system from Mandriva to Centos.

system setup

hda = DVD ROM
hdb = NEW 40gb PATA IDE O/S drive (centos)
sda = OLD 80gb SATA IDE Mandriva 2006 O/S (Corrupted)

hdc = RAID1 array disk 0
hde = RAID1 array disk 1

Did a trial run on a test setup of the same arrangement making notes and all went fine.

During the "real thing" though the Centos installer detected that one disk in the RAID1 array (hdc) had a corrup partiton table and so had to be re-initalised. hdc was re-initalised and configured as 'Software raid' but I did not created a raid device (md0) at that point.

I have made a note of which disk was detected correctly without error as a 'software raid' format disk still containing data (hde) and ensured that data on this disk is to be preserved and not formatted.

Is there a prcedure that post install will allow me to recreate RAID disk md0 but specify which is the master in the set (hde) and rebuild the other from that ?

I have a tape backup of the data which was taken a few days earlier, so should all go to pot I can start again with that. It would be nice not to have to resort to that though !
 
Old 01-30-2007, 01:59 PM   #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: 326Reputation: 326Reputation: 326Reputation: 326
There is no master in a RAID1 array. Whichever disk is currently in the array will be the source for whichever disk is added. The procedure is here.
 
Old 01-30-2007, 02:19 PM   #3
Andrew_OC
LQ Newbie
 
Registered: Nov 2006
Posts: 26

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by macemoneta
There is no master in a RAID1 array. Whichever disk is currently in the array will be the source for whichever disk is added. The procedure is here.
Hi Mace,

Thanks for taking the time to respond to my post. Have looked at the link however that seams to be more when an array has failed insitu rather than my setup (or at least to my untrained eye!)

Is there a way I can define a raid1 setup with and say rebuild using hde as the source ? (perhaps with hdc initally removed ?)

Andrew.
 
Old 01-30-2007, 02:33 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: 326Reputation: 326Reputation: 326Reputation: 326
You can assemble the array with one drive missing. For example:

mdadm -A /dev/md0 /dev/hde1

The array will be assembled with just the one drive. You can fsck it, mount it, whatever you need to check it out. You can then add the second drive to start the mirror resync:

mdadm /dev/md0 --add /dev/hdc1
 
Old 01-30-2007, 02:35 PM   #5
Andrew_OC
LQ Newbie
 
Registered: Nov 2006
Posts: 26

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by macemoneta
You can assemble the array with one drive missing. For example:

mdadm -A /dev/md0 /dev/hde1

The array will be assembled with just the one drive. You can fsck it, mount it, whatever you need to check it out. You can then add the second drive to start the mirror resync:

mdadm /dev/md0 --add /dev/hdc1

Brilliant!

Sorry to appear thick, but how do I make sure it know's it's a RAID1 setup ?
 
Old 01-30-2007, 02:42 PM   #6
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: 326Reputation: 326Reputation: 326Reputation: 326
The superblock on the drive and/or the /etc/mdadm.conf (or /etc/mdadm/mdadm.conf) will be used by the mdadm command to determine the parameters. You can check the drive superblock before starting with (for example):

mdadm --examine /dev/hde1

Once the array has been assembled (even in degraded mode) you can:

cat /proc/mdstat

To see what the system understands the configuration to be. For example:

Code:
# cat /proc/mdstat
Personalities : [raid1] [raid6] [raid5] [raid4] 
md0 : active raid1 hda1[0] hdg1[1]
      102208 blocks [2/2] [UU]
 
Old 01-30-2007, 02:49 PM   #7
Andrew_OC
LQ Newbie
 
Registered: Nov 2006
Posts: 26

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by macemoneta
The superblock on the drive and/or the /etc/mdadm.conf (or /etc/mdadm/mdadm.conf) will be used by the mdadm command to determine the parameters. You can check the drive superblock before starting with (for example):

mdadm --examine /dev/hde1

Once the array has been assembled (even in degraded mode) you can:

cat /proc/mdstat

To see what the system understands the configuration to be. For example:

Code:
# cat /proc/mdstat
Personalities : [raid1] [raid6] [raid5] [raid4] 
md0 : active raid1 hda1[0] hdg1[1]
      102208 blocks [2/2] [UU]

OK, Think I've got everything I need now. Thanks for all your help!
 
  


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
Raid Array wwnexc Linux - Hardware 1 09-25-2005 05:47 PM
Mounting my raid0 array with a recovery CD lowpro2k3 Slackware 1 07-22-2005 05:55 PM
RAID Recovery.... PLEASE HELP!!! kburgess Linux - Newbie 1 04-18-2004 01:04 AM
Raid software recovery Iced Earth Linux - Software 0 08-12-2003 07:16 AM
RAID Recovery DavidPhillips Linux - General 0 10-03-2001 10:59 AM


All times are GMT -5. The time now is 01:26 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration