Page 1 of 25 12311 ... LastLast
Results 1 to 10 of 245

Thread: Grub Rescue Prompt Megathread

  1. #1
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Grub Rescue Prompt Megathread

    The Grub Rescue Mode Megathread

    (The Grub Rescue Hijack Thread)


    What's with the Subtitle?
    Adding "Me Too" Posts just aren't proper etiquette. And who can think of an original title on this subject. So feel free to discuss your problem here, but read the rules first! Oh, and it's not "Grub 2" because Grub legacy doesn't have a 'grub rescue' prompt; if you see 'grub rescue>', you are using Grub 2.

    Should I Be Here?
    If you end up at a Grub rescue prompt while trying to boot to a normal installation, this thread may help. A 'grub rescue>' prompt means that Grub 2 has read the MBR but can't find the grub folder, specific files, and/or a usable grub.cfg file. If you see a 'grub' prompt, you have more capabilities such as TAB Complete and scrollback, but you can try the same procedures to restore Grub 2.

    If you are using Wubi (Ubuntu within Windows), there is a specific section for Wubi users marked "Wubi Only". However, I would recommend you proceed to forum member Rubi 1200's guide for dealing with Wubi related problems: Wubi Megathread. Wubi boot problem descriptions and the rememedies are well-documented on that site.


    What Should I Try First?
    If possible, obtain and boot an Ubuntu installation CD (LiveCD) or bootable USB. You can obtain the Live CD iso file from http://www.ubuntu.com/desktop/get-ubuntu/download. Preferably use a CD of the same version you are trying to recover; if you don't have the same version, use a more recent release to get a later version of Grub 2.

    From the LiveCD Desktop, there are several things that you can do that will either fix Grub 2 problems or give you information that can help.
    • Use Nautilus, GParted or Disk Utility to determine your Ubuntu partition. Disk checks can be accomplished with Disk Utility or Gparted, both accessed via the System, Administration menu.
    • Mount your Ubuntu installation and attempt to edit your real installation's boot files.
    • Run the boot info script by forum member meierfra.
    • Access the forums and Internet for help.

    If you can get to the LiveCD, many Grub 2 problems can be solved by 1) reinstalling the bootloader or 2) purging/reinstalling Grub2. Purging and reinstalling has the advantage of repairing corrupted files and installing files manually deleted by the user. Nevertheless, the reinstall option should be attempted first.




    I'm Still Stuck at the 'grub rescue>' Prompt
    1. If you are reading this, it should mean:
    2. You haven't been able to fix things from the LiveCD.
    3. You can't boot to the Desktop (no CD, no CD-ROM, no bootable USB, no Internet)
    4. You couldn't get the HOWTO referenced in the previous section to work.
    5. You didn't read the previous stuff nor view the HOWTO linked above because you are the impatient type.


    • OK, fine. Hijack this thread! Let us hear your pleas! But first, read:


    Rules for Posting !
    • Your first post if you need help must include the RESULTS.txt contents from meierfra's boot info script
      • Go to http://bootinfoscript.sourceforge.net/
      • Follow the instructions on the site on how to download and execute the script.
      • Start a new post. Press the # icon in the post's menu bar. This will generate [code] [/code] tags. You may also manually type them. Paste the contents of RESULTS.txt between the 'code' tags.

    • Explain why the procedures below didn't work. Include error messages if possible.
    • Note to helpers: Since there may well be multiple users with problems, be sure you identify to whom your post is directed via brief quotes or "@ forum-username".
    • Since multiple users will be seeeking help, be specific - No "It didn't work" posts. Be specific on what did or did not work!


    'grub rescue>' Boot Procedures (About Time!)
    The short version - the commands you must run. Substitute the correct values for X,Y. If these commands fail or you want explanations, refer to the next entry - "Commands you may need to run"
    Code:
    set prefix=(hdX,Y)/boot/grub  # Example: (hd0,1) , (hd1,5)
    set root=(hdX,Y)
    insmod linux
    linux /vmlinuz root=/dev/sdXY ro  # Example: root=/dev/sda1 , /dev/sdb5
    initrd /initrd.img
    boot
    Commands you may need to run if the previous command set failed:
    Text in bold black are commands to be entered at the 'grub rescue>' prompt. If there is an X,Y component, substitute the correct value for your Ubuntu partition. Example: (hdX,Y) >> (hd0,5); sdXY >> sda5

    1. Locate the Ubuntu Partition.
      • ls - This will display the known drives/partitions.
      • Drives are designated (hd0), (hd1), etc. Partitions are designated (hd0,1), (hd0,2), (hd1,1), etc
      • The Ubuntu partition will be one of the (hdX,Y) formatted returns.
      • If all you get is (hd0) you most likely have a partition table or disk error. Seek assistance elsewhere! (fsck, e2fsck, TestDisk, etc.)

    2. Locate the grub folder.
      • ls (hd0,1)/boot/grub - Try each partition (hd0,1), etc. until you find your grub folder
        • If you don't find the /boot/grub folder, start with a wider search and narrow the search once you find the Ubuntu folders:
        • ls (hdX,Y)/ # Look for the Ubuntu folders, such as lost+found, /bin/, /boot, /home,
        • ls (hdX,Y)/boot # Look for the grub folder.
      • The grub folder will contain dozens of *.mod files, as well as grub.cfg

    3. Set prefix and root.
      • set prefix=(hdX,Y)/boot/grub
      • Example: set prefix=(hd0,5)/boot/grub
      • set root=(hdX,Y)
      • Example: set root=(hd0,5)

    4. Confirm the prefix and root settings.
      • set

    5. Load Modules.
      • No modules can be loaded until the prefix is set correctly.
      • An incorrect path or missing file will result in an "unknown command" or "file not found" error. Use the set and ls /boot/grub or ls /boot commands to verify the path and look for the specific file(s).
      • If you receive an error, return to Step 3.
      • insmod linux - if you get an 'unknown command' when entering the 'linux' command later, repeat using: insmod /boot/grub/linux.mod
      • Additional modules such as normal.mod and help.mod may be loaded. Not all modules are available in rescue mode.

    6. Load the Kernel & Initrd image.
      • linux /vmlinuz root=/dev/sdXY ro
        • Substitute the correct values for X,Y - Example: sda5

      • initrd /initrd.img
      • To load a specific kernel, especially an older kernel:
        • linux /boot/vmlinuz-<kernel version> root=/dev/sdXY ro
        • initrd /boot/initrd.img-<kernel version>
        • Example: linux /boot/vmlinuz-2.6.35-22-generic root=/dev/sda5 ro
        • Example: initrd /boot/initrd-2.6.35-22-generic


    7. Boot.
      • boot



    Wubi Only.
    Forum member Rubi1200 has created an excellent site for dealing with Wubi related problems. You can continue with the instructions below but I would recommend you go to his forum guide, which deals specifically with Wubi:
    Wubi Megathread

    The procedures below show the procedures from a normal Wubi Grub 2 prompt. In my testing, the modules were already loaded so a bad Wubi installation may react differently. However, by seeing what is normal for Wubi you may be able to also return it to a bootable state.

    Attention Wubi 9.10 Users.
    You may need to copy a new version of the file "wubildr". Here is the link to forum member meierfra's guide on how to do that:
    Boot Problems:Wubi 9.10

    Booting from the Wubi Grub prompt requires different commands as the file locations are not the same as for a normal Ubuntu installation.
    • The Wubi files are not on an Ubuntu partition. They are contained in a Windows partition within a Windows file: /ubuntu/disks/root.disk
    • If you want to inspect your Wubi files from the Live CD (and possibly repair them or retrieve data):
      • Determine the Windows partition (/dev/sdXY) Example: /dev/sda1
      • Make the mount points and mount Windows: sudo mkdir /mnt/windows && sudo mount /dev/sdXY /mnt/windows
      • Make the Wubi mount point and mount the Wubi file: sudo mkdir /mnt/wubi && sudo mount /mnt/windows/ubuntu/disks/root.disk /mnt/wubi

    • At the grub prompt, the modules are not contained in the /boot/grub folder, but in the Wubi folder: (loop0)/usr/lib/grub/i386-pc/
    • Review the procedures and explanations in the previous sections and refer to those sections for additional guidance.
    • If you encounted an error, review the similar step above for possible solutions.
    • With a 'grub>' prompt, TAB COMPLETION may be available.
    • Run the commands only from this section. Do not run the commands in previous sections.


    The short version - the commands you must run. Substitute the correct values for X,Y. If these commands fail or you want explanations, refer to the next entry - "Commands you may need to run"
    Code:
    set root=(hdX,Y)  # Example: (hd0,1) , (hd1,5)
    loopback (loop0) /ubuntu/disks/root.disk
    set root=(loop0)[/B]
    linux /vmlinuz root=/dev/sdXY loop=/ubuntu/disks/root.disk ro  # Example: root=/dev/sda1 , /dev/sdb5
    initrd /initrd.img
    boot

    Commands you may need to run if the previous command set failed:
    1. Locate the Ubuntu Partition.
      • ls - This will display the known drives/partitions.
      • You should see (memdisk), (loop0), and your Windows partition (hdX,Y) or (hdX,msdosY)

    2. If there is no (loop0):
      • set root=(hdX,Y) # X,Y is your Windows partition. Example: sda1: X=0, Y=1; sdb5: X=1, Y=5
      • loopback (loop0) /ubuntu/disks/root.disk

    3. Locate grub.cfg.
      • ls (loop0)/boot/grub - Only the grub.cfg & grubenv files may be present.
      • No *.mod files will be present.

    4. Set prefix and root.
      • set prefix=(memdisk)/boot/grub
      • set root=(loop0)

    5. Confirm the prefix and root settings:
      • set

    6. Load Modules.
      • Some modules may already be loaded.
      • No modules can be loaded until the prefix is set correctly.
      • Available modules: ls (loop0)/usr/lib/grub/i386-pc/
      • An incorrect path or missing file will result in an "unknown command" or "file not found" error.
      • You can check the currently loaded modules with: lsmod
        • If the output scrolls off the screen: set pager=1

      • insmod (loop0)/usr/lib/grub/i386-pc/linux.mod
      • To load additional modules:
        • insmod (loop0)/usr/lib/grub/i386-pc/<module.mod>


    7. Load the Kernel & Initrd image.
      • linux /vmlinuz root=/dev/sdXY loop=/ubuntu/disks/root.disk ro
        • * Substitute the correct values for X,Y - Example: sda5

      • initrd /initrd.img
      • To load a specific kernel, especially an older kernel:
        • linux /boot/vmlinuz-<kernel version> /dev/sdXY ro # TAB to complete the kernel version but don't forget the additional entries.
        • initrd /boot/initrd.img-<kernel version> # TAB to complete the kernel version.
          * Example: linux /boot/vmlinuz-2.6.35-22-generic root=/dev/sda5 ro
          * Example: initrd /boot/initrd-2.6.35-22-generic
      • initrd /initrd.img

    8. Boot.
      • boot


    Selected Links.
    Grub 2 Community Doc - Rescue Mode
    HOWTO: Purge & Reinstall Grub 2 from the Live CD
    Meierfra's Boot Info Script
    Last edited by drs305; December 31st, 2010 at 02:34 PM. Reason: Wubi prompt boot instructions - revised & simplified.
    Back to Xorg...

    Retired.

  2. #2
    Join Date
    May 2006
    Location
    Nebraska
    Beans
    480
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Grub Rescue Prompt Megathread

    I encountered this problem after installing Maverick. I attempted to boot to my LiveUSB to reinstall grub only to have the computer boot normally after I selected "USB" from the menu. A few more tries determined that this was the only way to avoid the rescue prompt. Apparently Grub somehow installed itself to my USB stick. While booted up I did:

    Code:
    sudo grub-install --recheck /dev/<proper harddrive>
    This fixed the issue, and now my computer boots as expected. I think I'll have to remake that LiveUSB, though.

  3. #3
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Grub Rescue Prompt Megathread

    Thanks CarpKing.

    In my chroot thread I've added the '--recheck' switch. One of my concerns is that users will go straight to the commands in this thread rather than attempt to fix the issues by reinstalling Grub 2. Since your's is the first response it will reemphasize the point.
    Back to Xorg...

    Retired.

  4. #4
    Join Date
    Aug 2007
    Location
    a puddle in Manchester
    Beans
    9,198
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Grub Rescue Prompt Megathread

    Wow, a comprehensive cornucopia of commands for grub rescue Just what the doctor ordered!
    MacBook Pro 10,1 retina

  5. #5
    Join Date
    Jun 2006
    Location
    Austrian in Taiwan
    Beans
    Hidden!
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: Grub Rescue Prompt Megathread

    It keeps the original error (with step 5):

    grub rescue> insmod linux normal help
    error: the symbol 'grub_puts_' not found
    I am from the government, I am here to help you! Just ask!
    And don't expect more to be happen than with any other government!

  6. #6
    Join Date
    Jan 2010
    Location
    Traverse City, MI, USA
    Beans
    4
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Grub Rescue Prompt Megathread

    I'm with ELMIT in that when i get to step 5, loading modules, i get the "error: the symbol 'grub_xputs' not found" business. any insight is appreciated!

  7. #7
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Grub Rescue Prompt Megathread

    The 'xputs' error is not one that I know the procedure will work on - I was hoping it would. I've done a bunch of searching but haven't located a solution. I'll try the Grub IRC channel and see if the devs can provide any solutions.

    In the bug reports, one user said he solved it by purging/reinstalling Grub2. There is a link to this procedure in the "What should I try first?" section. Please let me know if you tried this and it didn't work.

    Update:
    The 'xputs' error is the result of an incomplete installation of Grub2. One possible cause would be selecting a bad device on which to install Grub2. In any case, reinstalling Grub 2 should fix the problem. See "What Should I Try First".

    From the developers: The xputs error can be caused by installing Grub2 on one device and then booting from another one. In this case, just switching the BIOS to boot from the original device should allow Grub2 to boot. Once booted, or after 'chrooting' from the LiveCD, the user should use "sudo dpkg-configure grub-pc" to place Grub on the second drive or all drives).
    Last edited by drs305; October 13th, 2010 at 09:56 PM.
    Back to Xorg...

    Retired.

  8. #8
    Join Date
    Oct 2010
    Beans
    7

    Re: Grub Rescue Prompt Megathread

    Guys, I'm sorry if this is not good etiquette or whatever. But I'm completely new to this. I installed ubuntu 10.10 on my Windows 7 laptop. It went fine, and it's installed. But when I restart it, I get the boot error. Windows 7 isn't on my computer anymore and ubuntu won't load up, so I can't edit any files. Also, I burned the Super Grub Disk, but every option there is says the file isn't found. Help me out, please.

    What do?

    (the reason I need help is because I don't understand all the terminology and processes you that are being discussed. :\)
    Last edited by Bernardusaurus; October 14th, 2010 at 03:16 PM.

  9. #9
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Grub Rescue Prompt Megathread

    Bernardusaurus,

    Welcome to the Ubuntu forums! We can help, but we need more information. Please boot from the LiveCD/install CD and go to the following site. Download the boot info script and run it from you computer. The instructions on how to get it to run are on the site.
    http://bootinfoscript.sourceforge.net/

    It will generate a file called RESULTS.txt. Double click on the file and it should open up. Copy the contents and paste them in a new post here. The script will show us your partition information and where the boot files are installed.
    Last edited by drs305; October 14th, 2010 at 09:22 PM.
    Back to Xorg...

    Retired.

  10. #10
    Join Date
    Oct 2010
    Beans
    7

    Re: Grub Rescue Prompt Megathread

    Wow. Thank you for being so willing. I'll do that as soon as I get home.

    Thanks a lot.

Page 1 of 25 12311 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

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