You are on page 1of 13

Grub rescue from live Ubuntu CD ~ Opensource4beginners http://opensource-sidh.blogspot.in/2011/06/recover-grub-live-ubuntu-cd...

HOME

Opensource4beginners
Open source guide, tips and tutorial.

HOME UBUNTU HOW TO GNOME3 ABOUT OPENSOURCE LINUX ANDROID »

TECH TALK VIDEO »

LABELS

About Opensource (8)

Android (1)

cloud (1)

Gnome3 (4)

how to (24)

Java tutorial (29)

Learn Linux (4)

Linux (9)

Mint (1)

Opensource info (3)

Tech Talk (2)

Ubuntu (41)

Ubuntu 12.04 (1)

MY BLOG LIST
Honda CBR150R
Karbonn Tablet
Micromax Tablet
USA Jobs

Grub rescue from live Ubuntu CD


4:42 AM SIDH 38 COMMENTS

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. At system start up you might seeing the option Grub Rescue
or Grub missing.

This article will show how to do Ubuntu grub rescue with screen shots using Ubuntu

1 of 13 5/31/2012 11:49 PM
Grub rescue from live Ubuntu CD ~ Opensource4beginners http://opensource-sidh.blogspot.in/2011/06/recover-grub-live-ubuntu-cd...

Desktop CD. These screenshoats of Ubuntu grub rescue has 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 Ubuntu Grub can also be rescue from Ubuntu
server CD or USB. See here for Ubuntu Grub rescue or restore from Ubuntu server CD.
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,
ie 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.

2 of 13 5/31/2012 11:49 PM
Grub rescue from live Ubuntu CD ~ Opensource4beginners http://opensource-sidh.blogspot.in/2011/06/recover-grub-live-ubuntu-cd...

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 (eg. grub-install /dev/sdaDo 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.

3 of 13 5/31/2012 11:49 PM
Grub rescue from live Ubuntu CD ~ Opensource4beginners http://opensource-sidh.blogspot.in/2011/06/recover-grub-live-ubuntu-cd...

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.

Recommended Posts
1.Install Ubuntu on external hard disk or Pendrive
2.10 Ubuntu commands you should know
3.Open Source alternative for windows software
4.Top 5 Myth about Linux Operating system

Posted in: how to,Ubuntu

You might also like:


How to install or Rescue Grub from ubuntu Live CD or USB
How to install Ubuntu or dual boot Ubuntu
How to edit Grub 2 menu entries in Ubuntu
Things to remember before installing Ubuntu.
Install Ubuntu 11.10 and Windows dual boot installation
LinkWithin

8 3 3 0 0 0 0
ShareThis Google + Reddit Digg

Newer Post Home Older Post

38 comments:

Anonymous says:
10:41 AM

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

Reply

psych says:
1:50 AM

check this: it works for me ;]

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

Reply

Anonymous says:
12:27 PM

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

Reply
Reply

4 of 13 5/31/2012 11:49 PM
Grub rescue from live Ubuntu CD ~ Opensource4beginners http://opensource-sidh.blogspot.in/2011/06/recover-grub-live-ubuntu-cd...

sidhartha says:
2:25 PM

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.

filips says:
6:45 AM

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>
----

Reply

SaberX01 says:
4:49 PM

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 !!

Reply

Donoterase says:
6:54 AM

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!

Reply

Anonymous says:
2:58 PM
Reply

5 of 13 5/31/2012 11:49 PM
Grub rescue from live Ubuntu CD ~ Opensource4beginners http://opensource-sidh.blogspot.in/2011/06/recover-grub-live-ubuntu-cd...

Thanks.

Anonymous says:
2:35 PM

Thank you! You saved my 'boot'!

Reply

Anonymous says:
1:19 AM

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

Reply

Unknown says:
3:31 AM

THx it is realy very good.

Reply

Anonymous says:
8:10 AM

Great man!
Thank you very much for this advices!

Reply

Anonymous says:
3:25 PM

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

Reply

6 of 13 5/31/2012 11:49 PM
Grub rescue from live Ubuntu CD ~ Opensource4beginners http://opensource-sidh.blogspot.in/2011/06/recover-grub-live-ubuntu-cd...

Anonymous says:
5:27 AM

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

Reply

Anonymous says:
8:34 AM

grub rescue in sweet and simple way. Thanks a million

Reply

jen pin says:


6:59 AM

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

Reply

vijay viswanathan says:


3:08 PM

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

-vijay

Reply

Kurt Van Luven says:


7:00 PM

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!

Reply

Bhagat says:
5:24 AM

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

Reply

Rachel Zinck says:


9:34 AM

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!

Reply

Anonymous says:
Reply
2:42 PM

7 of 13 5/31/2012 11:49 PM
Grub rescue from live Ubuntu CD ~ Opensource4beginners http://opensource-sidh.blogspot.in/2011/06/recover-grub-live-ubuntu-cd...

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

Anonymous says:
7:54 PM

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...

Reply

deepant says:
1:39 PM

sudo mount --bind /dev /mnt/dev


says
mnt/dev doesn't exist

Reply

Anonymous says:
12:27 AM

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]

Reply

Anonymous says:
4:27 AM

SOLVED. I used the Mint Linux Debian GNOME 201109 live CD. I did [sudo su] to gain root
access,
Reply used gparted to see which partition was which, and proceeded from there. Some

8 of 13 5/31/2012 11:49 PM
Grub rescue from live Ubuntu CD ~ Opensource4beginners http://opensource-sidh.blogspot.in/2011/06/recover-grub-live-ubuntu-cd...

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]

Anonymous says:
6:48 AM

Thank you very much!!!!

Reply

Anonymous says:
10:33 PM

Thanks. You jusy saved another soul today.

Reply

Anonymous says:
10:32 PM

Thank you very much!!!!

Reply

Anonymous says:
4:25 PM

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

Reply

Anonymous says:
12:05 PM

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

Reply

newbieinPDX says:
3:17 PM

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

Reply

Unknown says:
Reply
6:46 PM

9 of 13 5/31/2012 11:49 PM
Grub rescue from live Ubuntu CD ~ Opensource4beginners http://opensource-sidh.blogspot.in/2011/06/recover-grub-live-ubuntu-cd...

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 !!!!!

Maxime says:
5:46 AM

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 !

Reply

Alessandro Iacopetti says:


10:04 AM

I used your guide while replacing my boot disk with a new SSD.
Thank you.

http://pleasedonttouchthescreen.blogspot.it/2012/05/replacing-mechanical-hd-with-ssd.html

Reply

Anonymous says:
10:40 AM

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

Reply

Irfan Baba says:


9:10 AM

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.

Reply

Unknown says:
2:19 PM

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.

Reply

10 of 13 5/31/2012 11:49 PM
Grub rescue from live Ubuntu CD ~ Opensource4beginners http://opensource-sidh.blogspot.in/2011/06/recover-grub-live-ubuntu-cd...

Gürkan İndibay says:


10:10 AM

thank you. I solved my problem with this article

Reply

Post a Comment

Comment as:

Search

OpenSource for
Beginners on Facebook
Like

198 people like OpenSource for Beginners.

Agus Putu Amol Emml Jack

Kuber Mir John Ça


Facebook social plugin

BLOG ARCHIVE

► 2012 (46)

▼ 2011 (55)
► December (18)

► November (2)

► October (5)

► September (1)

► August (6)

► July (5)

11 of 13 5/31/2012 11:49 PM
Grub rescue from live Ubuntu CD ~ Opensource4beginners http://opensource-sidh.blogspot.in/2011/06/recover-grub-live-ubuntu-cd...

▼ June (9)
Install and Configure Apache web server
in Ubuntu

Useful Linux commands

Directory structure of Ubuntu Linux

10 Ubuntu Linux commands you should


know

Install Ubuntu on external hard drive or


pendrive

Top 5 myth about Linux operating system.

Grub rescue from live Ubuntu CD

Enable 3D desktop cube without crashing


Unity in U...

3D cube effects in Ubuntu Linux

► May (9)

Windows 7 PCs & Laptops


Preview the Latest Windows 7 PCs
& Laptops. View Slideshow Now.
eweek.com/windows7

Buy Usb Flash Drive


Discount Prices +Warranty Included
Free Delivery - India. Buy Now!
www.HomeShop18.com/Pendrive

Flash Data Recovery Tools


SD Flash doctor supports common flash
chips(SD, SM, MMC, XD,etc)
www.salvationdata.com

POPULAR POSTS

Grub rescue from live Ubuntu


CD

Install Ubuntu 11.10 and


Windows dual boot
installation

Ubuntu 12.04 installation.


Dual boot with Windows

Enable 3D desktop cube


without crashing Unity in
Ubuntu 11.04

12 of 13 5/31/2012 11:49 PM
Grub rescue from live Ubuntu CD ~ Opensource4beginners http://opensource-sidh.blogspot.in/2011/06/recover-grub-live-ubuntu-cd...

Top 5 Anti virus for ubuntu.

How to install missing Grub


from ubuntu Live CD or USB

3D cube effects in Ubuntu


Linux

Myth and truth about Red Hat


open source business model

Things to remember before installing


Ubuntu.

How to edit Grub 2 menu


entries in Ubuntu

FACEBOOK BADGE
Sidhartha Vijoy

Create Your Badge

Copyright © 2011 Opensource4beginners | Powered by Blogger

DesignWordPress Themes

13 of 13 5/31/2012 11:49 PM

You might also like