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. 😀
Very Helpful. 🙂
By: jayson on April 18, 2007
at 10:38 am
Glad it was of any help. 😀
By: odzangba on April 18, 2007
at 6:32 pm
good tutorial 🙂
By: antek on May 1, 2007
at 9:57 am
Thanx man. 🙂
By: odzangba on May 2, 2007
at 9:09 am
Quick and easy. Thanx
By: Nathan on May 8, 2007
at 9:23 pm
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.
By: Kunal Ghosh on May 24, 2007
at 1:31 am
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 🙂
By: Mohan on June 3, 2007
at 3:05 pm
[…] 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 […]
By: Restoring GRUB MBR on Feisty « Odzangba Kafui Dake’s Blog on July 2, 2007
at 11:13 pm
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!
By: kubi on August 9, 2007
at 8:05 pm
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!
By: Ray on August 14, 2007
at 4:06 pm
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!
By: Ray on August 14, 2007
at 4:11 pm
Thanks for mentioning the tip here, Ray. I’ll soon update my little how-to to include it.
Cheers,
Odzangba
By: odzangba on August 14, 2007
at 4:33 pm
I still have problems after reinstalling grub says it cant mount the partition(ubuntu ext2 linux partition).
By: ajmal_ on December 4, 2007
at 5:24 pm
Thanks dude!
By: John Carpenterwoodsmithbaker on February 4, 2008
at 1:21 pm
thanks for your nice activity,
may be i need my self blog
By: Gost on March 12, 2008
at 3:13 am
yes, it helped me a lot
By: brandy on March 26, 2008
at 10:40 pm
Yippie. Thanks so much for your time to put this on your blog :))
By: shilpi on May 12, 2008
at 11:12 am
Thanks. It works for me ^^
By: Skavenger on July 7, 2008
at 1:14 am
Thanks !
By: avalmoppock on August 2, 2008
at 10:08 pm
when i went to vista partition it says mbrmgr missing
crtl+alt+del to restart
By: yv on September 19, 2008
at 9:31 pm
yeahhh thx!!! worked perfectlly! thank you fine sir very much ^^
By: gustavo on December 31, 2008
at 7:15 am
Thank you. Very helpful and it saved the day for me.
By: Iain on January 21, 2009
at 3:05 pm
Thanks!
By: Daniel on February 1, 2009
at 6:22 pm
Поставте антиспам
By: bbizbor on February 17, 2009
at 7:21 pm
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…
By: karmenluf on March 24, 2009
at 10:49 am
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
By: zandrajez on March 27, 2009
at 8:06 am
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?
By: jack on May 1, 2009
at 11:43 am
Thanks so much. This helped me to get my Intrepid happy again. (oO)
jjjj
By: warpasylum on May 7, 2009
at 6:37 pm
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”
By: halim on May 17, 2009
at 11:38 am
please help me out with this 🙂
By: halim on May 17, 2009
at 11:39 am
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
By: heshan sanjeewa on June 19, 2009
at 8:40 am
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.
By: xabidu on July 28, 2009
at 6:39 pm
Thanks man!
By: david on July 29, 2009
at 12:52 am
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
By: thegoutap on August 20, 2009
at 5:04 pm
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)
By: thegoutap on August 20, 2009
at 5:08 pm
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!
By: Ray Spencer on October 2, 2009
at 11:33 pm
To too had a problem, stage 1 not found, but I did have to modify the hard disk parameters within setup.
By: erectine on November 12, 2009
at 11:08 pm
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.
By: md imran on November 16, 2009
at 2:42 pm
[…] 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. […]
By: Answer My Searches » Blog Archive » Mini Searches with Answers on November 30, 2009
at 1:36 pm
Aw! Saved my day 😀
Straight to the point 🙂
You have a free dinner in Rome if you get here someday 😉
By: Davide on January 9, 2010
at 6:12 pm
Thanks for your tip. I recently install windows 7 after installing ubuntu. This post helped me to recover my GRUB.
By: Vincellin on November 5, 2010
at 5:16 pm
[…] 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 […]
By: Odzangba Kafui Dake’s Blog on May 14, 2011
at 11:37 pm
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.
By: Cartoon Theme Videos on October 4, 2012
at 4:12 am