Help With Degraded Linux Raid

Netopia

Diamond Member
Oct 9, 1999
4,793
4
81
Hi guys,

I posted this over on the OS forum, but since I've not gotten any bites and this is a fairly technical situation, I thought I'd throw it to the uberTechies and see if there are any ideas.

I'm not quite sure what to do. I've got a system with two drives setup in Raid-1. I had some hiccups on the machine the other day and now I've got this situation (weird, no "attach code" button on the the HT forum!).

[root@mailscan spamassassin]# mdadm --detail /dev/md0
/dev/md0:
Version : 00.90.03
Creation Time : Wed Feb 1 09:12:45 2006
Raid Level : raid1
Array Size : 521984 (509.75 MiB 534.51 MB)
Device Size : 521984 (509.75 MiB 534.51 MB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 0
Persistence : Superblock is persistent

Update Time : Wed Feb 22 11:46:34 2006
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0

UUID : e160107f:ba11b455:737aa518:cf303a9e
Events : 0.1245

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


======================================

[root@mailscan spamassassin]# mdadm --detail /dev/md1
/dev/md1:
Version : 00.90.03
Creation Time : Wed Feb 1 09:11:00 2006
Raid Level : raid1
Array Size : 75778496 (72.27 GiB 77.60 GB)
Device Size : 75778496 (72.27 GiB 77.60 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 1
Persistence : Superblock is persistent

Update Time : Thu Feb 23 11:36:35 2006
State : clean, degraded
Active Devices : 1
Working Devices : 1
Failed Devices : 1
Spare Devices : 0

UUID : cf8eee85:e40bd94b:58db741c:9f412b4b
Events : 0.790890

Number Major Minor RaidDevice State
0 0 0 - removed
1 22 3 1 active sync /dev/hdc3

2 3 3 - faulty /dev/hda3



So how do I remirror just one device out of a whole disk? Any ideas? The thing that really stinks is that it is on the boot drive!

Thanks in advance for any thoughts.

Joe
 

nd

Golden Member
Oct 9, 1999
1,690
0
0
This is confusing. /dev/hda1 seems to be fine, but it lists /dev/hda3 as "faulty". So the disk itself isn't bad -- maybe just the filesystem on the hda3 mirror is corrupted?

Shouldn't it be harmless to rebuild the array on the whole /dev/hda since you're using RAID-1? i.e erasing the superblock and essentially starting over.
 

Netopia

Diamond Member
Oct 9, 1999
4,793
4
81
It may be... except that hda1 is where the system boots from, so I'll have to temporarily redo the system to boot from the other drive. I was just hoping there was a way I could simply resync hdc3 --> hda3 so that I wouldn't have to completely remirror the entire drive.

As it is, if I have to redo the whole drive, I think I'll replace both drives with new ones... these two are a couple years old and if I'm going to go through the trouble of resyncing, I might as well remove the possibility that these drives might fail.

Joe
 

nd

Golden Member
Oct 9, 1999
1,690
0
0
The fact that it's the boot drive shouldn't matter much. Do you have any Knoppix CDs handy? They're perfect for this sort of situation. I would just burn a Knoppix CD, boot it and recover from there.
 

Netopia

Diamond Member
Oct 9, 1999
4,793
4
81
I've got quite a few live linux CD's on hand, including Knoppix. Getting in isn't the problem though... it's whether or not I can repair and resync ONLY /dev/hda3 and not have to redo the whole drive.

Joe
 

nd

Golden Member
Oct 9, 1999
1,690
0
0
I think you should be able to fix this with:

# Clear out corrupt hda3
$ dd if=/dev/zero of=/dev/hda3

# Rebuild array
$ mdadm --manage /dev/md1 --add /dev/hda3

Then cat /proc/mdstat and watch the progress.