LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-09-2007, 04:15 AM   #1
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Software Raid and GRUB.


Hi

Some weeks ago, I set up a new web server with Debian Etch. I set up Raid 1 on two SATA disks during the install. This friday, one of the disks crashed, and the server showed "kernel panic". I took out the disk, and rebooted, and it worked fine.

Today, I put in a new disks, made partitions, and added them to the array with mdadm. It is currently syncing over to the new disk. But I'm not sure about GRUB and the MBR. I've read
http://www.tldp.org/HOWTO/Software-R...O-7.html#ss7.3 and it says:

Quote:
If you are using grub instead of LILO, then just start grub and configure it to use the second (or third, or fourth...) disk in the RAID-1 array you want to boot off as its root device and run setup. And that's all.

For example, on an array consisting of /dev/hda1 and /dev/hdc1 where both partitions should be bootable you should just do this:

grub
grub>device (hd0) /dev/hdc
grub>root (hd0,0)
grub>setup (hd0)

Some users have experienced problems with this, reporting that although booting with one drive connected worked, booting with both two drives failed. Nevertheless, running the described procedure with both disks fixed the problem, allowing the system to boot from either single drive or from the RAID-1

Another way of ensuring that your system can always boot is, to create a boot floppy when all the setup is done. If the disk on which the /boot filesystem resides dies, you can always boot from the floppy. On RedHat and RedHat derived systems, this can be accomplished with the mkbootdisk command.
Here is the setup:
/dev/md0 mounts to "/" - using /dev/sda1 and /dev/sdb1
/dev/md1 mounts to "/var" using /dev/sda3 and /dev/sdb3
Swap is on /dev/sda2 and /dev/sdb2

The disk that crashed was /dev/sdb. So I think I should maybe run:
grub
grub>device (hd0) /dev/sdb
grub>root (hd0,0)
grub>setup (hd0)

Am I correct? I'm worried I may mess it up, and it won't boot. I don't know GRUB at all. Is there a mkbootdisk command in Debian like for RedHat? I was thinking of using a floppy for backup, and I looked at mkboot, but I'm not sure if it works or not. Is it possible to just put the MBR on the floppy so it boots the kernel from /dev/md0?
 
Old 07-09-2007, 04:35 PM   #2
BillyGalbreath
Member
 
Registered: Nov 2005
Location: Houston Texas
Distribution: Debian Sid
Posts: 379

Rep: Reputation: 31
if your boot disk (disk the bios boots) is hd0, then install to that.
 
Old 07-16-2007, 07:41 AM   #3
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Original Poster
Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Hi

I'm not sure if you understood what I wrote. Since the server boots, of course GRUB is installed on the "first disk". But as I understand it, using the Raid setup in the installer, the server can boot even if any disk fails. If my "first disk" fails in the future, I think there is no MBR on the second, and it cannot boot. I wish I knew how the installer does it, I haven't found out yet.

Oh well..
 
Old 07-27-2007, 02:22 PM   #4
Jdspinz
LQ Newbie
 
Registered: Jul 2007
Distribution: Debian, CentOS,
Posts: 1

Rep: Reputation: 0
Cool

Hello,
I just found your post while looking for some similar info.

You’re right about running grub, but in this case you will run grub as below.

# grub
grub>root (hd1,0)
grub>setup (hd1)

I found a document describing what you are looking for and its towards the end of the document.
http://www200.pair.com/mecham/raid/r...aded-etch.html

Make sure to send your regards to Gary V. because he spent the time to research all this, wrote it down, and put it on display over the net.

Thanks Gary. .

Last edited by Jdspinz; 08-03-2007 at 11:33 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
Software RAID, Ubuntu, and Grub problem rookiepaul Linux - Server 9 08-22-2008 03:35 PM
Boot Windows XP software raid with Grub jw230 Linux - Hardware 1 10-16-2006 08:31 AM
Having grub boot a windows software raid volume. byteframe Linux - Hardware 1 07-10-2006 11:51 AM
Replacing a drive in /boot, software RAID-1 + GRUB tobiasly Linux - Hardware 1 12-21-2005 12:08 AM
Grub software raid problems syamajala Linux - Distributions 7 01-07-2005 07:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

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