LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   RAID1 Set up using GRUB Bootloader (https://www.linuxquestions.org/questions/debian-26/raid1-set-up-using-grub-bootloader-611750/)

mreeves 01-07-2008 09:34 AM

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

mreeves 01-08-2008 12:25 PM

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

tellef 01-12-2008 07:31 AM

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.....

mreeves 01-14-2008 02:11 PM

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

centuser1 03-14-2008 08:34 PM

Quote:

Originally Posted by mreeves (Post 3022257)
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


All times are GMT -5. The time now is 01:16 AM.