LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 09-05-2006, 08:36 AM   #1
imi@tux
LQ Newbie
 
Registered: Oct 2004
Location: Wasa, Finland
Distribution: debian
Posts: 23

Rep: Reputation: 15
Want to repair my RAID-array


Hi happy hackers,

Recently my RAID-array somehow broke and now I want to rebuild it.

Code:
mdadm --query /dev/hdc1
gives

Code:
/dev/hdc1: is not an md array
/dev/hdc1: device 0 in 2 device undetected raid1 md0.  Use mdadm --examine for more detail.
and

Code:
mdadm --examine /dev/hdc1
gives

Code:
/dev/hdc1:
          Magic : a92b4efc
        Version : 00.90.00
           UUID : 9781b553:a293234f:5379911b:5c017850
  Creation Time : Wed Feb  4 19:51:08 2004
     Raid Level : raid1
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 0

    Update Time : Fri Aug  4 15:00:53 2006
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0
       Checksum : 1c581f91 - correct
         Events : 0.413


      Number   Major   Minor   RaidDevice State
this     0      22        1        0      active sync   /dev/hdc1

   0     0      22        1        0      active sync   /dev/hdc1
   1     1      22       65        1      active sync   /dev/hdd1

Same info appears for the other device, hdd1

Now, can I somehow rebuild the array or do I have to create a new clean one? I was going to create a new one at first, but now I'm reconsidering since I got the following when I was about to create it...

Code:
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/hd[cd]1
mdadm: /dev/hdc1 appears to contain an ext2fs file system
    size=78148096K  mtime=Tue Sep  5 15:18:35 2006
mdadm: /dev/hdc1 appears to be part of a raid array:
    level=1 devices=2 ctime=Wed Feb  4 19:51:08 2004
mdadm: /dev/hdd1 appears to contain an ext2fs file system
    size=78148096K  mtime=Tue Sep  5 15:22:03 2006
mdadm: /dev/hdd1 appears to be part of a raid array:
    level=1 devices=2 ctime=Wed Feb  4 19:51:08 2004
Continue creating array?
 
Old 09-05-2006, 08:25 PM   #2
furiousn00b
LQ Newbie
 
Registered: Mar 2006
Distribution: CentOS 4.4
Posts: 29

Rep: Reputation: 15
I work with raids everyday at work, and the only way to repair them is through the raid bios during POST. Reboot your computer and see if you can see an "Alt-F4 for Raid Bios Setup" or something to that effect. It will also give you a warning that the array has been detected as being "broken, degraded, or rebuilding". You select the array from the raid bios and there should be an option to rebuild. If you dont have these options I would wonder if that raid card is like a low low grade cheapy. Hope this helps.
 
Old 09-06-2006, 12:19 AM   #3
WhatsHisName
Senior Member
 
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHL9;F1-10; CentOS4-5; DebianSarge-Squeeze
Posts: 1,151

Rep: Reputation: 46
Thatís great advice for a hardware raid, but mdadm manages software raids.


From the description, it isnít clear whether the raid1 is dead or just running on one drive.

To examine the health of the raid1:
Code:
# mdadm -D /dev/md0
#
# cat /proc/mdstat
If md0 is not running, then you should try to assemble it before recreating it.
Code:
# mdadm -A /dev/md0 /dev/hd[cd]1
# mdadm -D /dev/md0
If md0 is degraded and running on one drive, then you should try to add the missing raid member. For example, if md0 is active, but only hdc1 is present, then:
Code:
# mdadm /dev/md0 -a /dev/hdd1
If all else fails, your ďmdadm -C /dev/md0 ...Ē should work. The warnings you got are normal. Donít reboot until the raid1 has resynced.


When you get the raid running, you should update mdadm.conf:
Code:
# cd /etc/mdadm
# cp mdadm.conf mdadm.conf.`date +%y%m%d`
# echo "DEVICE partitions" > mdadm.conf
# echo "MAILADDR root" >> mdadm.conf
# mdadm -D -s >> mdadm.conf
The recent Etch mdadm updates may overcome debianís ďproblemĒ with starting raids at boot.
 
Old 09-06-2006, 02:43 PM   #4
furiousn00b
LQ Newbie
 
Registered: Mar 2006
Distribution: CentOS 4.4
Posts: 29

Rep: Reputation: 15
ahhh and that is something I've never worked on. Good call.
 
Old 09-07-2006, 05:26 AM   #5
imi@tux
LQ Newbie
 
Registered: Oct 2004
Location: Wasa, Finland
Distribution: debian
Posts: 23

Original Poster
Rep: Reputation: 15
Thank you WhatsHisName!

I followed your excellent instructions and got the RAID-array up 'n' running. Apparently only one HDD was active.

How ever, I couldn't find any mdadm.conf anywhere so I created it in /etc/mdadm. But I really don't think it's working. When I reboot the box the array disappears again and I have to execute mdadm -A /dev/md0 /dev/hd[cd]1 to bring it up. Any clues about this?
 
Old 09-07-2006, 12:12 PM   #6
WhatsHisName
Senior Member
 
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHL9;F1-10; CentOS4-5; DebianSarge-Squeeze
Posts: 1,151

Rep: Reputation: 46
Some distros donít create mdadm.conf by default, so not finding it is OK.

Check that the partition types are set to ďfdĒ (linux raid autodetect) for hdc1 and hdd1.

Which debian version are you using? Since you didnít need to use --auto to assemble the raid, Iím assuming Etch or Sid (or recent Ubuntu/Kubuntu). I know there are problems in Sarge with creating the md devices on boot, but I donít remember the details.

Was md0 created during installation or at a later time?
 
Old 11-22-2006, 02:44 AM   #7
imi@tux
LQ Newbie
 
Registered: Oct 2004
Location: Wasa, Finland
Distribution: debian
Posts: 23

Original Poster
Rep: Reputation: 15
Now I have to time to bring this thread up again

Quote:
Originally Posted by WhatsHisName
Some distros donít create mdadm.conf by default, so not finding it is OK.

Check that the partition types are set to ďfdĒ (linux raid autodetect) for hdc1 and hdd1.

Which debian version are you using? Since you didnít need to use --auto to assemble the raid, Iím assuming Etch or Sid (or recent Ubuntu/Kubuntu). I know there are problems in Sarge with creating the md devices on boot, but I donít remember the details.
My debian version is 3.1 aka sarge and if I remember correctly my problems began after I upgraded the dist. So, perhaps it's a sarge issue then. Must google...

Quote:
Originally Posted by WhatsHisName
Was md0 created during installation or at a later time?
Md0 was created after the original installation.
 
Old 11-27-2006, 06:10 AM   #8
imi@tux
LQ Newbie
 
Registered: Oct 2004
Location: Wasa, Finland
Distribution: debian
Posts: 23

Original Poster
Rep: Reputation: 15
Quote:
Check that the partition types are set to ďfdĒ (linux raid autodetect)
How do I check if it's type is set to fd?

Code:
#mount
/dev/md0 on /data type ext2 (rw,usrquota)
Or how should I check it?

So let's say I change the type with fdisk. Will my data still be intact afterwards?
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RAID 1 Degraded Array gsoft Debian 2 08-18-2006 02:17 PM
Raid Array wwnexc Linux - Hardware 1 09-25-2005 05:47 PM
power for raid array rtp405 Linux - Hardware 1 02-05-2003 05:36 PM
Raid array question RecoilUK Linux - Hardware 6 06-01-2002 11:48 PM
moving a md array (RAID) MorrisIS Linux - General 2 10-04-2001 11:41 PM


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