3

Hello ladies and gentlemen! I installed Ubuntu alongside with Windows 7 using live USB.

It wouldn't let me install GRUB, it says there's a fatal error with the partition chose. I literally chose every single partition yet it didn't work! So I chose not to install a bootloader for the sake of it's not working. Can any one help me on how to install a bootloader, I'm talking from live usb.

  • Generally, you don't install grub to a partition, you install it to the MBR of a drive. In other words, if you have a single hard drive named /dev/sda, you install it to sda, not sda1 or sda2, etc. – Marty Fried May 27 '12 at 04:33

2 Answers2

5

your best bet to install grub2 is Boot-Repair tool.

enter image description here

Boot-Repair is a simple tool to repair frequent boot issues you may encounter in Ubuntu like when you can't boot Ubuntu after installing Windows or another Linux distribution, or when you can't boot Windows after installing Ubuntu, or when GRUB is not displayed anymore, some upgrade breaks GRUB, etc.

How to install?

sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update
sudo apt-get install -y boot-repair

How to run?

boot-repair

How to use?

enter image description here

enter image description here enter image description here enter image description here enter image description here

more info here.

Rahul Virpara
  • 11,720
  • That's what I get! I just want to let you know that I'm behind a university proxy and the software center works just fine!

    Traceback (most recent call last): File "/usr/bin/add-apt-repository", line 125, in ppa_info = get_ppa_info_from_lp(user, ppa_name) File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py", line 80, in get_ppa_info_from_lp curl.perform() pycurl.error: (7, "couldn't connect to host")

    – AliAlghamdi May 27 '12 at 04:49
  • try sudo add-apt-repository ppa:yannubuntu/boot-repair – Rahul Virpara May 27 '12 at 05:45
  • Fantastic. Worked perfectly for me after upgrading Oneiric to 12.04. (I'd lost grub, and my Windows partition was no longer mapped). Thanks! – jbaums May 30 '12 at 01:17
  • Nope, jumped to conclusions here... while grub is back, there's still nothing showing in my Win 7 partition. – jbaums May 30 '12 at 01:19
  • This worked for me, thanks! I just ran the "Recommended Repair". A little warning though: At some point it asked me if I wanted to continue, and recommended to backup stuff. I chose 'no' but it continued nevertheless. – HappyDeveloper Jun 10 '12 at 02:06
0
  1. Boot using a live cd of ubuntu.

  2. Open a terminal and run the command

sudo fdisk -l

It lists the complete partition table of the hard disk. In there, identify which partition you have got your linux installed on. You can identify it using the drive size you had allocated for it and looking at the last column of the output which will be ‘extended’ for all of your linux partitions. The partition will most probably be something like /dev/sda5 or something. Remember this partition.

  1. Create a temporary folder in your home directory (Note: You can make the temporary folder anywhere you want. I’m using the home folder just for the sake of explanation). I’m calling it ‘temp’ for now. So that ‘temp’ folder’s path will be /home/ubuntu/temp.

  2. Mount your linux partition there. That is, assuming that you found your linux partition to be /dev/sda5, you mount that at the ‘temp’ folder by doing the following command

sudo mount /dev/sda5 /home/ubuntu/temp

  1. If you want to check whether you have mounted the correct partition, go to your home folder and open temp. You will be in the ‘/’ directory. In there you will find ‘home’, in which your home folder’s name will be there. Once you’ve confirmed you have mounted the correct partition, do step 6.

  2. You have to install grub by showing the system where to read the data from the hard disk at the beginning. Don’t worry, just run the following command

sudo grub-install --root-directory=/home/ubuntu/temp /dev/sda

The ‘/dev/sda’ corresponds to your hard disk name. Replace it by whatever the command ‘sudo fdisk -l’ command showed you.

  1. You’re done. You may restart your system

Source : http://sosaysharis.wordpress.com/2011/06/29/recovering-grub-after-installing-windows-using-ubuntu/

harisibrahimkv
  • 7,256
  • 11
  • 44
  • 71