PDA

View Full Version : [SOLVED] Repair GRUB from USB



airplanesimen
March 20th, 2012, 11:36 AM
Hello! I am running windows at the moment, and i was wondering if it was possible to repair GRUB? I have tried from USB, but i didnt know how to do it.. The problem is this:

I have installed ubuntu, but grub wont appear? so i am trying to restore it, to get it on boot-up, but it wont. Installation of ubuntu is 11.10 and it is 64 bit. Just tell me what do do from live-cd or usb to restore it.

Thanks!

darkod
March 20th, 2012, 11:44 AM
Grub2 might be missing files, or just that it is not installed on the MBR. To be sure, from live mode follow the link in my signature and run the boot info script. Post the results as explained there. It will show more details.

bibble235
March 20th, 2012, 12:04 PM
I know the problem I think,

1/ You can insert the Live CD
2/ Boot
3/ Start a terminal Alt+Ctl+t
4/ sudo bash
5/ mkdir /tmp/fred
6/ mount /dev/sda1 /tmp/fred (assumming sda1 is the / partition)
7/ chroot /tmp/fred

This should now be like you booted normally

8/ sudo add-apt-repository ppa:danielrichter2007/grub-customizer
9/ sudo apt-get update
10/ sudo apt-get install grub-customizer

./grub-customizer

From there life with grub2 will be a whole new relationship

Iain

darkod
March 20th, 2012, 12:30 PM
I know the problem I think,

1/ You can insert the Live CD
2/ Boot
3/ Start a terminal Alt+Ctl+t
4/ sudo bash
5/ mkdir /tmp/fred
6/ mount /dev/sda1 /tmp/fred (assumming sda1 is the / partition)
7/ chroot /tmp/fred

This should now be like you booted normally

8/ sudo add-apt-repository ppa:danielrichter2007/grub-customizer
9/ sudo apt-get update
10/ sudo apt-get install grub-customizer

./grub-customizer

From there life with grub2 will be a whole new relationship

Iain

You can't chroot with only mounting the root partition. You need to bind /proc, /dev and /sys too. Lets wait for the results of the boot info script first, without assuming anything.

Grub customizer is only a front end for grub if I understand it correctly. What if grub2 is not installed at all?

airplanesimen
March 20th, 2012, 12:34 PM
Here is the result.txt file: http://dl.dropbox.com/u/19624249/RESULTS.txt

airplanesimen
March 20th, 2012, 12:54 PM
and it confuses me :S

darkod
March 20th, 2012, 01:15 PM
Try this in live mode in terminal:


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

Restart and see if you get a working grub2 boot menu.

airplanesimen
March 20th, 2012, 01:33 PM
Try this in live mode in terminal:


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

Restart and see if you get a working grub2 boot menu.

Worked perfectly!! Thanks dude! But i got a warning while doing the last command. it said something about it was another thing using the same directory, and it could might crash :( but, i have booted two times in ubuntu now without problems, so i am notifying you if problem occurs :D
And i have forgot my pass, so what could i do to reset it when pressing ctrl+alt+f1? (in tty)

airplanesimen
March 20th, 2012, 01:36 PM
Try this in live mode in terminal:


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

Restart and see if you get a working grub2 boot menu.

Worked perfectly!! Thanks dude! But i got a warning while doing the last command. it said something about it was another thing using the same directory, and it could might crash :( but, i have booted two times in ubuntu now without problems, so i am notifying you if problem occurs :D

cryptotheslow
March 20th, 2012, 02:12 PM
And i have forgot my pass, so what could i do to reset it when pressing ctrl+alt+f1? (in tty)

Use Recovery Mode to reset it.

Useful instructions here:
http://www.psychocats.net/ubuntu/resetpassword

Just noticed that psychocats walkthrough misses a step when getting into recovery mode that makes the file system writeable on newer Ubuntu versions. Before dropping to a root shell in that walkthrough....

From the Recovery Menu select the remount option to mount the / filesystem read/write - press ENTER when prompted:
http://i1066.photobucket.com/albums/u402/premmy9912/recoveryremount2.png

You are then presented with a slightly different menu - select the bottom option to drop to a root shell:
http://i1066.photobucket.com/albums/u402/premmy9912/recoveryconsolerootprompt.png

airplanesimen
March 21st, 2012, 10:07 AM
Thanks again ! Just figured out that my caps was on when i installed Ubuntu xD