1

After reinstalling windows 7 on my computer I receive the follow error on bootup

bootmgr error

I can only boot into windows if I unplug the linux hard drive and I can only boot into Linux if I press Esc to open the BIOS and select the linux hard drive.

I tried using

update grub-install

but that did not seem to help. How do I get grub back to its original self with both OSs to boot into from the grub menu?

Below is my sudo update-grub command:

$ sudo update-grub
[sudo] password for gin: 
Generating grub.cfg ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-3.8.0-39-generic
Found initrd image: /boot/initrd.img-3.8.0-39-generic
Found linux image: /boot/vmlinuz-3.8.0-37-generic
Found initrd image: /boot/initrd.img-3.8.0-37-generic
Found linux image: /boot/vmlinuz-3.8.0-36-generic
Found initrd image: /boot/initrd.img-3.8.0-36-generic
Found linux image: /boot/vmlinuz-3.8.0-35-generic
Found initrd image: /boot/initrd.img-3.8.0-35-generic
Found linux image: /boot/vmlinuz-3.8.0-34-generic
Found initrd image: /boot/initrd.img-3.8.0-34-generic
Found linux image: /boot/vmlinuz-3.8.0-29-generic
Found initrd image: /boot/initrd.img-3.8.0-29-generic
Found memtest86+ image: /boot/memtest86+.bin
done

Below is my fdisk command

$ sudo fdisk -l
[sudo] password for gin: 

Disk /dev/sda: 120.0 GB, 120000000000 bytes
255 heads, 63 sectors/track, 14589 cylinders, total 234375000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000764a1

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048   226250751   113124352   83  Linux
/dev/sda2       226252798   234373119     4060161    5  Extended
/dev/sda5       226252800   234373119     4060160   82  Linux swap / Solaris

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
256 heads, 63 sectors/track, 121126 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x8d19c4c4

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1  4294967295  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

Disk /dev/sdg: 4009 MB, 4009754624 bytes
145 heads, 48 sectors/track, 1125 cylinders, total 7831552 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0004e24a

   Device Boot      Start         End      Blocks   Id  System
/dev/sdg1   *          48     7831551     3915752    7  HPFS/NTFS/exFAT

Disk /dev/mapper/cryptswap1: 4157 MB, 4157603840 bytes
255 heads, 63 sectors/track, 505 cylinders, total 8120320 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x45a3a931

Disk /dev/mapper/cryptswap1 doesn't contain a valid partition table

My first attempt at How can I repair grub? (How to get Ubuntu back after installing Windows?)

$ sudo mount /dev/sda /mnt
mount: /dev/sda already mounted or /mnt busy
gin@ger:~$ for i in /sys /proc /run /dev; do sudo mount --bind "$i" "/mnt$i"; done
mount: mount point /mnt/sys does not exist
mount: mount point /mnt/proc does not exist
mount: mount point /mnt/run does not exist
mount: mount point /mnt/dev does not exist
gin@ger:~$ sudo chroot /mnt
chroot: failed to run command `/bin/bash': No such file or directory

Below is my boot order:

UEFI BOOT SOURCES
    WINDOWS BOOT MANAGER
LEGACY BOOT SOURCES
    HARD DRIVE
        SATO0
        SATO1
NETWORK CONTROLLER (REALTEK PXE B07 D00)
linuxfreebird
  • 215
  • 1
  • 6
  • 17

2 Answers2

2
  1. Do not unplug hard drive which is Windows system on, either the hard drive installed ubuntu.
  2. Change the order of hard drive in bios, set the hard drive which installed ubuntu on top of the list, keep the Ubuntu can startup as default.
  3. Boot, and login to Ubuntu
  4. run update-grub in terminal as root. you will find something in terminal, like:

    "Found Windows 7 (loader) on /dev/sdxX"

sucess!

  1. you can change the boot order by edit /etc/default/grub. change the GRUB_DEFAULT=0 to whatever you want. (0: means the first item in grub menu; 1: means the second item in grub menu. You can find grub menu by press 'shift' or down arrow key while you boot your system, or check /boot/grub/grub.cfg in ubuntu)

good luck!

RobinHood
  • 73
  • 1
  • 8
  • I posted my current boot order. SATO0 is ubunut. I think SATO1 is windows. I think the windows boot manager is causing the problem. Not sure how to move it or remove it in the boot order. – linuxfreebird May 17 '14 at 02:11
  • My attempt at implementing your answer did not work. Is the window manager interfering somehow? – linuxfreebird May 17 '14 at 02:24
  • Can Ubuntu boot up successfully without any operations ? Or Which one can boot up successfully? – RobinHood May 17 '14 at 04:30
  • Is your Windows 7 installed in EFI mode and Ubuntu installed in Legacy/MBR mode? If it is ture, you need convert Ubuntu into EFI mode. Ubuntu must be installed as the same as Windows does, and ubuntu/grub2 will boot windows in correct way. Just keep in mind, this convertion do not need to reinstall Windows and Ubuntu. You can look here and here to find what you want. – RobinHood May 17 '14 at 06:18
0

Connect your external hard disk boot into Ubuntu, mount your Windows 7 partition and try running this in terminal

sudo update-grub

For mounting you no need to use terminal just open windows 7 partition in nautilus.

Sudheer
  • 5,113
  • 4
  • 24
  • 27