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