Grub rescue from live Ubuntu CD

Grub Rescue commands

If Grub is missing after installing Ubuntu and screen is showing Grub Rescue, then Ubuntu grub rescue or restore has to done. It can be done through Ubuntu Server CD or Ubuntu Desktop CD
If at system start up you might be seeing the option Grub Rescue or Grub missing option then you need to follow the below commands.

This article will show how to do Ubuntu grub rescue with screen shots using Ubuntu Desktop CD. These screenshots  have been taken on Ubuntu 11.04. The very same method can be used to repair grub mint Debian.
If you don't have the desktop CD then you can use Ubuntu server CD or USB also. 
To do grub rescue through Ubuntu Server CD see 
"Install Grub from Ubuntu server CD".

NOTE:  You will get /usr/sbin/grub-probe: error: cannot stat 'aufs'  error if you didn't follow the commands listed below. Specifically you did not do chroot,
i.e. sudo chroot /mnt. 

For Ubuntu grub rescue follow these steps:
1.Boot from the Ubuntu Desktop live CD



Ubuntu grub rescue-1

                          Select Try Ubuntu.     

2.In Live Desktop session open terminal. 
  Application ->Accessories->Terminal.

3. In Terminal tpye sudo fdisk -l  
    It will display all partiton of the disk.
Ubuntu grub rescue screenshot-2
 
The partation which have Linux under System column is your drive in which ubuntu linux is installed. In screenshot ubuntu partition drive is /dev/sda11.

4. Mount the ubuntu partition drive
       sudo mount /dev/sdXX /mnt  (example 'sudo mount /dev/sda11 /mnt' ,don't miss the spaces.)

5.Only if you have a separate boot partition:
            sudo mount /dev/sdYY /mnt/boot.
 6.  Mount the virtual filesystems:
            
            sudo mount --bind /dev /mnt/dev
            sudo mount --bind /proc /mnt/proc 
            sudo mount --bind /sys /mnt/sys

7. To ensure that only the grub utilities from the LiveCD get executed, mount /usr     
     sudo mount --bind /usr/ /mnt/usr 
     sudo chroot /mnt  

8. If there is no /boot/grub/grub.cfg or it's not correct, create one using 
           update-grub 
      or  update-grub2
9.Now reinstall Grub  
         grub-install /dev/sdX  (e.g. grub-install /dev/sda. Do not specify the partition number.   
 10. Verify the install 
        sudo grub-install --recheck /dev/sdX
11. Exit chroot : CTRL-D on keyboard.
12. Unmount virtual filesystems:  
           sudo umount /mnt/dev 
           sudo umount /mnt/proc
           sudo umount /mnt/sys 

If you mounted a separate /boot partition:  
           sudo umount /mnt/boot 

13. Unmount the LiveCD's /usr directory: 
          sudo umount /mnt/usr

14. Unmount last device: 
           sudo umount /mnt
15. Reboot. 
         sudo reboot.

NOTE: If you are getting /usr/sbin/grub-probe: error: cannot stat 'aufs'  error then the possible reason is that you didn't follow the commands listed above. Specifically you did not do chroot,
ie sudo chroot /mnt.
Follow the above steps correctly and you are done.

 

69 comments:

got /usr/sbin/grub-probe: error: cannot stat 'aufs'.

check this: it works for me ;]

http://ubuntuforums.org/showpost.php?p=10479319&postcount=5http://ubuntuforums.org/showpost.php?p=10479319&postcount=5

Thanks, I have Mint Debian and Grub2 broke after update. Your article saved the day !!
I copied straight from Firefox into Terminal and noticed that it appears to need a space after the "chroot".
Thanks again,
Warwick

Thanks for suggestion and correction has been made. It good to know that, this Grub 2 rescue method work on Mint Debian as I have only tried it to install grub for Ubuntu.

Thanks for a good tutorial - it saved my time!

Just a few remarks for others in the same situation:
I did it the same way using grmllive linux (medium version) booted from usb pendrive. The procedure works also for the RAID array (mirroring, two disks), but first you have to create an array from two disks (/dev/hda /dev/hdb):

mdadm -A /dev/md0 /dev/hda1 /dev/hdb1

then mount it as describe above:

mount /dev/md0 /mnt

perform further steps as above, and when it comes to grub-install, do it for all disks in the array:

grub-install /dev/sda
grub-install /dev/sdb

then unmount, reboot and voila!


by the way:
this procedure fixed the problem on my debian box with grub:

----
Error symbol not found: 'grub_divmod64_full'.
Entering rescue mode
grub rescue>
----

Dude you saved my Bacon and then some, had a Dually-Boot WinXP and 11.04, did an update on WinDoze which crashed Grub2, followed the How-To exactly, Waaalaaa perfect on reboot !!

Thanks a Bunch !!

Thank you fo this!! I too am on debian and following
This guide worked without a hitch. I tip my hat to you good sir! Muchly appreciated. The joys of Sid ah!

Thank you! You saved my 'boot'!

Thanks. Wonderfull!
Just a little note to those who are booting from a different disk than where linux is installed:
change the section in 9.

Now reinstall Grub
grub-install /dev/sdX

to reflect the disk where you are booting from. The rest stays the same.

In my case linux was on /dev/sdb2 but had to install grub to /dev/sda.
Worked for me.

malapradej

THx it is realy very good.

Great man!
Thank you very much for this advices!

Thanks !! I'm a noob Linux user and you helped me after a unsuccessful upgrade Ubuntu 11.10 -> Mint 12
Perfect tutorial
Thanks again

Amazing!!!
Thank you very much....

grub rescue in sweet and simple way. Thanks a million

thanks so much! i have been working on this problem using troubleshooting i have found, and this is the only that worked for me!

I installed linux on another partition and booted with livecd and copied the boot dir from new install to old linux.

-vijay

When i tried this, I found sda1 ntfs sda2 ntfs sda3 extended sda4 ntfs and sda5 linux swap. I wasn't thinking and when things did not work I tried having "Windows" try to fix the boot. Did Bill Gates eat my Ubuntu 11.10???? I am bummed!

It seems you have deleted the Linux partition while trying installing grub from Windows. I suggest reinstalling Ubuntu for grub rescue

OMG!! I can't thank you enough for this perfect step by step post, it saved me (...& my computer!). I'm definitely adding your blog to my bookmark list for future reference! =)
Thanks again!

How does grub rescue from LiveCD work on GUID Partition Table (GPT) .

Tried to installubuntu 10.4 to drive C: Installation went completely through normally, no hiicups. Hit restart and that's when it all went wrong..prompted to remove CD. Did that, hit enter and pc rebooted. Came back up with "error: out of disk" and "grub rescue>" with a blinking colon. So I went to my Win 7 machine and went looking for answers...Put the cd back in, changed boot order to boot from livecd. Starts booting and cdrom churns for about 10 minutes then gives up with a "System halted"..Any ideas? This is the 4th major failure I've had trying to get Ubuntu (different cds / different machines) on a machine and am really thinking it is not ready for primetime...

sudo mount --bind /dev /mnt/dev
says
mnt/dev doesn't exist

When reading a command, be quite careful to see where there are spaces. Some fonts don't make them obvious.

About to try this. Have a GPT, though, so almost no partition utilities will work -- but, Parted Magic is a gem -- (Get the latest, and burn to an 8 cm CD (if you have one)). Latest (and recent) GParted and GNU parted (only GNU) do work with a GPT.

It seems /hard/ to find a list of grub-rescue commands! Maybe I have to download source code and study it? (Wikipedia?)

A couple of commands that /do/ work in grub-rescue are [set] and [ls].
Those can be /really/ useful if you know what to do with them. Used alone, they give critical info.

As well, [prefix={parameters}] and
[root={parameters}] apparently can redefine some things.

(I use [ and ] instead of quotes that I then need to "un-define".)

Better not to experiment with these commands, though, unless you know what you're doing!

One more thing to worry about is numbering of gpt partitions. Considering how Linux has historically done such things, I'd be an idiot to assume that the gpt{n} digits match those in, say, /dev/sda{n}.

Good luck!
[nb/nicabod]

SOLVED. I used the Mint Linux Debian GNOME 201109 live CD. I did [sudo su] to gain root access, used gparted to see which partition was which, and proceeded from there. Some commands took a few seconds to finish, but I'm back up and running.

Really, truly appreciated. I've posted a message to the current Mint blog about release of Update 4, using TinyURL
. (Leave off the < and >).

[nb/nicabod]

Thank you very much!!!!

Thanks. You jusy saved another soul today.

Thank you very much!!!!

very very cool. i have resolved my problem through your way

Thank you very much! You just saved my day!
My newly installed Ubuntu 12.04 failed to boot showing the grub rescue prompt
Thank to your manual I was able to boot without reinstall...

Many thanks

Worked OK - But only got Win XP back. The restored Grub did not include a choice for Ubuntu 10.04 (or Linux restore). The Linux partition is there in fdisk and GParted. My 11.04 CD would not boot, so I did this with a live 11.1 distro. How do I get Ubuntu to boot?
Thanks for the help

Thanks mehn !!!! Everything worked smoothly. I installed Ubuntu 11.10 first then Windows 7 Ultimate; I updated the Ubuntu to the 12.04 LTS version and lost the Windows boot option so I changed the grub to the Windows MBR main option. I now lost the Ubuntu option in the Windows MBR so this post aided me to get the grub back and the Ubuntu and the Windows options so all is well once again. Many Thanks !!!!!

First, thanks for the guide it's really clear.
And I have to thanks malapradej too that pointed out that if you have more than one HD in your computer, it may not boot on the one you it is.

But instead of changing the place where Grub was installed I decided to change the hard drive boot priority in my BIOS and it works too.

Thanks again !

Thanx a lot dude.... It helped a lot :p

Thank you very much, i was stuck after installing Ubuntu 12.04 along with Windows 7 - i tried by re-installing Ubuntu but no luck, My installed Ubuntu 12.04 failed to boot and showed The error - grub rescue prompt.
I followed ur guide and it helped and saved my day.
Thank a ton.

One nuance to be careful about - the instructions say to check if you have a separate boot partition, and if so then do sudo mount /dev/sd·· /mnt/boot. I got confused here - I did have a boot partition that was not my Linux, it was my base partition (/sda0). So I did that command, and ended up getting a grub menu that only showed my Windows boot. I re-ran the procedure without the doing the sudo mount /dev/sd·· /mnt/boot and it worked beautifully - my old GRUB menu was back, with all the Linux options as well as Windows. The instructions are only referring to a separate Linux boot partition, not for the case where your boot partition is not Linux.

thank you. I solved my problem with this article

... Thank you so much!!!!!!!!!!

Thanks a ton, really helpful stuff ! Keep posting useful stuff like this. :)

Thanks a million!!

I installed Windows 7 on a laptop with Ubuntu 10.04, and could not boot into Ubuntu anymore.

I followed your instructions mechanically, and the boot menu was back, and I can now choose Ubuntu or Windows. It worked beautifully!

Thanks once again!

Dear Geek Mitra,

Just wanted to say, "Thanks!" Your clear and concise tutorial saved me from a very tedious reinstall. Bravo!

Please do disregard my previous comment. I went ahead and continued with the steps in the hope that the error would effect it and lo and behold, it actually worked, I was finally to boot Windows 7. Thanks man, this tutorial really helped me out.
Thanks,
Christian

You made my day!!!

Thanks great guide, just to note though make sure that if your grub is originally on an x32 distro you'll need to do this off of an x32 install disk, else you get chroot bin/bash errors

Thanks a ton mate... Simply awsome nd my porblem is solved nd ubuntu 12.04 is working perfectly. All thanks to u. God bless. :)
-Binoy

yeah thank bro it work fine for me......

At the step "update-grub2", I get the error message:

/etc/grub.d/00_header: 28: .: Can't open /usr/share/grub-mkconfig_lib

When I try to use "sudo update-grub2", I get the error message:

sudo: unable to resolve host ubuntu
Generating grub.cfg ...
/etc/grub.d/00_header: 28: .: Can't open /usr/share/grub-mkconfig_lib

Saved a newbie, with dual boot (couldn't get into Windos 7 and "everything!!") Thank you.

actually i m having chameleon bootloader but it is not detecting my linux partition. bcz at the time of installation i have not selected grub. my backtrack linux is installed properly but it is not starting bcz of no grub. i want my chameleon boot loader as it is so how to install grub on my extended partition. i dont want it on MBR...plz help

Hello please help me. actually i miss in step-3. I dont have that linux thing.. what i have to do??

my ubuntu12.04 terminal don't know the word update when i try to update grub2

Thank you

oh and for the guy before me, there is no space between 'update' and 'grub2', there's a dash, like this:
update-grub2

Thanks buddy! I really like your tutorial and it is clear very helpful to me! God bless you!

i dont hsve a linux System wrtten infront of sny of the psrtitions. how will i know where is linux installed?

while installing linux i used install linux side by side windows and partitions were automatically made. Linux ran fine for the first time. but then it stuck up with grub rescue

http://sourceforge.net/p/boot-repair/home/Home/

Very helpful! thanks a ton.

Thanks for such social platform which give us variety of idea to explore ourself technically .This exposure give benefits to everyone to fit or to survive in global market which is very essential in the global era.
Time Attendance System

This comment has been removed by the author.

Better start with forex and after that nadex binary options learn and only then trade binary options, but i can tell you that before you can use any strategy you have to understand yourself first, how is your mind work, without it you will continue the up and down profit/loss, feeling pressure/calm.More information please visit our web Visit our web site http://www.automatedbinaryoptions.co/?p=180

I dont know who u r bt i wl find u fr thanking u. Thanks a lot. :)

Now you do not need to remiend different sites for different softwares here you can Downlowed easily (All software in one page)
Click Here For Download More Best softwares in one page

Click Here For Download

Click Here For Download this software

for more best software and games visit http://microsoft786.blogspot.com/

Thank you so much!

Useful information. grub rescue in sweet and simple way. Thanks for Posting. http://www.dreamdestinations.in/

Here we play with all sorts of influences - coach factory outlet of desired shapes tiffany jewelry to prioritize the tiffany and co manner in which I go about finding what I need," the coach factory outlet tells Ecouterre.More than 1,000 runners began the race.Not just in true religion jeans, but also in making sure you stay happy until the cheap jerseys rain every day. Hey, $350 is way less than those coach outlet. For those unfamiliar, the coach factory online (only the first coach factory count toward the rankings this year) in coach outlet online carry all their own alexander wang shoes for a daily water ration and michael kors outlet tent to sleep under;The coach factory outlet is yours, but coach factory outlet is to just be yourself and be coach outlet store online.The sleek ensemble came on show through sac burberry. Choose from brands like Bernardo, michael kors outlet and others.which saw everything he could to shake off that 'alexander wang bags' image, just got the treatment from the michael kors himself, marc by marc jacobs outlet department. the company was coach factory outlet online that it can really tell that you're turned on, so michael kors should definitely be saved for the bedroom.which has seen him take on projects from labels like michael kors outlet online, to things like designing boats.

http://www.burbagssale2013.com/ Burberry Outlet
http://www.cheaphollistersale.co.uk/ Cheap Hollister Clothes
http://www.coachblackfriday2014.com/ Coach Black Friday
http://www.coach-storeoutletonline.com/ Coach Black Friday 2013
http://www.coachcoachoutlet.com/ Coach Cyber Monday
http://www.coachxfactory.com/ Coach Factory
http://www.coach-factoryoutletonline.net/ Coach Outlet Factory
http://www.coach-outletusa.com/ Coach Outlet USA
http://www.coach-pursesfactory.com/ Coach Purses Factory
http://www.coachpurseusa.com/ Coach Purses USA
http://www.coach-storeoutlet.com/ Coach Store Outlet
http://www.coachxpursesonsale.com/ Coach Purses On Sale
http://www.discountbeatsbydresale.com/ Monster Beats Outlet
http://www.louis-vuittonblackfriday.com/ Louis Vuitton Outlet
http://www.lv-guccishoesfactory.com/ Louis Vuitton Factory
http://www.marcjacobsonsale.com/ Marc Jacobs On Sale
http://www.mcmworldwides.com/ MCM Outlet
http://www.mcmoutlet-jp.com/ MCM 店铺
http://www.oakleysunglassesfactory.com/ cheap oakley sunglasses
http://www.michaelkorsmas.com/ Michael Kors Outlet
http://www.michaelkors.so/ Michael Kors Outlet
http://www.michaelkorsfactory-store.com/ Michael Kors Factory
http://www.michaelkorsoutletr.com/ Michael Kors Outlet
http://www.michael-korsfactoryonline.com/ Michael Kors Factory Online
http://www.newcoachfactory.com/ Coach Factory Outlet
http://www.north-faceoutletonlines.net/ North Face Outlet Online
http://www.polo-outletstore.com/ Polo Outlet Store
http://www.ralphlaurenuker.com/ Ralph Lauren UK
http://www.saclongchamppairs.com/ Sac Longchamp Pairs
http://www.tcoachoutletonline.com/ Coach Outlet Online
http://www.the-coachfactoryoutlet.com/ Coach Factory Oultet
http://www.uggaustralia.cc/ Ugg Australia
http://www.barbour-jacketsoutlet.com/ Barbour Jackets Outlet Online
http://www.canada-gooser.com/ Canada Goose Outlet
http://www.guccishoesuk2014.com/ Gucci Outlet Online
http://www.michaelkors-states.com/ Michael Kors Outlet
http://www.moncler-clearance.com/ Moncler Clearance
http://www.moncler-jacketsoutletonline.com/ Moncler Jackets Outlet Online
http://www.northsclearance.com/ North Clearace Outlet
http://www.polo-ralphlaurensoutlet.com/ Polo Ralph Lauren Outlet Online
http://www.woolrich-clearance.com/ Woolrich Clearance
http://www.cvshopfactory.com/ shop.coachfactory.com
http://www.mksfactoryoutlet.com/ Michael Kors Factory Outlet
http://www.zxcoachoutlet.com/ Coach Outlet Online USA
http://www.thebeatsbydre.com/ Beats by Dre
http://www.newoutletonlinemall.com/ Coach Purses Outlet Online
http://www.clickmichaelkors.com/ Michael Kors USA
http://polo2014.mylivepage.com/

Wonderful ,, to instant solve your problem clik it here BOOTMGR Missing in Windows 7 And Get free from boot mgr missing windows 7 problem.
Thank you
Aalia lyon

http://www.coachfactoryoutletsco.com/ coach factory outlet
http://www.coachfactory.us.com/ coach factory
http://www.coachoutletstoresco.com/ coach outlet
http://www.coachoutletstoresinc.com/ coach outlet store online
http://www.michaelkorsoutletsmk.com/ michael kors outlet
http://www.timberlandshoes.us.com/ timberland shoes
http://www.michaelkorsoutlet-factory.com/ michael kors outlet
http://www.coachfactoryoutletspurses.com/ coach factory outlet
http://www.coachfactoryoutlete2014.com/ coach factory outlet
http://www.truereligionbrandjeans.us.com/ true religion outlet
http://www.truereligionjeans.us.com/ true religion jeans
http://www.coachoutletonlinehandbag.com/ coach outlet online
http://www.louisvuittonoutlet-purses.com/ louis vuitto purses
http://www.timberlandboots.us.com/ timberland boots
http://www.isabelmarantshoes.us.com/ isabel marant shoes
http://www.coachoutletstore-factory.com/ coach outlet store online
http://www.michaelkorsoutlet-purses.com/ michael kors purses
http://www.louisvuittonoutlethandbag.com/ louis vuitton handbags
http://www.coachoutletstoresofficial.com/ coach outlet
http://www.truereligionjeans-2014.com/ true religion jeans
http://www.coachfactoryoutlets-online.com/ coach factory outlet online
http://www.coachfactoryoutlet-store.com/ coach factory outlet
http://www.coachfactoryoutlet-handbag.com/ coach factory outlet
http://www.louisvuittonoutlets2014.com/ louis vuitton outlet
http://www.coachfactoryoutletstoreco.com/ coach factory outlet
http://www.coachfactoryoutletonlineinc.com/ coach factory outlet online
http://www.michaelkorsoutletonlineco.com/ michael kors outlet
http://www.michaelkorsoutletstoresco.com/ michael kors outlet store
http://www.tiffanysjewelry-co.com/ tiffanys jewelry
http://www.celineoutlet-online.com/ celine outlet
http://www.cheapjerseysco.com/ cheap jerseys
http://www.tomsshoescompany.com/ toms shoes
http://www.alexanderwang-shoes.com/ alexander wang shoes
http://www.alexanderwang-bags.com/ alexander wang bags
http://www.sacsburberry.com/ sac burberry
http://www.celinebags-outlet.com/ celine bags
http://www.tomsusashoes.com/ toms outlet
http://www.fitflopsandalssale.com/ fitflops
http://www.fitflopusaonline.com/ fitflop outlet
http://www.giuseppezanottisneakers.co.uk/ giuseppe zanotti sneakers
http://www.marcbymarcjacobsoutlet.co.uk/ marc by marc jacobs
http://www.pradaoutleteco.com/ prada outlet
http://www.tiffanyandcoinc.com/ tiffany jewelry
http://www.pradaoutlet-factory.com/ prada outlet
http://www.michaelkors-co.com/ michael kors
http://www.marcjacobs.us.com/ marc jacobs
http://www.giuseppezanotti.us.com/ giuseppe zanotti
http://www.supra.us.com/ supra shoes
http://www.ralphlauren.us.com/ Polo ralph lauren
http://www.alexanderwang.us.com/ alexander wang
http://www.tiffanyjewelry.us.com/ tiffany jewelry

Thanks for the guide it's really clear. It works 100% for me. I thing this blog is a Great Software Tutorial Zone.

Post a Comment