Posted by: Odzangba | March 10, 2007

How to restore GRUB using the Ubuntu Live CD

After deleting my fiesty fawn partition late yesterday, Grub came choking with an Error 22 message. No big deal, I thought… all I have to do is re-install grub. So I got out my dapper livecd and fired the pc up. I executed the grub-install command with the appropriate options and rebooted the pc… Error 22 again! Repeated the process… no change. So I got out my breezy alternate install cd and skipped to the “install grub boot loader step”. Grub installation failed! Now I was in big trouble. If all else fails, google is the way.🙂 I found some instructions on using the grub shell to install grub and that worked! So for those who need to install grub using the ubuntu dapper (and above) livecd, here they are:
Open the terminal and enter the following commands

sudo grub
find /boot/grub/stage1
(Use the output from this command in the next command)
root (hd0,1)
setup (hd0)
quit

You may have to modify the hard disk parameters to suit your setup… that’s what the second command helps you do. My root partition is the second on my first hard disk. If yours is the first for instance, then you’ll have to modify the “root” step as follows:

root (hd0,0)

Hope this helps someone.😀


Responses

  1. Very Helpful.🙂

  2. Glad it was of any help.😀

  3. good tutorial🙂

  4. Thanx man.🙂

  5. Quick and easy. Thanx

  6. After struggling for the whole night, trying to restore grub after a reinstall, had to install Suse on one of the vacant partitions, and then recovered Fiesta. Even so, UUID of swap has changed, and I am entering by Ctrl+D. Noted your commands for future use. Thanks a lot.

  7. Ah !! Thanks a lot🙂
    I tried to install linux on my HP dv6000t laptop, which had XP only. I wanted it with dual boot xp and ubuntu. but I could not get XP (original that I got with laptop) and ubuntu together. However I am half the way through.

    This helped me🙂

  8. […] GRUB as Windows XP wiped out my MBR. I got out my Feisty disc and went through the steps listed here but it seems that way of doing things doesn’t work with Feisty. The machine was croaking with […]

  9. Could anyone please help me and tell me why “sudo grub” doesn’t work from my ubuntu live cd (hoary hedgehog). it always says “bash: grub: command not found”….thanks in advance!

  10. Ubuntu 7.04 Feisty gives “Error 27: Unrecognized command” after typing “root(hd0,1)”.

    Me have no idea… me stuck😀

    I installed Windows 2003 and knew that I would come across this problem… but I though I could fix it… seems like not😀

    Still searching though…

    Thanks for the post anyway!

  11. http://ubuntuforums.org/showthread.php?t=224351

    This post is complete on the Ubuntu Forums on how to restore GRUB.

    It uses “find boot/grub/stage1” to make sure you enter the correct drive to “root (hd?,?)”.

    The steps are then the same as you said. TNX!

  12. Thanks for mentioning the tip here, Ray. I’ll soon update my little how-to to include it.

    Cheers,
    Odzangba

  13. I still have problems after reinstalling grub says it cant mount the partition(ubuntu ext2 linux partition).

  14. Thanks dude!

  15. thanks for your nice activity,
    may be i need my self blog

  16. yes, it helped me a lot

  17. Yippie. Thanks so much for your time to put this on your blog :))

  18. Thanks. It works for me ^^

  19. Thanks !

  20. when i went to vista partition it says mbrmgr missing
    crtl+alt+del to restart

  21. yeahhh thx!!! worked perfectlly! thank you fine sir very much ^^

  22. Thank you. Very helpful and it saved the day for me.

  23. Thanks!

  24. Поставте антиспам

  25. Viagra is taken orally and helps men suffering from erectile dysfunction achieve and maintain an erection vaigra discount generic ! For cialis comprare very fast delivery Europe! Save your time – buy cheap levitra pill now… Fast to get levitra pills online. Find out more about erectile dysfunction at the official cialias cheap site…

  26. Cheap cialis is taken orally and helps men suffering from erectile dysfunction achieve and maintain an erection vaigra softtabs fast … For viagra gb very fast delivery Canada… Save your time -buy sexual health pills on line! Easy to get priaprism pills online.. Find out more about ed treatment at the online clialis cheap generic site

  27. It didn’t work correctly. I got grub installed and kubuntu loads fine, but when i try to load vista it says there is mbr missing. And is it normal that the interface is so dos-like?

  28. Thanks so much. This helped me to get my Intrepid happy again. (oO)
    jjjj

  29. it fails when I enter the command “setup (hd0)” here’s he message :
    “grub> root (hd0,5)

    grub> setup (hd0)
    Checking if “/boot/grub/stage1” exists… yes
    Checking if “/boot/grub/stage2” exists… yes
    Checking if “/boot/grub/e2fs_stage1_5” exists… yes
    Running “embed /boot/grub/e2fs_stage1_5 (hd0)”… 16 sectors are embedded.
    succeeded
    Running “install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,5)/boot/grub/stage2
    /boot/grub/menu.lst”… failed

    Error 12: Invalid device requested”

  30. please help me out with this🙂

  31. if i am installing ubuntu os 100 hard disk per hour , i use ghost system , ( hard to hard copy ) , give me a solution how to grub repair with out loading live cd or easy system to repair grub

  32. Thanks a lot. This solved it for me (I had grown an Ubuntu system partition to take over a Debian partition and mbr was gone) I was only finding solutions that involve using a Win rescue disk. Also thanks to Ray for the link with the extra discussion.

  33. Thanks man!

  34. yup its great……

    but many have the prob with stage1 not being found

    i.e $find /boot/grub/stage1
    gives an error of not found or so..

    in this case we need to mount the boot
    here’s it is ..coz i faced the same prob

    $root (hd0,**hint**)
    **hint** press tab to see all the parttion and know which partition is ext3 ot ext2

  35. yup its great……

    but many have the prob with stage1 not being found

    i.e $find /boot/grub/stage1
    gives an error of not found or so..

    in this case we need to mount the boot
    here’s it is ..coz i faced the same prob

    then type the following using a live cd of ubuntu or any..and in terminal

    use sudo whereever needed
    mkdir /mnt/orange/
    mount /dev/XXX? /mnt/orange (XXX i.e.sda1..)
    chroot /mnt/orange /bin/bash
    grub-install /dev/XXX (XXX i.e . hd0)

  36. Thank you Thank you Thank you, I damaged my grub and went to many web sites stumbling to fix grub and yours was the only one that was accurate and understandable. You fixed my problem!

  37. To too had a problem, stage 1 not found, but I did have to modify the hard disk parameters within setup.

  38. Hi.
    I have installed Ubuntu 9.04 as windows application long back using wubi.
    Now when i restart my PC its giving the menu to select either windows or ubuntu.But when i cliked on ubuntu its giving the following error “Cannot find GRLDR”. Please tell me how to get out of this issue.Atleast how to get the ubuntu data backup.

  39. […] How to restore GRUB using the Ubuntu Live CD « Odzangba Kafui Dake’s BlogAn option for fixing grub error 18? I’ll reboot now and try it. […]

  40. Aw! Saved my day😀

    Straight to the point🙂

    You have a free dinner in Rome if you get here someday😉

  41. Thanks for your tip. I recently install windows 7 after installing ubuntu. This post helped me to recover my GRUB.

  42. […] version 9.10, Ubuntu uses the GRUB2 boot loader and manager on clean installs. This means my earlier post on how to restore GRUB will not work properly. To restore the boot loader on these versions of Ubuntu (and possibly any […]

  43. It’s funny to find out just how many different blogs the internet has on this topic. I don’t know if
    I will have to be back here, but it is awesome to know I stumbled upon the one that has a lot of valuable stuff if this comes up
    for me another time.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: