LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 06-21-2007, 04:22 PM   #1
kristof_v
Member
 
Registered: Feb 2006
Location: Belgium
Distribution: Debian
Posts: 84

Rep: Reputation: 15
repair grub with RAID5


I'm running a software RAID5 system and I'm simulating some worst case scenarios.
the system is set up like this:

Code:
sata1 (disk 0): 
-------------------
/boot: 100 MB
rest is for RAID5 + LVM (500G)

sata2 (disk 1):
-------------------
everything for RAID5 + LVM (500.1G)

sata3 (disk 2):
-------------------
everything for RAID5 + LVM (500.1G)

sata4 (disk 3):
-------------------
everything for RAID5 + LVM (500.1G)
this system works great.
then I removed disk 2 from the array and formatted it.
after that I put the disk back in the RAID and rebooted the system.
the kernel complained that volume group was corrupted etc (which is normal offc)
so I booted into single user mode and added the disk again to the array, the syncing started and after a while the data was restored.
Test case succeeded

Onto the next worst case scenario:
suppose disk 1 crashes (the disk with the /boot partition), then the system won't boot anymore.
So I simulated this by taking out disk 0 and formatting it.
Then I tried to restore it by making again 2 partitions, 1 of 100 MB for /boot and the rest for RAID.
I also had a copy of all the contents from the original /boot so I copied this to the new /boot partition.
But the system won't boot anymore.
I also tried with grub-install in knoppix, but I can't restore it.

Any ideas on how to recover from a scenario like this??

grtz

Last edited by kristof_v; 06-21-2007 at 04:24 PM.
 
Old 06-21-2007, 06:34 PM   #2
rtspitz
Member
 
Registered: Jan 2005
Location: germany
Distribution: suse, opensuse, debian, others for testing
Posts: 307

Rep: Reputation: 32
put /boot on raid1

disk1: d1p1, d1p2
disk2: d2p1, d2p2
disk3, d3p1, d3p2


* d1p1 + d2p1 --> raid1 /dev/md0 --> /boot

* d1p2 + d2p2 + d3p2 --> raid5 /dev/md1 --> LVM

install grub on disk1 and disk2

example: (disks must be synced before that = system installed on both)

> grub
> device (hd0) /dev/sda
> device (hd1) /dev/sdb
> setup (hd0)
> setup (hd1)
> quit

of course this grub procedure must be matched with the device.map file and the menu.lst entries. now if one of the 2 system disks should fail you can use the other one to boot, resync and reinstall grub like above. as no devices like /dev/hda would be mounted but only raid/lvm devices shifting the order of disks may not be a problem as during the boot phase the physical devices should be scanned for raid signatures and assembled accordingly - no matter if the device names have changed or not (should be tested!)

what I don't understand is why your system complained about corrupted LVM ! ? !
the raid5 layer below lvm should have coped with one missing disk and your system should have booted normally (except for the raid error).
 
Old 06-21-2007, 06:48 PM   #3
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Squeeze 2.6.32.9 SMP AMD64
Posts: 3,245

Rep: Reputation: 121Reputation: 121
You should be able to put a copy of the MBR (first 446 bytes of sector 0 of boot disk) on a CD/floppy and restore from that. There is also a program called "Super Grub Disk" that bailed me out once on my test system which boots from a FakeRaid array. Actually I had just restored a backup onto the array to install the OS and couldn't get grub installed. SGD fixed it right up.
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
SuSE 10.1 GRUB BootLoader how to repair riba43 Suse/Novell 20 02-24-2007 03:41 AM
can you repair grub over network? kissthis66 Linux - Laptop and Netbook 1 02-14-2007 04:24 PM
how to repair grub without bootable floppy UFC Linux - General 4 07-03-2006 06:10 PM
Repair grub? nyroc Linux - Newbie 1 01-09-2003 07:50 PM
Grub repair Snake007uk Linux - General 13 05-10-2002 08:14 AM


All times are GMT -5. The time now is 03:57 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration