Find the answer to your Linux question:
Results 1 to 4 of 4
Hello everyone, first post so please bare with me - installed Ubuntu from a Live CD iso - onto a slave HD. Running Vista HP on master. I partitioned the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2008
    Posts
    3

    Can't boot up - just get "grub" help!


    Hello everyone, first post so please bare with me - installed Ubuntu from a Live CD iso - onto a slave HD. Running Vista HP on master. I partitioned the drive half for Vista backups and half for Ubuntu. I let Ubuntu do the install and all went well. I have made the Ubuntu desk top look and feel how I like it and was pretty impressed. The only mod I have made was to the dual boot order through terminal as Ubuntu was booting first and wife didn't like it that way. I followed the instructions for terminal which was pretty straight forward to alter boot order from default 0 to 4 which was Vista. All that worked OK to and have done numerous shutdown start ups since. The only other mod I have made was to install the NVidia graphics. However, come to boot up a short while ago and disaster has struck - all I am getting is a black screen and the word "grub" with a flashing cursor. I cannot get into Windows or anything else. Wife is doing her nut - I am typing this on Laptop which is a lifeline. Whatever instructions you give me will have to be "VERY SIMPLE" as I don't really understand much about terminal and CLI. I did try to follow some instructions I have read about trying to repair from live CD by mounting the drives but only one seems to mount, the swap file won't mount?

  2. #2
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    1,219
    This happened to me once. I had to boot into Ubuntu by hand, then reinstall GRUB.

    Start by typing "find /sbin/init". This will give you the grub name of the partition containing your Ubuntu files. It will be something like (hd1, 0). The corresponding Linux name (which you will also need) would be /dev/hdb1 (Linux partitions are always one higher than grub partitions because the count starts from 1 rather than 0).

    Then try the following:
    root (hd1,0)
    kernel /boot/vmlinuz<tab> root=/dev/hdb1 ro quiet
    initrd /boot/initrd.img<tab>
    boot

    You'll need to use the correct grub and Linux names for the partition; I'm assuming hdb1 for the sake of demonstration. The <tab> is a completion character. You probably don't know the exact name of your kernel or your initrd file (I certainly didn't) but grub can complete the name for you just as Linux does.

    If all goes well, Ubuntu will boot and then you can reinstall GRUB with "sudo grub-install" so that it points to the correct partition.
    "I'm just a little old lady; don't try to dazzle me with jargon!"
    www.hrussman.entadsl.com

  3. #3
    Just Joined!
    Join Date
    Aug 2008
    Posts
    3
    Quote Originally Posted by hazel View Post
    This happened to me once. I had to boot into Ubuntu by hand, then reinstall GRUB.

    Start by typing "find /sbin/init". This will give you the grub name of the partition containing your Ubuntu files. It will be something like (hd1, 0). The corresponding Linux name (which you will also need) would be /dev/hdb1 (Linux partitions are always one higher than grub partitions because the count starts from 1 rather than 0).

    Then try the following:
    root (hd1,0)
    kernel /boot/vmlinuz<tab> root=/dev/hdb1 ro quiet
    initrd /boot/initrd.img<tab>
    boot

    You'll need to use the correct grub and Linux names for the partition; I'm assuming hdb1 for the sake of demonstration. The <tab> is a completion character. You probably don't know the exact name of your kernel or your initrd file (I certainly didn't) but grub can complete the name for you just as Linux does.

    If all goes well, Ubuntu will boot and then you can reinstall GRUB with "sudo grub-install" so that it points to the correct partition.
    Thanks for prompt reply. I did however say keep it simple, I'm a Windows users so all the command lines mean nothing to me at all. I can't access anything other than a black screen and the word "GRUB" so how am I going to type in anything?

  4. #4
    Just Joined!
    Join Date
    Aug 2008
    Posts
    3
    Thanks again hazel for your offer of help and anyone else that was about to offer a fix. I have however managed to fix this issue thanks to another a post on the Ubuntu forum site - I enclose solution for anyone else that encounters the same problem as the fix instructions were pretty easy to follow and it works. -

    How to restore Grub from a live Ubuntu cd.
    ________________________________________
    This will restore grub if you already had grub installed but lost it to a windows install or some other occurrence that erased/changed your MBR so that grub no longer appears at start up or it returns an error.

    (This how to is written for Ubuntu but should work on other systems. The only thing to take note of, when you see "sudo" that will mean to you that the following command should be entered at a root terminal.)

    Boot into the live Ubuntu cd. This can be the live installer cd or the older live session Ubuntu cds.

    When you get to the desktop open a terminal and enter. (I am going to give you the commands and then I will explain them later)
    Code:
    sudo grub
    This will get you a "grub>" prompt (i.e. the grub shell). At grub>. enter these commands
    Code:
    find /boot/grub/stage1
    This will return a location. If you have more than one, select the installation that you want to provide the grub files.
    Next, THIS IS IMPORTANT, whatever was returned for the find command use it in the next line (you are still at grub>. when you enter the next 3 commands)
    Code:
    root (hd?,?)
    Again use the value from the find command i.e. if find returned (hd0,1) then you would enter root (hd0,1)

    Next enter the command to install grub to the mbr
    Code:
    setup (hd0)
    Finally exit the grub shell
    Code:
    quit
    That is it. Grub will be installed to the mbr.
    When you reboot, you will have the grub menu at startup.

    Now the explanation.
    Sudo grub gets you the grub shell.
    Find /boot/grub/stage1 has grub locate the file stage1. What this does is tell us where grub's files are. Only a small part of grub is located on the mbr, the rest of grub is in your boot folder. Grub needs those files to run the setup. So you find the files and then you tell grub where to locate the files it will need for setup.
    So root (hd?,?) tells grub it's files are on that partition.
    Finally setup (hd0) tells grub to setup on hd0. When you give grub the parameter hd0 with no following value for a partition, grub will use the mbr. hd0 is the grub label for the first drive's mbr.
    Quit will exit you from the grub shell.

Posting Permissions

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