PDA

View Full Version : [ubuntu] Grub booting wrong OS



grogling
August 29th, 2011, 09:55 AM
I have an odd problem, it seems like Grub is booting the wrong OS.

My HDD's are as follows.

hda - Ubuntu
hdb - Windows 7
hdc - Vista

hdb is a new drive, I installed Windows 7 on it recently, i unplugged all other drives when I installed it, to ensure windows wouldn't screw with the MBR's of other disks.

Grub seems to have detected it as a windows 7 entry now appears, but when I choose it, vista (from hdc) starts instead.

I'm confused by what is going on, is it really grub booting the wrong thing, or is the windows bootloader looking in the wrong place.


Boot Info Script 0.60 from 17 May 2011


============================= Boot Info Summary: ===============================

=> Grub2 (v1.97-1.98) is installed in the MBR of /dev/sda and looks at sector
1 of the same hard drive for core.img. core.img is at this location and
looks in partition 1 for (,msdos1)/boot/grub.
=> Windows is installed in the MBR of /dev/sdb.
=> Windows is installed in the MBR of /dev/sdc.

sda1: __________________________________________________ ________________________

File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 10.10
Boot files: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img

sdb1: __________________________________________________ ________________________

File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: No errors found in the Boot Parameter Block.
============================ Drive/Partition Info: =============================

Drive: sda __________________________________________________ ___________________

Disk /dev/sda: 64.0 GB, 64023257088 bytes
255 heads, 63 sectors/track, 7783 cylinders, total 125045424 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition Boot Start Sector End Sector # of Sectors Id System

/dev/sda1 * 2,048 125,045,016 125,042,969 83 Linux


Drive: sdb __________________________________________________ ___________________

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition Boot Start Sector End Sector # of Sectors Id System

/dev/sdb1 * 63 976,768,064 976,768,002 7 NTFS / exFAT / HPFS


Drive: sdc __________________________________________________ ___________________

Disk /dev/sdc: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition Boot Start Sector End Sector # of Sectors Id System

/dev/sdc1 * 2,048 625,139,711 625,137,664 7 NTFS / exFAT / HPFS


"blkid" output: __________________________________________________ ______________

Device UUID TYPE LABEL

/dev/sda1 e8e6fe8d-99e6-44a1-958b-44111a5e68bb ext4
/dev/sdb1 2548C22354B8BFA9 ntfs GAMES
/dev/sdc1 02AAC9A1AAC99199 ntfs Glens Disk

================================ Mount points: =================================

Device Mount_Point Type Options

/dev/sda1 / ext4 (rw,errors=remount-ro,commit=0)
/dev/sdb1 /tmp/BootInfo0/sdb1 fuseblk (ro,nosuid,nodev,allow_other,blksize=4096)


=========================== sda1/boot/grub/grub.cfg: ===========================

--------------------------------------------------------------------------------
#
# 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.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_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_entry="${chosen}"
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 {
insmod vbe
insmod vga
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set e8e6fe8d-99e6-44a1-958b-44111a5e68bb
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set e8e6fe8d-99e6-44a1-958b-44111a5e68bb
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.32-21-generic-pae' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set e8e6fe8d-99e6-44a1-958b-44111a5e68bb
linux /boot/vmlinuz-2.6.32-21-generic-pae root=UUID=e8e6fe8d-99e6-44a1-958b-44111a5e68bb ro quiet splash
initrd /boot/initrd.img-2.6.32-21-generic-pae
}
menuentry 'Ubuntu, with Linux 2.6.32-21-generic-pae (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set e8e6fe8d-99e6-44a1-958b-44111a5e68bb
echo 'Loading Linux 2.6.32-21-generic-pae ...'
linux /boot/vmlinuz-2.6.32-21-generic-pae root=UUID=e8e6fe8d-99e6-44a1-958b-44111a5e68bb ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-21-generic-pae
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/11_linux_xen ###
### END /etc/grub.d/11_linux_xen ###

### BEGIN /etc/grub.d/12_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set e8e6fe8d-99e6-44a1-958b-44111a5e68bb
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set e8e6fe8d-99e6-44a1-958b-44111a5e68bb
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/12_memtest86+ ###

### BEGIN /etc/grub.d/13_invaders_proxy ###
menuentry "GRUB Invaders" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set e8e6fe8d-99e6-44a1-958b-44111a5e68bb
multiboot /boot/invaders.exec
}
### END /etc/grub.d/13_invaders_proxy ###

### BEGIN /etc/grub.d/14_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sdb1)" {
insmod part_msdos
insmod ntfs
set root='(hd1,msdos1)'
search --no-floppy --fs-uuid --set 2548C22354B8BFA9
chainloader +1
}
menuentry "Windows Vista (loader) (on /dev/sdc1)" {
insmod part_msdos
insmod ntfs
set root='(hd2,msdos1)'
search --no-floppy --fs-uuid --set 02AAC9A1AAC99199
chainloader +1
}
### END /etc/grub.d/14_os-prober ###

### BEGIN /etc/grub.d/15_custom ###
# 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.
### END /etc/grub.d/15_custom ###

### BEGIN /etc/grub.d/16_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/16_custom ###

### BEGIN /etc/grub.d/17_invaders_proxy ###
menuentry "GRUB Invaders" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set e8e6fe8d-99e6-44a1-958b-44111a5e68bb
multiboot /boot/invaders.exec
}
### END /etc/grub.d/17_invaders_proxy ###
--------------------------------------------------------------------------------

=============================== sda1/etc/fstab: ================================

--------------------------------------------------------------------------------
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' 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>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda1 during installation
UUID=e8e6fe8d-99e6-44a1-958b-44111a5e68bb / ext4 errors=remount-ro 0 1
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0

--------------------------------------------------------------------------------

=================== sda1: Location of files loaded by Grub: ====================

GiB - GB File Fragment(s)

4.192234039 = 4.501377024 boot/grub/core.img 1
40.325752258 = 43.299446784 boot/grub/grub.cfg 2
18.048030853 = 19.378925568 boot/initrd.img-2.6.32-21-generic-pae 1
4.254852295 = 4.568612864 boot/vmlinuz-2.6.32-21-generic-pae 1
18.048030853 = 19.378925568 initrd.img 1
4.254852295 = 4.568612864 vmlinuz 1

========================== sdb1/grldr embedded menu: ===========================

--------------------------------------------------------------------------------

=============================== StdErr Messages: ===============================

./boot_info_script.sh: line 1888: ( / 2 ) + 16 : syntax error: operand expected (error token is "/ 2 ) + 16 ")

grogling
August 29th, 2011, 10:14 AM
Just to add to the information, if I change the BIOS boot settings to make the Windows 7 disk the first to boot, windows boots fine.

YesWeCan
August 29th, 2011, 03:16 PM
Very interesting.

Hmm.

The bootinfoscript output looks ok to me, except that the first section "Boot info Summary" seems to have been cut short: some of the sdb info is missing and there is no sdc info. Suspicious.

Have you tried disconnecting the Vista drive and then booting Grub and seeing what happens when you select Win7?