LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 01-07-2008, 09:34 AM   #1
mreeves
LQ Newbie
 
Registered: Jan 2008
Posts: 3

Rep: Reputation: 0
RAID1 Set up using GRUB Bootloader


Hello fellow users of the world wide web! Glad to have found this forum...

Anyway!... Until a few days ago, it had been about three years since I
had installed any type of linux OS. I attempted to install Mandrake
and Fedora using, on two separate occasions, a dual boot with WinXP.
I tried doing this with a Toshiba laptop, which unfortunately had an
Atheros wireless card, which I depended on to get an internet
connection. Long story short... I loved the interface and was able to
get a lot of things working, but I can't remember if I ever got the
Atheros card to work, and even if I did I became way too busy to deal
with the rest of configuring it to the way I want.

Well, now I speak to you from a job I acquired a year ago and I have
been given the green light to set up a small linux box with two hard
drive RAID1 (mirror) configuration to use as an archive server for
email messages. I started the hunt and first found an older machine
in our arsenal of grave-yard parts and then gave it life with two
500GB Hard Drives. I then looked around for a good flavor of linux
and ended up settling on Debian because it appeared to be one of the
most favored and easy-to-use. I need ease because I am a one-man IT
guy here and don't have too much time to do a lot of configuring! I
know that in the end I will spend a lot of time.. but hey, at least
I'm getting paid to learn!

Anyway... I ordered some Debian DVDs and they quickly came. I have
determined that I ordered Debian Linux 4.0r0 with kernel 2.6.18
installed at the moment.


Okay... now that you know my background in linux... which is very very
little, now let me tell you what the state of the machine is in
currently. As I mentioned, I have installed Debian 4.0r0 "etch" and
have determined that the kernel 2.6.18 was installed. I have
attempted to follow the instructions of Page 2 Debian software RAID1 HOWTO
to do an initial attempt at setting up RAID1. As the article stated
about it being used merely for experimental purposes... my first go-
around here is mainly to learn the aspects of everything, even if it
isn't working correctly and I end up having to do a clean install. I
have seemed to do everything correctly and have started work on page 3
of that article. I checked and saw that the partitions i set up for
my /boot, swap, and / have set up as md0, md1, and md2 with [UU] on
all of them stating, I believe, that both hard drives are configured
properly. In fact, all indication shows that everything is running
perfectly well.

The only issue I seemed to have was that the GRUB bootloader got
installed on my secondary HDD. I determined this to be possible
because after the initial installation and starting to boot into the
system, I found that it would not boot into linux until I switched the
boot-up procedure to start with the second hard drive. I figured that
it wasn't anything to be alarmed about and decided to go ahead and
continue with installation procedure based on that article as if I was
on the first hard drive, except whatever I had to do to "secondary"
hard drive would actually be done on my "primary." So now I am down
to the part where I set up the GRUB bootloader onto the secondary hard
drive and that is where I run into an issue. I do the command vi /
boot/grub/menu.lst so that I can go in and edit it and lo and behold,
what the article said to do seemed like it was mostly completed.
There only issue was that the two boot configurations where completely
identical and therefore I decided to go ahead and attempt to change
one around so that it reflected the other hard drive. But, trying to
type was unsuccessful and I wasn't sure why. I finally got some sort
of warning that I was editing a read only item. I was then able to
type, but, for example, the arrows where like a, b, c, and d and the
numbers moved things around and the actually letters wouldn't do
much. I did type su root when I first got into the terminal, (I am
using the GNOME GUI), but it never asked for a password. I figured
that since I had set it to automatically remember the root password on
my system under my name earlier that it could be the cause... but
since it stated "read only" when trying to edit, I was led to believe
otherwise.


Please remember a couple things...
1.) I am not putting this system into production yet. I am merely
utilizing it so that I can learn how to set it up properly and make
all the mistakes I need to. Then I will do a fully clean install and
run through the entire procedure again, do tests to make sure things
are working correctly and then set it up to do the job it is meant to
do.

2.) I am sure I am way over my head with this stuff. I like to think
I'm very proficient in computers but that's mainly windows based
systems. I haven't spent too much time with linux and my current
project is to set up a clean, updated, version of Debian linux with a
RAID1 configuration between my two 500GB hard drives. I liked the
article I read when he stated the three partitions he liked setting
up. It seemed simple and efficient, but maybe someone wants to give
me their opinion on partitioning setups or a good article to read up
on? Anyway... back to the main point... I plan on getting myself a
book... Actually I've already got an Amazon web page open and am
looking at some books to pick up. I don't think, however, I need a
book to do two things... install Debian and set up Raid1
configuration. It would baffle me to believe those two steps are
hard, especially when I have already done 90% of the work. Maybe I
do, and if there's a really good book on either, (more preferably the
RAID1 config), then please let me know!

3.) You may notice the article is using 2.6.8 kernel, but if you
recall I said I have 2.6.18. I am aware of that and it very well
could be my single biggest problem about this GRUB bootloader issue I
am having. Maybe I could get some help to determine the differences
and workarounds.



I have decided after dealing with this that I will be learning my way
around a linux system all that I can.

I hope to hear from you.

Thank you!!!
--Mike
 
Old 01-08-2008, 12:25 PM   #2
mreeves
LQ Newbie
 
Registered: Jan 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Alright, I realize my post above was way too long and hopefully some will find the time to read it... but for those who have other things to do in there lives, here is a significantly shorter story to my issue.

O/S: Debian 4.0r0 "Etch"
Kernel: 2.6.18
Current Set Up: (2) 500 GB HDDs running as RAID1. Typing the command, (I can't remember it off-hand), I see that it shows the [UU] for the MD0, MD1 and MD2, which according to the article: http://www200.pair.com/mecham/raid/raid1-page2.html means I am running a successful RAID1 configuration.

ISSUE AT HAND
My only problem is the GRUB bootloader. I want to set it up so I can boot into either HDD but I have not set it up and the article mentioned above attempts to show me, but I am unable to edit the bootloader file, (leave me alone... I'm a huge newb when it comes to linux)! Either...

A.) How do I get it to edit and not tell me that file is read-only? This way I can finish off with what that article states, (realize, however, that article also says it was running 2.6.8 and I have found that a lot of things have changed in this regard and would not think following the article would help too well).

B.) Is there somewhere, or can someone help me, finish off this RAID1 configuration so that it will boot into either HDD using kernel 2.6.18. I have attempted to boot, just to see what it does, into both hard drives and one will just hang there, which leads me to believe the bootloader isn't running.

The Weird: When I set up this RAID1 configuration, I was first booting in and it hung... I realized that the bootloader did not install onto the primary hard drive, but rather the secondary hard drive. I went into BIOS and changed the boot sequence to HDD2 and it worked fine, (HDD1 = Primary Master; HDD2 = Secondary Slave).


Again, I hope this short version will be much more help for someone to help me get this thing off and running.

Thanks a lot!
--Mike
 
Old 01-12-2008, 07:31 AM   #3
tellef
LQ Newbie
 
Registered: Aug 2005
Location: Norway
Distribution: Slackware & Debian.
Posts: 23

Rep: Reputation: 15
Hi.
I have a working raid1 setup. I also had the problem you refer to but since i use the lilo bootloader i cant give you the exact commands to issue.
But what you need to do is basically to tell your bootloader that it is going to handle more than one disk, and to install install itself on both disks. In lilo this is done by adding a few magic lines at the beginning of lilo.conf and then running it. This article might help you further:

http://www200.pair.com/mecham/raid/raid1.html

As always: Google is your fiend.....
 
Old 01-14-2008, 02:11 PM   #4
mreeves
LQ Newbie
 
Registered: Jan 2008
Posts: 3

Original Poster
Rep: Reputation: 0
I understand google is my friend and I googled the crap outta this problem. Also if you re-read what I mentioned above, that website is the site that I used to get where I was, and yes I had read every one of his articles. I was merely asking if anyone could help a new linux guy comprehend some of this stuff so I could learn from it.

I definitely appreciate your response! I was able to finally figure out what the website was telling me to do through the help of someone at another forum.

Again... i truly appreciate you responding to me and thank you for your insights!!
--Mike
 
Old 03-14-2008, 08:34 PM   #5
centuser1
LQ Newbie
 
Registered: Mar 2008
Posts: 4

Rep: Reputation: 0
Quote:
Originally Posted by mreeves View Post
I understand google is my friend and I googled the crap outta this problem. Also if you re-read what I mentioned above, that website is the site that I used to get where I was, and yes I had read every one of his articles. I was merely asking if anyone could help a new linux guy comprehend some of this stuff so I could learn from it.

I definitely appreciate your response! I was able to finally figure out what the website was telling me to do through the help of someone at another forum.

Again... i truly appreciate you responding to me and thank you for your insights!!
--Mike

you may want to do this for a raid 1 mirror system and for the hot spare..



From the root prompt, type " grub ", then follow the example below

grub>find /grub/stage1
(this will list your drives like (hd0,0), (hd1,0), etc)

if you are still in the last part of installation (i.e. the mirror is still 'mirroring' after initial install, there may be issues of the hot spare not being able to be bootable...after the mirror is done, it should be fine.)

Assuming sda is the bootable one already....

For b and c drives use the commands below

for sdb

Grub>device (hd0) /dev/sdb
Grub>root (hd0,0)
Grub>setup (hd0)

for sdc (should be your spare)

Grub>device (hd0) /dev/sdc
Grub>root (hd0,0)
Grub>setup (hd0)


now not only will both mirrors be bootable, but should one die and the hot spare take over, it too will be bootable.

except....apparently making the hot spare bootable is difficult as it is usually blank partitions. Have not tested yet, but I htink you have to copy the files from your boot partition to the boot partiion of the spare drive and then do the grub thing....still working on that

Last edited by centuser1; 03-17-2008 at 11:07 AM.
 
  


Reply

Tags
raid, raid1


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
LXer: How To Set Up Software RAID1 On A Running System (Incl. GRUB Configuration) (De LXer Syndicated Linux News 0 11-29-2007 02:20 PM
Moving transfering Installed OS Disk to RAID1 set Andrew_OC Red Hat 2 04-09-2007 10:31 AM
Moving transfering Installed OS Disk to RAID1 set Andrew_OC Linux - Server 2 04-09-2007 10:16 AM
SuSe 10 + GRUB + RAID1 questions TimBee Suse/Novell 5 12-22-2005 06:23 AM
How can I disable the grub bootloader and enable the lilo bootloader? abefroman Linux - General 1 08-06-2005 08:53 AM


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