LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 04-24-2003, 12:59 PM   #1
GAVollink
Member
 
Registered: Apr 2002
Location: Bronx, NY
Distribution: Ubuntu
Posts: 371

Rep: Reputation: 34
Soft RAID1 (mirror) rebuild


I have searched, and many folks have asked - but nobody has gotten an answer.

I am building my companies third Linux system (RH 7.2) - and this one is using Software RAID-1 and RAID-0 mirrors mixed.

Here is my setup:
2 - IDE 40GB (no other drives)
/dev/hda1 & /dev/hdc1 - 101MB - /boot - (mirror)
/dev/hda2 & /dev/hdc2 - 1024MB - <swap> - (striped)
/dev/hda3 & /dev/hdc3 - 38GB - / (mirror)

The point is - I want to be able to keep my data if one of these two drives goes down. So I did an experiment. I turned off the system, unplugged /dev/hdc - and rebooted. So far so good - the MD driver sees that the drive is gone, and boots anyway - great. Swap is gone completely (obviously) - but it still boots and runs.

Shut it down again - plug in drive /dev/hdc - and the MD will not pick up hdc1 and hdc3. Says that the disk is "dirty" (boot text flies to fast - and this message didn't get captured by the log). Other items were captured in the log, but nothing about hdc1 or hdc3 - only the details on what it did do (not what failed).

I have no problem at this point if I have to destroy the system. It is only about two hours worth of setup - but I would like to make sure that I have my recovery procedure down pat. Is there some sort of rebuild the mirrors command I run? Do I need to "zero out" these devices? Do I need to shut down the disk swap and zero out the whole drive?

Thank you very much for any assistance you can give.

Gary
(who happily answers questions in the Networking Forum as time permits)
 
Old 04-24-2003, 03:51 PM   #2
mcleodnine
Senior Member
 
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
No need to stripe your swap space as the swap is suposed to use whatever device it deems most 'ready'.

What does 'cat /proc/mdstat' have to say about the issue?

You can rebuild the array with the raidhotadd command.
 
Old 04-24-2003, 04:11 PM   #3
GAVollink
Member
 
Registered: Apr 2002
Location: Bronx, NY
Distribution: Ubuntu
Posts: 371

Original Poster
Rep: Reputation: 34
Quote:
No need to stripe your swap space as the swap is suposed to use whatever device it deems most 'ready'.
Funny - actually - when I tried to build the system without making every device part of a meta-device - the system could not initialize the swap. So, I assumed that a disk must be entirely part of a swap scheme or completely outside of a swap scheme.

Quote:
What does 'cat /proc/mdstat' have to say about the issue?
Not much:

Personalities : [RAID0] [RAID1]
read_ahead 1024 sectors
md2 : active raid1 hda3[0]
37399232 blocks [2/1] [U_]

md0 : active raid0 hda2[0] hdc2[1]
3148544 blocks 54k chunks

md1 : active raid1 hda1[0]
104320 blocks [2/1] [U_]

unused devices: <none>

Quote:
You can rebuild the array with the raidhotadd command.
Could you direct me to a Man Page for this - seemingly - RH7.2 didn't have one, and --help isn't very usefull.

Thank you for your help!
 
Old 04-25-2003, 04:35 AM   #4
mcleodnine
Senior Member
 
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
raidhotadd /dev/hd__ /dev/md_

once things start whirring away, you can use 'watch cat /proc/mdstat' to see updates on how the rebuild is going.

try the boot partition first as it should be a quick rebuild.


As for the swap partitions - read up on the swap stuff in the most excellent RAID How-To's over at tldp.org. I think my favorite was Boot/Root RAID howto. Good reads fer sure.

Last edited by mcleodnine; 04-25-2003 at 04:37 AM.
 
Old 04-25-2003, 08:18 AM   #5
GAVollink
Member
 
Registered: Apr 2002
Location: Bronx, NY
Distribution: Ubuntu
Posts: 371

Original Poster
Rep: Reputation: 34
Thank you

The command line was backwards, but once I found out that two parameters were involved - all is going quite well...

raidhotadd /dev/md_ /dev/hd__

The command I used to start was:
# raidhotadd /dev/md2 /dev/hdc3

For those whom are curious - the /proc/mdstat (during rebuild) looks like the following:

Personalities : [RAID0] [RAID1]
read_ahead 1024 sectors
md2 : active raid1 hdc3[2] hda3[0]
37399232 blocks [2/1] [U_]
[====>................] recovery = 29% (16429956/74798464) finish=80.3m in speed = 12125K/sec
md0 : active raid0 hda2[0] hdc2[1]
3148544 blocks 54k chunks

md1 : active raid1 hda1[0]
104320 blocks [2/1] [U_]

unused devices: <none>

Last edited by GAVollink; 04-25-2003 at 08:20 AM.
 
  


Reply



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
break raid1 mirror hoover93 Linux - Software 0 10-05-2005 10:55 AM
rebuild kernel 2.6 boot fail on soft RAID fs Ducko Fedora 4 10-05-2004 08:40 PM
Recover/Rebuild SW Raid1? FoxNotch Linux - General 1 07-11-2004 10:04 AM
Promise ataraid - system crashes after rebuild of mirror tallship Linux - Hardware 4 12-07-2003 10:27 PM
How to rebuild raid1 on RedHat 9.0 galaxyms Linux - Software 0 10-23-2003 09:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

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