Grub can't load windows 7
I just installed ubuntu 16.04 on a computer that had windows7 already installed. Grub can boot Linux, but not windows7. However, I can boot windows7 by selecting its partition from the pc firmware and bypassing grub.
grub gives the error: file /bootmgr not found
Any ideas?
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Ubuntu Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Carlos Munoz
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#1 |
This is the output of bootinfoscript:
=======
=> Windows is installed in the MBR of /dev/sda.
=> Grub2 (v1.99) is installed in the MBR of /dev/sdb and looks at sector 1 of
the same hard drive for core.img. core.img is at this location and looks
in partition 97 for .
sda1: _______
File system: ntfs
Boot sector type: Windows Vista/7: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files: /bootmgr /Boot/BCD
sda2: _______
File system: ntfs
Boot sector type: Windows Vista/7: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files: /bootmgr /Boot/BCD /Windows/
sda3: _______
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 16.04.2 LTS
Boot files: /boot/grub/grub.cfg /etc/fstab
sda4: _______
File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files:
sdb1: _______
File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files:
sdb2: _______
File system: Extended Partition
Boot sector type: -
Boot sector info:
sdb5: _______
File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files:
sdb6: _______
File system: swap
Boot sector type: -
Boot sector info:
=======
Drive: sda _______
Disk /dev/sda: 894.3 GiB, 960197124096 bytes, 1875385008 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
Disklabel type: dos
Partition Boot Start Sector End Sector # of Sectors Id System
/dev/sda1 * 2,048 206,847 204,800 7 NTFS / exFAT / HPFS
/dev/sda2 206,848 923,064,319 922,857,472 7 NTFS / exFAT / HPFS
/dev/sda3 923,066,368 1,020,720,664 97,654,297 83 Linux
/dev/sda4 1,020,723,200 1,875,384,319 854,661,120 83 Linux
Drive: sdb _______
Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 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
Disklabel type: dos
Partition Boot Start Sector End Sector # of Sectors Id System
/dev/sdb1 2,048 1,757,812,735 1,757,810,688 83 Linux
/dev/sdb2 1,757,814,782 1,953,523,711 195,708,930 5 Extended
/dev/sdb5 * 1,757,814,784 1,855,469,567 97,654,784 83 Linux
/dev/sdb6 1,855,471,616 1,953,523,711 98,052,096 82 Linux swap / Solaris
"blkid" output: _______
Device UUID TYPE LABEL
/dev/sda1 C280B54580B540A9 ntfs
/dev/sda2 E82AC1132AC0DFA4 ntfs
/dev/sda3 e0d717ce-
/dev/sda4 109edeba-
/dev/sdb1 0d327864-
/dev/sdb5 2952a0f9-
/dev/sdb6 d224c765-
=======
Device Mount_Point Type Options
/dev/sda3 / ext4 (rw,relatime,
/dev/sda4 /usr ext4 (rw,relatime,
/dev/sdb1 /home ext4 (rw,relatime,
/dev/sdb5 /tmp ext4 (rw,relatime,
=======
-------
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
if [ "${next_entry}" ] ; then
set default=
set next_entry=
save_env next_entry
set boot_once=true
else
set default="0"
fi
if [ x"${feature_
menuentry_
else
menuentry_
fi
export menuentry_id_option
if [ "${prev_
set saved_entry=
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_
save_env saved_entry
fi
}
function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}
function load_video {
if [ x$feature_
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
if [ x$feature_
font=unicode
else
insmod part_msdos
insmod ext2
set root='hd0,msdos4'
if [ x$feature_
search --no-floppy --fs-uuid --set=root --hint-
else
search --no-floppy --fs-uuid --set=root 109edeba-
fi
font=
fi
if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_
set lang=en_US
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
set timeout=30
else
if [ x$feature_
set timeout_style=menu
set timeout=10
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=10
fi
fi
### END /etc/grub.
### BEGIN /etc/grub.
set menu_color_
set menu_color_
if background_color 44,0,30,0; then
clear
fi
### END /etc/grub.
### BEGIN /etc/grub.
function gfxmode {
set gfxpayload="${1}"
if [ "${1}" = "keep" ]; then
set vt_handoff=
else
set vt_handoff=
fi
}
if [ "${recordfail}" != 1 ]; then
if [ -e ${prefix}
if hwmatch ${prefix}
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos3'
if [ x$feature_
search --no-floppy --fs-uuid --set=root --hint-
else
search --no-floppy --fs-uuid --set=root e0d717ce-
fi
linux /boot/vmlinuz-
initrd /boot/initrd.
}
submenu 'Advanced options for Ubuntu' $menuentry_
menuentry 'Ubuntu, with Linux 4.4.0-79-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos3'
if [ x$feature_
search --no-floppy --fs-uuid --set=root --hint-
else
search --no-floppy --fs-uuid --set=root e0d717ce-
fi
echo 'Loading Linux 4.4.0-79-generic ...'
linux /boot/vmlinuz-
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.
}
menuentry 'Ubuntu, with Linux 4.4.0-79-generic (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos3'
if [ x$feature_
search --no-floppy --fs-uuid --set=root --hint-
else
search --no-floppy --fs-uuid --set=root e0d717ce-
fi
echo 'Loading Linux 4.4.0-79-generic ...'
linux /boot/vmlinuz-
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.
}
menuentry 'Ubuntu, with Linux 4.4.0-79-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos3'
if [ x$feature_
search --no-floppy --fs-uuid --set=root --hint-
else
search --no-floppy --fs-uuid --set=root e0d717ce-
fi
echo 'Loading Linux 4.4.0-79-generic ...'
linux /boot/vmlinuz-
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.
}
menuentry 'Ubuntu, with Linux 4.4.0-31-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos3'
if [ x$feature_
search --no-floppy --fs-uuid --set=root --hint-
else
search --no-floppy --fs-uuid --set=root e0d717ce-
fi
echo 'Loading Linux 4.4.0-31-generic ...'
linux /boot/vmlinuz-
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.
}
menuentry 'Ubuntu, with Linux 4.4.0-31-generic (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos3'
if [ x$feature_
search --no-floppy --fs-uuid --set=root --hint-
else
search --no-floppy --fs-uuid --set=root e0d717ce-
fi
echo 'Loading Linux 4.4.0-31-generic ...'
linux /boot/vmlinuz-
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.
}
menuentry 'Ubuntu, with Linux 4.4.0-31-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos3'
if [ x$feature_
search --no-floppy --fs-uuid --set=root --hint-
else
search --no-floppy --fs-uuid --set=root e0d717ce-
fi
echo 'Loading Linux 4.4.0-31-generic ...'
linux /boot/vmlinuz-
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.
}
}
### END /etc/grub.
### BEGIN /etc/grub.
### END /etc/grub.
### BEGIN /etc/grub.
### END /etc/grub.
### BEGIN /etc/grub.
### END /etc/grub.
### BEGIN /etc/grub.
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "Windows 7" {
#insmod part_msdos
insmod ntfs
#insmod ntldr
set root='hd0,msdos1'
#search --no-floppy --fs-uuid --set=root C280B54580B540A9
#search --set=root --hint hd0,msdos1
#parttool ${root} hidden-
#ntldr ${root}/bootmgr
ntldr /bootmgr
# chainloader +1
}
### END /etc/grub.
### BEGIN /etc/grub.
if [ -f ${config_
source ${config_
elif [ -z "${config_
source $prefix/custom.cfg;
fi
### END /etc/grub.
-------
=======
-------
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda3 during installation
UUID=e0d717ce-
# /home was on /dev/sdb1 during installation
UUID=0d327864-
# /tmp was on /dev/sdb5 during installation
UUID=2952a0f9-
# /usr was on /dev/sda4 during installation
#UUID=109edeba-
# swap was on /dev/sdb6 during installation
UUID=d224c765-
UUID=109edeba-
-------
=================== sda3: Location of files loaded by Grub: =======
GiB - GB File Fragment(s)
=======
cat: /tmp/BootInfo-
Revision history for this message
|
#2 |
Have you tried with boot-repair already? I found it works for most usual cases:
Revision history for this message
|
#3 |
Yes, I had tried that but it didn't work for me. However, the following steps fixed the problem. I can now boot into Windows 7 and Ubuntu from grub.
1. Removed grub from the second hard drive:
sudo dd if=/dev/zero of=/dev/sdb bs=446 count=1
2. Used Boot-repair to remove and reinstall grub only on the first hard drive (/dev/sda)
3. Added the line "GRUB_DISABLE_
4. Added the Windows 7 menuentry to "/etc/grub.
menuentry 'Windows 7' {
insmod part_msdos
insmod ntfs
set root='hd0,msdos1'
search --no-floppy --fs-uuid --set=root C280B54580B540A9
parttool ${root} hidden-
ntldr /bootmgr
}
5. Added the following lines to "/etc/default/grub" to see the grub menu:
GRUB_HIDDEN_
GRUB_HIDDEN_
GRUB_TIMEOUT_
6. Ran update-grub