PDA

View Full Version : [ubuntu] Lost Ubuntu after grub rescue



sheriff_009
August 30th, 2010, 06:20 AM
Hi,

I m using a Toshiba 64-bit m/c. It was loaded with Windows 7 and I loaded Ubuntu as well. I wanted to partition windows drive where the problem actually start. Upon partitioning using a partition software, I got the grub rescue error.
Then I found below steps in one of the forms and followed the same.
I was able to retrieve windows 7 safely, but my laptop is directly booting to windows now and not asking for an option to boot to Ubuntu.

Here are steps I had followed...
sudo apt-get install lilo
sudo lilo -M /dev/sda mbr

Now I know I format existing Ubuntu partition and reinstall it. But I dont want to do that :( as I had got lot of customization and software installed. Dont want to lose them all :(

Appreciate if you can help me to boot back to Ubuntu..

Thanks
Shariff

bcbc
August 30th, 2010, 07:33 AM
Run the bootinfoscript (http://bootinfoscript.sourceforge.net/) and post the results.

sheriff_009
August 31st, 2010, 02:16 AM
Hi, Please find the attached results.

Thanks
Shariff

bcbc
August 31st, 2010, 02:39 AM
It looks like you just need to reinstall the grub bootloader.

Boot from a live CD and run the following:

sudo mount /dev/sda6 /mnt
sudo grub-install --root-directory=/mnt /dev/sda


Reboot.

EDIT: Your ubuntu partition changed from /dev/sda5 to /dev/sda6 when you edited your partitions. Now that shouldn't be a problem as there is a UUID override in grub. But if it is a problem, then just edit the first grub entry (when the grub menu appears hit 'e'), then change (hd0,5) to (hd0,6) and hit CTRL+X to boot.

Once you've booted, run

sudo update-grub

sheriff_009
September 1st, 2010, 06:12 AM
This worked, thanks a lot.

When I m booting my laptop, I would like to default it to Windows 7.

As of now it defaulting it to Ubuntu (#1). Can you please suggest me a method to change it windows (#7)

Shariff

bcbc
September 1st, 2010, 08:37 AM
This worked, thanks a lot.

When I m booting my laptop, I would like to default it to Windows 7.

As of now it defaulting it to Ubuntu (#1). Can you please suggest me a method to change it windows (#7)

Shariff
I like this guide http://sourceforge.net/apps/mediawiki/bootinfoscript/index.php?title=Boot_Problems:Custom_Menu

However, you have to do a little work. But once it's setup it works without additional maintenance.

If you want the easy method, you can just install and run startupmanager and set the default to windows - but note that you will have to rerun this every time a new kernel is installed or removed.