3

I had Ubuntu and Win 7 on different partitions. And then i formatted partition which containing Win 7 and reinstall Win 7. And then dual boot screen disappeared. I'm following tohuwawohu's answer.

My HDD partition is sda5 which Ubuntu installed.

Now i'm trying to boot my computer, after BIOS loading , i'm getting GRUB command prompt screen (screenshot) directly.

TO solve it, i'm following this steps .

REsult is like this : enter image description here

Eray
  • 1,820

3 Answers3

2

I assume those steps relate to grub, not grub2. With grub2, the file structure has changed, so there are no more stage file in the grub directory. In this thread, under #13, you will find a description how to restore grub2 from a LiveCD. EDIT2: It has the following steps (credits drs305):

  1. Boot the Ubuntu Live CD (Try without installing).

  2. From the Desktop, open a terminal - Applications, Accessories, Terminal.

  3. Determine your normal system partition - sudo fdisk -l (That is a lowercase L).

    If you aren't sure, run df -Th. Look for the correct disk size and ext3 or ext4 format.

  4. Mount your normal system partition:

    sudo mount /dev/sdXY /mnt

    • If you aren't sure if you mounted the correct partition, once it's mounted run "nautilus /mnt" to inspect the partition. If it is the correct partition, you should see the normal Ubuntu folders such as /bin, /boot, /etc, /home, etc
    • Example: sudo mount /dev/sda1 /mnt
    • Note: The partition to mount is normally the partition on which Ubuntu was installed: sda1, sdb5, etc. If you have a separate /boot partition, use the device on which the /boot partition is located. Grub 2 works best when installed in the MBR of the drive to which BIOS boots. Also remember that you mount the partition (including the number) in this step, but you do not include the partition number when you run the "sudo grub-install" command later.
    • Note: GRUB 2 counts the first drive (X) as "0", but the first partition (Y) as "1"
  5. Only if you have a separate boot partition:

    sudo mount /dev/sdXY /mnt/boot

    with sdXY being your /boot partition designation.

  6. Reinstall GRUB 2:

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

    Do NOT include the partition number.

  7. Example:

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

    • Note: Substitute the device on which Ubuntu was installed - sda, sdb, etc. Do NOT specify a partition number.
  8. Unmount the partition *:

    sudo umount /mnt

    • Note: If you mounted a separate /boot partition, unmount it first:

      sudo umount /mnt/boot

  9. Reboot.

  10. After reboot: Update the grub menu using sudo update-grub

Here's another description. Good luck!

EDIT1: Some more information is also available in the Ubuntu Wiki on grub2.

tohuwawohu
  • 7,352
  • Im not sure which partition ill use : http://pastebin.com/qXEeipCd . Also please look at to last addition of question. thank you. – Eray Nov 21 '11 at 14:06
  • 1
    AFAIK you don't have to name a certain partition, since grub2 has to be placed in the MBR of the hard disk. So you will just have to choose the correct hard drive. Your partition list looks as if there's just only on HDD: /dev/sda. EDIT: There's only one linux partition /dev/sda5 so i assume you don't have a special boot partition. – tohuwawohu Nov 21 '11 at 14:11
  • there is a HDD but there are a few partition on HDD – Eray Nov 21 '11 at 14:12
  • 1
    There's only one linux partition /dev/sda5 so i assume you don't have a separate boot partition. – tohuwawohu Nov 21 '11 at 14:18
  • As i said i can see my ubuntu's partition on file browser. I opened it and then right click > properties . I see it's name is a9115410-9342-47d0-9585-59174e7149db . And then i execute df -Th on terminal. /dev/sda5 mounted on /media/a9115410-9342-47d0-9585-59174e7149db . So, i found my partitions name, it's sda5 – Eray Nov 21 '11 at 14:25
  • Now i'm following this page's (http://ubuntuforums.org/showthread.php?t=1195275) instructions for sda5 . But when i restart directly opening GRUB console after BIOS load. There isn't any dual boot screen. – Eray Nov 21 '11 at 14:27
  • you may have to refresh the grub2 menu using the command sudo update-grub. – tohuwawohu Nov 21 '11 at 14:32
  • I tried sudo upgrade-grub . I'm getting same screen like this after BIOS loading : http://imageshack.us/photo/my-images/232/vmwarei.png/sr=1 (I found this screenshot from internet) – Eray Nov 21 '11 at 14:44
  • 1
  • http://imageshack.us/photo/my-images/838/grub.png/ – Eray Nov 21 '11 at 15:34
  • then you will have to check the correct partition number, e.g. using a live cd. – tohuwawohu Nov 21 '11 at 15:47
  • i'm using live cd . I found sda5 with fd -Th command. Also you said, "There's only one linux partition /dev/sda5" – Eray Nov 21 '11 at 15:53
  • 1
    Yes - but both can't be true, so there's no other way than to re-check the system. If grub tells there's no sda5 partition, you need to check if something has changed or if there's a problem with the partition table. – tohuwawohu Nov 21 '11 at 16:13
  • really thanks for everything ! Amith KK's answer solve my problem. – Eray Nov 21 '11 at 16:23
1

I had a similar error , how I fixed it was like this: I used Boot repair, a tool to fix grub

Boot into the LiveCD and use the following commands

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

and launch Boot repair, choosing the right options from the GUI

LovinBuntu
  • 3,615
  • 2
  • 20
  • 21
Amith KK
  • 13,412
0

check the below link

RecoveringUbuntuAfterInstallingWindows