Find the answer to your Linux question:
Results 1 to 7 of 7
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 ...
  1. #1
    Just Joined!
    Join Date
    Jan 2008
    Posts
    4

    GRUB Bootloader with RAID1 Configuration

    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

  2. #2
    Just Joined!
    Join Date
    Jan 2008
    Posts
    4
    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: Page 2 Debian software RAID1 HOWTO 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

  3. #3
    Linux User
    Join Date
    Dec 2007
    Location
    Idaho USA
    Posts
    351
    I will try to help- I uses openSuse with KDE so there might be differences. Have never use a RAID but did read the posted How To. Currently logged on to MS Win 98 so can not verify what I write.

    A)
    Would first try to use a GUI text editor
    Alt F2 enter
    konsolesu enter
    enter root password
    find the file to edit - left click - open with-find kwrite editor

    if that does not work:
    open a terminal window- click on top left to show drop down box and select ROOT terminal.
    put in root password (there will be no movement of curser) enter.
    you should now be in root.
    'joe' might be easier to use the 'vi'. For joe ctrl-k-h = help ,ctrl-c = abort.


    B)
    At the 'grub>' shell prompt create new boot records for both drives:
    root (hd0,0)
    setup (hd0)
    root (hd1,0)
    setup (hd1)
    quit
    did you run the above commands from page 3 of the How To ?

  4. #4
    Just Joined!
    Join Date
    Jan 2008
    Posts
    4
    Absolute sweetness. I tried "B" and it appears to have worked! I can't believe I missed that!!

    Is there anyway I can absolutely confirm that if one fails, the one will boot up? I did switch to HD1, (from HD2), in the BIOS and it worked, whereas before it would hang. I don't want to simulate a failed drive but I just want to know if what I did was sufficient to make sure that one will boot if the other fails or if there is a better test.

    Thanks again for your help!!!

  5. #5
    Linux User
    Join Date
    Dec 2007
    Location
    Idaho USA
    Posts
    351
    I don't want to simulate a failed drive
    I highly recommend you do so , with some type of text file written to disk to be sure you know how to recover.

    Due to the boot partition being part of the raid, I know of no way to verify what drive is being booted from.

    root (hd1,0)
    setup (hd1)
    Not totally sure but think that the command tells grub to install into MBR of hd1 and use stage 2 files from hd1,0. Where as if command was Root (hd0,0)
    Setup (hd1) would tell grub to install in MBR of hd1 but use stage 2 files from hd0,0.

  6. #6
    Just Joined!
    Join Date
    Jan 2008
    Posts
    4
    Well if I really need to simulate a failed drive, then that simply requires gently removing power from one of the hard drives? Then I can just do a format of that hard drive on another computer system and then bring it back and reset it up for RAID?

    or is there another way to do a simulation?

    Thanks!

  7. #7
    Linux User
    Join Date
    Dec 2007
    Location
    Idaho USA
    Posts
    351
    I would never remove power from a hdd with the comp on, you can blow the hdd or motherboard.

    Would like to know- how many partitions are on the hdd ? If only the 3 in the HowTo would make a change for the final setup. Would add at lest a Home/Data partition. The /root partition (the one containing linux) would not have to be very big (do not know just how big) due to you would not be adding may programs to it. The Home partition should be the largest and likely about 400g (for the email). 100g for the boot/swap/root partitions. I'm not even sure if the boot and swap partitions should be in the raid.

    ****Hopefully some one with more knowledge will jump in and help.****

    **Note: remember I have never worked with a raid setup and have little experience with linux. So the below is may gesss at what will work.

    Now to test to see if you can recover from a failed hdd--
    1) Copy some text files to your home folder .
    2) With comp turned off- remove hd0 (simulate a total failed hdd)
    3) power up to be sure hd1 will indeed boot and the text files 'step 1' are good
    3a)shut down
    4) in the HowTO -"OK, now I'm going to simulate a failed drive." jump first step below "Shut it down: shutdown -h now"
    do all the step to "We are working again. "

    4a) when you do the needed steps in the HowTO, be sure just what hdd is which.

    5) after system is up be sure the text file from step 1 are good, if so you did do it all correct, if they are not then back to the drawing board.

    Be sure when you have finished post pack to let me/others know if it worked correctly. If my advise is bad (hope not) , need to know, others may try it out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •