PDA

View Full Version : [SOLVED] [Grub2] [Ubuntu 10.04] Windows doesnt boot



IanVaughan
April 2nd, 2010, 05:10 PM
I recently upgraded to 10.04, all went well.
Except now Windows 7 does not load.
It shows up on the grub menu, but when selected just hangs with blinking cursor?


$ sudo fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 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: 0xf5191ab2

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 102400 7 HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2 13 64223 515761632 7 HPFS/NTFS
/dev/sda3 64224 121601 460888785 5 Extended
/dev/sda5 64224 120849 454848313+ 83 Linux
/dev/sda6 120850 121601 6040408+ 82 Linux swap / Solaris

Disk /dev/sdb: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 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: 0x06adedb7

Device Boot Start End Blocks Id System
/dev/sdb1 1 19452 156247040 7 HPFS/NTFS

Disk /dev/sdc: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 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: 0x00000001

Device Boot Start End Blocks Id System
/dev/sdc1 1 38914 312568832 7 HPFS/NTFS




$ cat /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='(hd0,5)'
search --no-floppy --fs-uuid --set 2890b4f9-3ce4-4008-b640-b8c93290314c
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=800x600
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='(hd0,5)'
search --no-floppy --fs-uuid --set 2890b4f9-3ce4-4008-b640-b8c93290314c
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=3
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-19-generic" --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 2890b4f9-3ce4-4008-b640-b8c93290314c
linux /boot/vmlinuz-2.6.32-19-generic root=UUID=2890b4f9-3ce4-4008-b640-b8c93290314c ro splash vga=771 quiet splash
initrd /boot/initrd.img-2.6.32-19-generic
}
menuentry "Ubuntu, with Linux 2.6.32-19-generic (recovery mode)" --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 2890b4f9-3ce4-4008-b640-b8c93290314c
echo Loading Linux 2.6.32-19-generic ...
linux /boot/vmlinuz-2.6.32-19-generic root=UUID=2890b4f9-3ce4-4008-b640-b8c93290314c ro single splash vga=771
echo Loading initial ramdisk ...
initrd /boot/initrd.img-2.6.32-19-generic
}
### END /etc/grub.d/10_linux ###

### 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 0c58dd5458dd3ce0
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 ###

oldfred
April 2nd, 2010, 07:53 PM
You realize 10.04 is beta. I only have a 640GB drive and two 160s. I have 3 root partitions so I can boot my old version, my current version which I alternate when new versions are released and another root just for testing beta. All my data is else where so I only need 10-20GB for a root partition and with multiple drives I have different grub's in each drive.

Because you have various drives & partitions run this script to see what is where:
Boot Info Script courtesy of forum member meierfra
Page with instructions and download:
http://bootinfoscript.sourceforge.net/
Be sure to highlight and use code tags (# in edit panel) to make it easier to read when you post the results.txt.

IanVaughan
April 3rd, 2010, 04:01 PM
$ cat RESULTS.txt
Boot Info Script 0.55 dated February 15th, 2010

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

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

sda1: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Grub 2
Boot sector info: Grub 2 is installed in the boot sector of sda1 and
looks at sector 1032202614 of the same hard drive for
core.img, but core.img can not be found at this
location. No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs: /bootmgr /Boot/BCD

sda2: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Grub 2
Boot sector info: Grub 2 is installed in the boot sector of sda2 and
looks at sector 1032202846 of the same hard drive for
core.img, but core.img can not be found at this
location. No errors found in the Boot Parameter Block.
Operating System: Windows 7
Boot files/dirs: /Windows/System32/winload.exe

sda3: __________________________________________________ _______________________

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

sda5: __________________________________________________ _______________________

File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu lucid (development
branch)
Boot files/dirs: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img

sda6: __________________________________________________ _______________________

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

sdb1: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Grub 2
Boot sector info: Grub 2 is installed in the boot sector of sdb1 and
looks at sector 1032202334 of the same hard drive for
core.img, but core.img can not be found at this
location. No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs:

sdc1: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Grub 2
Boot sector info: Grub 2 is installed in the boot sector of sdc1 and
looks at sector 1032133598 of the same hard drive for
core.img, but core.img can not be found at this
location. No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs:

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

Drive: sda ___________________ __________________________________________________ ___

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 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 206,847 204,800 7 HPFS/NTFS
/dev/sda2 206,848 1,031,730,111 1,031,523,264 7 HPFS/NTFS
/dev/sda3 1,031,742,495 1,953,520,064 921,777,570 5 Extended
/dev/sda5 1,031,742,558 1,941,439,184 909,696,627 83 Linux
/dev/sda6 1,941,439,248 1,953,520,064 12,080,817 82 Linux swap / Solaris


Drive: sdb ___________________ __________________________________________________ ___

Disk /dev/sdb: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders, total 312500000 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 312,496,127 312,494,080 7 HPFS/NTFS


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 End Size Id System

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


blkid -c /dev/null: __________________________________________________ __________

Device UUID TYPE LABEL

/dev/sda1 0C58DD5458DD3CE0 ntfs System Reserved
/dev/sda2 1C5CECCF5CECA52C ntfs
/dev/sda3: PTTYPE="dos"
/dev/sda5 2890b4f9-3ce4-4008-b640-b8c93290314c ext4
/dev/sda6 cc6fc6e9-829f-4ba0-9098-6a34d1bba2d3 swap
/dev/sda: PTTYPE="dos"
/dev/sdb1 60647BCC647BA386 ntfs New Volume
/dev/sdb: PTTYPE="dos"
/dev/sdc1 28C07873C0784958 ntfs New Volume
/dev/sdc: PTTYPE="dos"
error: /dev/sdd: No medium found
error: /dev/sde: No medium found
error: /dev/sdf: No medium found
error: /dev/sdg: No medium found

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

Device Mount_Point Type Options

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


=========================== sda5/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='(hd0,5)'
search --no-floppy --fs-uuid --set 2890b4f9-3ce4-4008-b640-b8c93290314c
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=800x600
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='(hd0,5)'
search --no-floppy --fs-uuid --set 2890b4f9-3ce4-4008-b640-b8c93290314c
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=3
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-19-generic" --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 2890b4f9-3ce4-4008-b640-b8c93290314c
linux /boot/vmlinuz-2.6.32-19-generic root=UUID=2890b4f9-3ce4-4008-b640-b8c93290314c ro splash vga=771 quiet splash
initrd /boot/initrd.img-2.6.32-19-generic
}
menuentry "Ubuntu, with Linux 2.6.32-19-generic (recovery mode)" --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 2890b4f9-3ce4-4008-b640-b8c93290314c
echo Loading Linux 2.6.32-19-generic ...
linux /boot/vmlinuz-2.6.32-19-generic root=UUID=2890b4f9-3ce4-4008-b640-b8c93290314c ro single splash vga=771
echo Loading initial ramdisk ...
initrd /boot/initrd.img-2.6.32-19-generic
}
### END /etc/grub.d/10_linux ###

### 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 0c58dd5458dd3ce0
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 ###

=============================== sda5/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 defaults 0 0
# / was on /dev/sda5 during installation
UUID=2890b4f9-3ce4-4008-b640-b8c93290314c / ext4 errors=remount-ro 0 1
# swap was on /dev/sda6 during installation
UUID=cc6fc6e9-829f-4ba0-9098-6a34d1bba2d3 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0

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


528.4GB: boot/grub/core.img
535.0GB: boot/grub/grub.cfg
531.9GB: boot/initrd.img-2.6.32-19-generic
530.3GB: boot/vmlinuz-2.6.32-19-generic
531.9GB: initrd.img
530.3GB: vmlinuz
=======Devices which don't seem to have a corresponding hard drive==============

sdd sde sdf sdg

Wow, what a cool script!
Does it help you/anyone to help me?
Cheers, Ian.

oldfred
April 3rd, 2010, 05:26 PM
You have to be the third or fourth person I have seen with this problem. Did you request to install grub into all the partitions or is there a bug in grub that is installing it everywhere?
You really should only have grub in the MBR not the PBR. Grub overwrote the windows boot files in the PBR.
With win7's separaate boot partition I am not 100% sure if one or both partitions have to have grub removed but the windows repair should fix it.

I am just copying the instructions, do not run fixMBR or else you will have to reinstall grub. You need the fixboot command, other others only if that does not work by itself.

Vista or 7 repair
Always run chkdsk and run again until there are no errors, that may be all that is required
How to use the Bootrec.exe tool in the Windows Recovery Environment to troubleshoot and repair startup issues in Windows
http://support.microsoft.com/kb/927392
Repair often does not work, some say run 3 times others recommend the command line bootrec.exe

You will need to boot with your Vista/Windows 7 installation disk. Hit Enter at the language selection prompt then hit "R" to get to the repair section. You can then select the automatic boot repair tool, but it often will not do any good. Then select the command prompt (console) and type in the following commands:
BootRec.exe /fixmbr #updates MBR master boot record do not run if you still want grub
chkdsk /r
BootRec.exe /FixBoot #updates PBR partition boot
BootRec.exe /ScanOs
BootRec.exe /RebuildBcd

IanVaughan
April 6th, 2010, 02:28 PM
You will need to boot with your Vista/Windows 7 installation disk. Hit Enter at the language selection prompt then hit "R" to get to the repair section.
BootRec.exe /FixBoot #updates PBR partition boot
BootRec.exe /ScanOs
BootRec.exe /RebuildBcd

This worked a treat!

Many thanks!

Billiska
August 24th, 2010, 11:42 AM
Thanks Oldfred, This solve my problem too.


You have to be the third or fourth person I have seen with this problem. Did you request to install grub into all the partitions or is there a bug in grub that is installing it everywhere?

Aside from the thanks, I just want to inform you what might caused a lot of people to have this problem. During the procedure of replacing grub legacy with grub2, There is an instruction like "If you do not know where to install grub2, just install it everywhere, it will work". I think this was in upgrade-from-grub-legacy program. This should really be changed.