PDA

View Full Version : [ubuntu] Windows 7 Restarts When Booting From Grub



dpitch40
December 22nd, 2010, 03:16 PM
I've been upgrading my desktop, which involved installing Windows 7 to it. I already had Ubuntu on it, and after the upgrade (new motherboard and processor) Ubuntu still works fine. But if I try to boot Windows 7 from GRUB, it restarts after appearing to load 7. I've seen this problem on the forum, but here's the weird part: I have the OSes on separate, bootable hard drives, and if I disconnect the Ubuntu drive or swap the connections, Windows 7 boots fine. So technically I have a workaround, but I would like to be able to switch between OSes without opening my case and swapping connections every time. I ran the boot info script and got these results:


Boot Info Script 0.55 dated February 15th, 2010

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

=> Windows is installed in the MBR of /dev/sda
=> Grub 2 is installed in the MBR of /dev/sdb and looks on the same drive in
partition #1 for /boot/grub.

sda1: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows 7
Boot files/dirs: /bootmgr /Boot/BCD /Windows/System32/winload.exe

sdb1: __________________________________________________ _______________________

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

sdb2: __________________________________________________ _______________________

File system: Extended Partition
Boot sector type: Unknown
Boot sector info:

sdb5: __________________________________________________ _______________________

File system: swap
Boot sector type: -
Boot sector info:

=========================== Drive/Partition Info: =============================

Drive: sda ___________________ __________________________________________________ ___

Disk /dev/sda: 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 End Size Id System

/dev/sda1 * 2,048 976,771,071 976,769,024 7 HPFS/NTFS


Drive: sdb ___________________ __________________________________________________ ___

Disk /dev/sdb: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition Boot Start End Size Id System

/dev/sdb1 * 2,048 468,762,623 468,760,576 83 Linux
/dev/sdb2 468,764,670 488,396,799 19,632,130 5 Extended
/dev/sdb5 468,764,672 488,396,799 19,632,128 82 Linux swap / Solaris


blkid -c /dev/null: __________________________________________________ __________

Device UUID TYPE LABEL

/dev/sda1 5392DDCA3F4565FF ntfs C:
/dev/sda: PTTYPE="dos"
/dev/sdb1 e2cdae5d-e3b3-4898-bf76-506a654e883f ext4
/dev/sdb2: PTTYPE="dos"
/dev/sdb5 be226207-5970-46f5-aa38-6fb581e887e1 swap
/dev/sdb: PTTYPE="dos"

============================ "mount | grep ^/dev output: ===========================

Device Mount_Point Type Options

/dev/sdb1 / ext4 (rw,errors=remount-ro)


=========================== sdb1/boot/grub/grub.cfg: ===========================

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/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
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
}
insmod ext2
set root='(hd1,1)'
search --no-floppy --fs-uuid --set e2cdae5d-e3b3-4898-bf76-506a654e883f
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
insmod ext2
set root='(hd1,1)'
search --no-floppy --fs-uuid --set e2cdae5d-e3b3-4898-bf76-506a654e883f
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-26-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,1)'
search --no-floppy --fs-uuid --set e2cdae5d-e3b3-4898-bf76-506a654e883f
linux /boot/vmlinuz-2.6.32-26-generic root=UUID=e2cdae5d-e3b3-4898-bf76-506a654e883f ro quiet splash
initrd /boot/initrd.img-2.6.32-26-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-26-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,1)'
search --no-floppy --fs-uuid --set e2cdae5d-e3b3-4898-bf76-506a654e883f
echo 'Loading Linux 2.6.32-26-generic ...'
linux /boot/vmlinuz-2.6.32-26-generic root=UUID=e2cdae5d-e3b3-4898-bf76-506a654e883f ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-26-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-25-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,1)'
search --no-floppy --fs-uuid --set e2cdae5d-e3b3-4898-bf76-506a654e883f
linux /boot/vmlinuz-2.6.32-25-generic root=UUID=e2cdae5d-e3b3-4898-bf76-506a654e883f ro quiet splash
initrd /boot/initrd.img-2.6.32-25-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-25-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,1)'
search --no-floppy --fs-uuid --set e2cdae5d-e3b3-4898-bf76-506a654e883f
echo 'Loading Linux 2.6.32-25-generic ...'
linux /boot/vmlinuz-2.6.32-25-generic root=UUID=e2cdae5d-e3b3-4898-bf76-506a654e883f ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-25-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-24-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,1)'
search --no-floppy --fs-uuid --set e2cdae5d-e3b3-4898-bf76-506a654e883f
linux /boot/vmlinuz-2.6.32-24-generic root=UUID=e2cdae5d-e3b3-4898-bf76-506a654e883f ro quiet splash
initrd /boot/initrd.img-2.6.32-24-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-24-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,1)'
search --no-floppy --fs-uuid --set e2cdae5d-e3b3-4898-bf76-506a654e883f
echo 'Loading Linux 2.6.32-24-generic ...'
linux /boot/vmlinuz-2.6.32-24-generic root=UUID=e2cdae5d-e3b3-4898-bf76-506a654e883f ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-24-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-21-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,1)'
search --no-floppy --fs-uuid --set e2cdae5d-e3b3-4898-bf76-506a654e883f
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=e2cdae5d-e3b3-4898-bf76-506a654e883f ro quiet splash
initrd /boot/initrd.img-2.6.32-21-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-21-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,1)'
search --no-floppy --fs-uuid --set e2cdae5d-e3b3-4898-bf76-506a654e883f
echo 'Loading Linux 2.6.32-21-generic ...'
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=e2cdae5d-e3b3-4898-bf76-506a654e883f ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-21-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod ext2
set root='(hd1,1)'
search --no-floppy --fs-uuid --set e2cdae5d-e3b3-4898-bf76-506a654e883f
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod ext2
set root='(hd1,1)'
search --no-floppy --fs-uuid --set e2cdae5d-e3b3-4898-bf76-506a654e883f
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sda1)" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 5392ddca3f4565ff
chainloader +1
}
### END /etc/grub.d/30_os-prober ###

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

=============================== sdb1/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=e2cdae5d-e3b3-4898-bf76-506a654e883f / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=be226207-5970-46f5-aa38-6fb581e887e1 none swap sw 0 0

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


60.2GB: boot/grub/core.img
14.5GB: boot/grub/grub.cfg
60.2GB: boot/initrd.img-2.6.32-21-generic
60.4GB: boot/initrd.img-2.6.32-24-generic
60.5GB: boot/initrd.img-2.6.32-25-generic
60.6GB: boot/initrd.img-2.6.32-26-generic
60.2GB: boot/vmlinuz-2.6.32-21-generic
60.4GB: boot/vmlinuz-2.6.32-24-generic
60.5GB: boot/vmlinuz-2.6.32-25-generic
60.5GB: boot/vmlinuz-2.6.32-26-generic
60.6GB: initrd.img
60.5GB: initrd.img.old
60.5GB: vmlinuz
60.5GB: vmlinuz.old
=========================== Unknown MBRs/Boot Sectors/etc =======================

Unknown BootLoader on sdb2

00000000 89 61 a0 a6 95 7b d7 c4 18 ec 86 ff a6 3b fe 57 |.a...{.......;.W|
00000010 fe fd c1 43 7f 53 43 a1 36 81 61 0c 2e ee 57 44 |...C.SC.6.a...WD|
00000020 20 a0 a0 91 5f 88 af ff ff d0 28 28 28 50 a6 20 | ..._.....(((P. |
00000030 02 93 95 28 8c 36 27 15 d6 bc c3 f8 c1 62 0e 29 |...(.6'......b.)|
00000040 2b 15 5b 43 af 18 f4 26 0c 5b 96 79 c3 3b aa 21 |+.[C...&.[.y.;.!|
00000050 c3 cd 2e 7d bb 67 08 53 b2 76 95 5e 8a 65 a6 31 |...}.g.S.v.^.e.1|
00000060 83 40 62 41 30 26 3e 4c 89 1e 1d 95 9d a4 28 9b |.@bA0&>L......(.|
00000070 b8 44 da 2d f2 ee d2 4a 37 a2 9c c9 df 2b ad 6f |.D.-...J7....+.o|
00000080 ed fe b3 10 c9 ff bb 65 e9 3f 42 94 1b 9a f8 90 |.......e.?B.....|
00000090 4a 4d d7 58 d2 92 07 94 57 99 3b 09 a7 57 da 64 |JM.X....W.;..W.d|
000000a0 0f 12 e6 cd a2 59 96 1e 53 f6 bf 69 4c f2 a4 24 |.....Y..S..iL..$|
000000b0 9e 5f 34 33 67 06 de 81 47 63 cb 44 dc 9f 37 fe |._43g...Gc.D..7.|
000000c0 91 2d 3b b0 7f 6b 96 66 a5 32 6a 10 de 2b a0 40 |.-;..k.f.2j..+.@|
000000d0 78 90 e9 d7 9a 10 18 99 ac 55 d4 16 d9 13 03 4a |x........U.....J|
000000e0 0f 10 72 e3 d5 17 a1 49 4c 41 4d 45 33 2e 39 38 |..r....ILAME3.98|
000000f0 2e ff fb 92 04 00 00 02 ec 48 dd d1 69 18 10 5e |.........H..i..^|
00000100 07 8b ba 30 43 32 4c 05 2d 7f 23 04 70 39 81 2b |...0C2L.-.#.p9.+|
00000110 ef e8 90 8d 17 06 01 40 10 0a 77 7a 0c 43 02 05 |.......@..wz.C..|
00000120 f1 90 19 1c dd 09 5c a9 ab 95 c9 25 39 25 37 99 |......\....%9%7.|
00000130 2e 90 91 4c 94 c9 3f f1 09 bc 34 b0 45 2a 7c c3 |...L..?...4.E*|.|
00000140 bd 32 b4 d2 e5 bb 0f 3e 9a 7a 53 42 e1 7e e6 57 |.2.....>.zSB.~.W|
00000150 fd 09 de 22 12 58 46 8e 77 af 09 ce c1 64 03 e3 |...".XF.w....d..|
00000160 50 c5 94 85 8b bf 1a 20 6b a1 87 e7 c9 a4 e1 fa |P...... k.......|
00000170 c0 82 70 10 11 80 00 a7 77 a8 2a b0 78 f8 5f e0 |..p.....w.*.x._.|
00000180 78 fb 84 4a e5 5e 87 00 56 54 3a 73 94 de 79 65 |x..J.^..VT:s..ye|
00000190 a4 4a 84 07 a5 78 21 d0 91 6b a7 88 52 23 27 30 |.J...x!..k..R#'0|
000001a0 e2 dd e6 4f 33 a7 5d d9 32 7c b8 5f 3e 7c cd 3d |...O3.].2|._>|.=|
000001b0 f7 82 23 c9 80 c4 98 6f f3 6a 74 63 cc 0e 00 fe |..#....o.jtc....|
000001c0 ff ff 82 fe ff ff 02 00 00 00 00 90 2b 01 00 00 |............+...|
000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
00000200

Any help would be appreciated.

Also, running sudo fdisk -l gives these results:


sudo fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc9b14fff

Device Boot Start End Blocks Id System
/dev/sda1 * 1 60802 488384512 7 HPFS/NTFS

Disk /dev/sdb: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0006946a

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 29180 234380288 83 Linux
/dev/sdb2 29180 30402 9816065 5 Extended
/dev/sdb5 29180 30402 9816064 82 Linux swap / Solaris

dpitch40
December 22nd, 2010, 05:22 PM
Fixed by following the instructions here.

http://www.uluga.ubuntuforums.org/showthread.php?t=1464655&page=3

Thanks, oldfred!

Quackers
December 22nd, 2010, 05:25 PM
Try this
Make your Ubuntu drive bootable in the bios.
Then when Ubuntu is booted up open a terminal (Applications > Accessories > terminal) and run
sudo update-grub
then enter your password and watch the terminal screen as grub.cfg is configured. Does it pick up the Windows Loader?
If it does reboot and you should get the option to boot Windows.
See if Windows boots ok.
If the Windows Loader does not appear it may be necessary to re-install grub2.

oldfred
December 22nd, 2010, 07:41 PM
I just took a look at this thread to see if I could add anything and I see I solved it?:)

You are welcome. dpitch40

Did you have to run quackers suggestion on reinstalling grub also?

Not sure why the windows fixes work as I do not know all the details of the inner workings of windows, but it may be something about two drives and which drive is drive 0 or drive 1, or the change in hardware with the second drive.

You can post it as solved.

Quackers
December 22nd, 2010, 07:43 PM
oldfred is omnipresent :-)