PDA

View Full Version : [SOLVED] Howto fix Grub?



shareMenaPeace
June 14th, 2011, 11:18 PM
Hi,
i just had to install windows 7 on another partition and now i cannot boot ubuntu anymore.
When i launch the CD i used to install ubuntu 10.10 i can only choose to "install ubuntu" the boot from first hard disk, boots windows.
Also i got an older version of Super Grub Disk, but which only gives errors!

How do i know if i got Grub 1 or 2?


So any tips how i can fix the boot of ubuntu grub?

Thanks!

Quackers
June 14th, 2011, 11:35 PM
What dvd is that please? Is it an Ubuntu live cd but on a dvd?

JohnBonne
June 14th, 2011, 11:36 PM
I am having the same problem. In fact this is probably a milestone for Linux based systems. I am subscribing to this thread.

Good Luck,

cipherboy_loc
June 14th, 2011, 11:36 PM
Run the boot info script that I have a link to in my signature, and attach the resulting results.txt file, or wrap the results (Copy+paste into the post) in code tags.

shareMenaPeace
June 14th, 2011, 11:40 PM
I testing Rescatux now http://www.supergrubdisk.org/



What dvd is that please? Is it an Ubuntu live cd but on a dvd?
I use Ubuntu 10.10 64 bit version, sorry i don't know if this is a "Live CD", Note it is a "CD"

Quackers
June 14th, 2011, 11:46 PM
I testing Rescatux now http://www.supergrubdisk.org/



I use Ubuntu 10.10 64 bit version, sorry i don't know if this is a "Live CD", Note it is a "CD"

Could it be server edition or alternate installer cd? If so, no live system. You could always download the 10.10 desktop system and make a cd. Then you can boot from that and re-install grub very easily.

shareMenaPeace
June 15th, 2011, 12:02 AM
I testing Rescatux now http://www.supergrubdisk.org/
Rescatux 0.27 just says there is an error during install. Very strange it ask me several times about partition ordering, but i think i set it correct.


Could it be server edition or alternate installer cd? If so, no live system. You could always download the 10.10 desktop system and make a cd. Then you can boot from that and re-install grub very easily.

Ok i booted from another CD which is a "Live CD" i booted into Ubuntu. Now how can i easily restore Grub into the MBR?

Thanks

Quackers
June 15th, 2011, 12:12 AM
The live cd needs to be at least 10.04 iirc.
You also need to identify which partition your Ubuntu root is on. You can use sudo fdisk -l in the terminal or open gparted and look.
Once you identify that you should run the following commands, putting your root partition in the first command (eg /dev/sda5) and your first boot hard drive in the second (eg /dev/sda).

sudo mount /dev/sdXY /mnt
sudo grub-install --root-directory=/mnt /dev/sdX

shareMenaPeace
June 15th, 2011, 12:23 AM
I had to change the keyboard layout, in order to write "/".

So the partition i want to boot is "/dev/sdb5/" for linux. The "dev/sdb5" is extended under "/dev/sdb3"
And "/dev/sdb2" for windows.

Could someone be so kind and write the code for this, because i'm not sure if i understand Quakers description. Thanks

Quackers
June 15th, 2011, 12:28 AM
No problem.
Your first command should be
sudo mount /dev/sdb5 /mnt
The second command depends on a couple of things.
Where do you want grub to be installed? To the mbr of the first bootable hard drive would be normal. If /dev/sda is the hard drive that your bios boots first, then that's where you would install grub to. If that drive is /dev/sdb then that's what you would put in the second command.

How many hard drives have you got connected and which one is set to boot first in your bios? Is that where you want grub to be installed?

shareMenaPeace
June 15th, 2011, 12:31 AM
sudo mount /dev/sdb5 /mnt
sudo grub-install --root-directory=/mnt /dev/sdb
Finally i was able to restore Grub, with above code^^

Thank you all!

Quackers
June 15th, 2011, 12:33 AM
Aha! That's good then :-)
I see /dev/sdb boots first then.

shareMenaPeace
June 15th, 2011, 12:33 AM
Aha! That's good then :-)
I see /dev/sdb boots first then.

Yes somehow it does the trick. Actually i don't know which HD is set how in bios, but this works! :) Ah this is so good to see ubuntu again! (Plus all my files!)

Quackers
June 15th, 2011, 12:39 AM
Don't forget to run
sudo update-grub to get the Windows Loader back in the grub menu :-)

shareMenaPeace
June 15th, 2011, 12:44 AM
Don't forget to run
sudo update-grub to get the Windows Loader back in the grub menu :-)
Ok, i did this. It found some files and it seems all went fine!