LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   RAID 1 Array recovery ? (https://www.linuxquestions.org/questions/linux-server-73/raid-1-array-recovery-524138/)

Andrew_OC 01-30-2007 01:49 PM

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 !

macemoneta 01-30-2007 01:59 PM

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.

Andrew_OC 01-30-2007 02:19 PM

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.

macemoneta 01-30-2007 02:33 PM

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

Andrew_OC 01-30-2007 02:35 PM

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 ?

macemoneta 01-30-2007 02:42 PM

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]


Andrew_OC 01-30-2007 02:49 PM

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!


All times are GMT -5. The time now is 09:13 PM.