LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 05-05-2009, 01:18 PM   #1
zivota
Member
 
Registered: May 2005
Distribution: CENTOS
Posts: 91

Rep: Reputation: 15
RAID1 problem: Lost source disk in Linux soft raid


Hi there,

Just lost source disk in my mdraid. This is RAID1 setup with two SATA disks.


GRUB Hard Disk Error.

I am trying to find docs on how to recover when something like this happens but no luck so far. Anyone have idea how to salvage this thing?


Centos 5.2
 
Old 05-06-2009, 07:39 AM   #2
Dudydoo
Member
 
Registered: Sep 2003
Location: UK
Distribution: I use 'em all ;-)
Posts: 275

Rep: Reputation: 38
Boot up with a centos CD and type 'linux rescue' at the boot: prompt. If it finds your working hard disk and installation, type:
Code:
chroot /mnt/sysimage
/sbin/grub-install /dev/X
where X is your hard disk - hda, sda, etc.
Then reboot and if all is OK, then you just need to buy a new drive and add it the the raid array

Code:
mdadm /dev/mdX --add /dev/X
 
Old 05-06-2009, 11:26 AM   #3
zivota
Member
 
Registered: May 2005
Distribution: CENTOS
Posts: 91

Original Poster
Rep: Reputation: 15
Thanks Dudydoo, your tip works!!
 
Old 05-29-2009, 06:44 PM   #4
acutchin
LQ Newbie
 
Registered: Oct 2006
Posts: 3

Rep: Reputation: 0
This isn't working for me. =

I am testing mdadm RAID mirrors for (hopefully) production servers. My server has two SCSI drives (sda & sdb) on the same controller. My goal is to configure a system that can survive loss of either disk in the system mirror without system interruption, and be re-bootable thereafter, with or without the missing disk.

I configured the mirrors during CentOS 5.3 / Anaconda installation as follows:

___1 Configured "Software RAID" partitions:
______1 sda1, sda2, sda3
______2 sdb1, sdb2, sdb3
___2 Configured RAID devices:
______1 /dev/md11 - raid 1 mirror including sda1 and sdb1
______2 /dev/md12 - raid 1 mirror including sda2 and sdb2
______3 /dev/md13 - raid 1 mirror including sda3 and sdb3
___3 mount points
______1 / on /dev/md11
______2 /var on /dev/md12
______3 swap on /dev/md13

The installation went well, so I performed the following test:

___1 pulled sdb while the system was running
___2 system didn't crash =
___3 re-inserted sdb
___4 re-scan the bus (echo "- - - " > /sys/class/scsi_host/host0/scan)
___5 removed sdb1, sdb2, and sdb3 from md11, md12, and md13, respectively
______mdadm /dev/md1X --remove /dev/sdbX
___6 re-added sdb1, sdb2, and sdb3 to md11, md12, and md13
______mdadm /dev/md1X --add /dev/sdbX
___7 waited for the mirrors to rebuild
___8 rebooted
___9 verified that the mirrors were "clean"

Successful test, so I went a step further:

___1 shutdown with both drives mounted and mirrors healthy
___2 pulled sdb
___3 booted
___4 got the error: "GRUB Hard Disk Error"
___5 followed the instructions above
______1 first of all, CentOS rescue couldn't mount my system under /mnt/sysimg
______2 I mounted it manually, chrooted, and ran /sbin/grub-install /dev/sda1
______3 Error: "/dev/sda1: Not found or not a block device."
______4 Same error with /dev/md11
______5 In fact, when chrooted to my sda1 partition, mount shows:
_________ /dev/md11 on / type ext3 (rw)
_________ proc on /proc type proc (rw)
______6 so where exactly is grub-install supposed to act?
___6 I tried to "de-mdadm" sda1, sda2, and sda3 as follows:
______1 change partition type to 83 (82 for sda3) using fdisk
______2 mounted sda1 (read-write) and renamed /etc/mdadm.conf to /etc/mdadm.conf.bad
______3 edited /boot/grub.conf, changed /dev/md11 to /dev/sda1
______4 unmounted sda1
______5 zeroed the superblocks
_________mdadm --zero-superblock /dev/sdaX
___7 rebooted and still the same error: "GRUB Hard Disk Error"

Am I going about this wrong? How does one boot a mdadm-mirrored system after losing the "secondary" mirror disk? Seems like a fairly basic RAID feature to me. >:[

After figuring this out, I want to try pulling the "primary" disk (sda) and booting from sdb. I understand that requires some GRUB reconfiguration.

Thanks for any help anyone can offer!


-- Aaron

Last edited by acutchin; 05-29-2009 at 06:54 PM. Reason: grrr, forum squashes leading spaces... also forgot a detail...
 
Old 06-01-2009, 06:31 AM   #5
Dudydoo
Member
 
Registered: Sep 2003
Location: UK
Distribution: I use 'em all ;-)
Posts: 275

Rep: Reputation: 38
Grub should be installed to the MBR of both drives:

Code:
grub-install /dev/sda
grub-install /dev/sdb
Not /dev/sda1 as you have put above.
 
  


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
Hardware RAID 5 lost single disk joechancellor Linux - Newbie 4 02-24-2009 10:17 PM
Soft RAID1 problems (invalid raid superblock magic) toshko3 Linux - Server 3 08-28-2008 11:29 PM
Delicate Soft-RAID problem thewindk Linux - Hardware 0 11-08-2003 03:55 AM
Soft RAID1 (mirror) rebuild GAVollink Linux - Hardware 4 04-25-2003 08:18 AM
how to share many soft raid in linux? henryking Linux - General 0 04-18-2002 08:09 PM

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

All times are GMT -5. The time now is 11:52 AM.

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