PDA

View Full Version : [SOLVED] Installed Ubuntu, i need some help to get Windows 7 to show up on the bootloader.



badhabits
June 18th, 2011, 06:31 AM
Hello, I just installed Ubuntu 11.04 and i cannot see Windows 7 on the bootloader (yes, me too).

I have 1 hard disk (320GB). I had Win XP on the first partition and Win 7 on the second. I formatted the first partition and created swap, main and home partitions for Ubuntu.

I've read multiple threads and tried to fix it, but failed miserably.

I used


sudo update-grub

I've edited the 40_custom file (and updated afterwards) writing this


menuentry ‘Windows 7′ {
set root=’(hd0,5)’
chainloader +1
}Please, any help would be appreciated.

I've used the boot info script and it produced the following:



Boot Info Script 0.60 from 17 May 2011


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

=> Grub2 (v1.99) 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
for (,msdos7)/boot/grub on this drive.

sda2: __________________________________________________ ________________________

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

sda5: __________________________________________________ ________________________

File system: ntfs
Boot sector type: Windows XP
Boot sector info: According to the info in the boot sector, sda5 starts
at sector 63.
Operating System: Windows 7
Boot files: /Windows/System32/winload.exe

sda6: __________________________________________________ ________________________

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

sda7: __________________________________________________ ________________________

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

sda8: __________________________________________________ ________________________

File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files:

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

Drive: sda __________________________________________________ ___________________

Disk /dev/sda: 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/sda2 2,046 625,121,279 625,119,234 f W95 Extended (LBA)
/dev/sda5 311,291,568 625,121,279 313,829,712 7 NTFS / exFAT / HPFS
/dev/sda6 2,048 3,999,743 3,997,696 82 Linux swap / Solaris
/dev/sda7 4,001,792 302,827,519 298,825,728 83 Linux
/dev/sda8 302,829,568 311,289,855 8,460,288 83 Linux


"blkid" output: __________________________________________________ ______________

Device UUID TYPE LABEL

/dev/sda5 548C7D938C7D6FFA ntfs
/dev/sda6 3a0d058c-86e9-48c4-bdc5-b7c95af534c9 swap
/dev/sda7 8ab16281-16b2-4427-b8f2-47d483735a96 ext4
/dev/sda8 408d044d-e33a-4407-a848-0267039cfe4a ext4

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

Device Mount_Point Type Options

/dev/sda7 / ext4 (rw,errors=remount-ro,commit=0)
/dev/sda8 /home ext4 (rw,commit=0)


=========================== sda7/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 video_bochs
insmod video_cirrus
}

insmod part_msdos
insmod ext2
set root='(/dev/sda,msdos7)'
search --no-floppy --fs-uuid --set=root 8ab16281-16b2-4427-b8f2-47d483735a96
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=auto
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(/dev/sda,msdos7)'
search --no-floppy --fs-uuid --set=root 8ab16281-16b2-4427-b8f2-47d483735a96
set locale_dir=($root)/boot/grub/locale
set lang=en_US
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
if background_color 44,0,30; then
clear
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
if [ ${recordfail} != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
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
if [ "$linux_gfx_mode" != "text" ]; then load_video; fi
menuentry 'Ubuntu, with Linux 2.6.38-8-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod part_msdos
insmod ext2
set root='(/dev/sda,msdos7)'
search --no-floppy --fs-uuid --set=root 8ab16281-16b2-4427-b8f2-47d483735a96
linux /boot/vmlinuz-2.6.38-8-generic root=UUID=8ab16281-16b2-4427-b8f2-47d483735a96 ro quiet splash vt.handoff=7
initrd /boot/initrd.img-2.6.38-8-generic
}
menuentry 'Ubuntu, with Linux 2.6.38-8-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod part_msdos
insmod ext2
set root='(/dev/sda,msdos7)'
search --no-floppy --fs-uuid --set=root 8ab16281-16b2-4427-b8f2-47d483735a96
echo 'Loading Linux 2.6.38-8-generic ...'
linux /boot/vmlinuz-2.6.38-8-generic root=UUID=8ab16281-16b2-4427-b8f2-47d483735a96 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.38-8-generic
}
### END /etc/grub.d/10_linux ###

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

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod part_msdos
insmod ext2
set root='(/dev/sda,msdos7)'
search --no-floppy --fs-uuid --set=root 8ab16281-16b2-4427-b8f2-47d483735a96
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
set root='(/dev/sda,msdos7)'
search --no-floppy --fs-uuid --set=root 8ab16281-16b2-4427-b8f2-47d483735a96
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
if [ "x${timeout}" != "x-1" ]; then
if keystatus; then
if keystatus --shift; then
set timeout=-1
else
set timeout=0
fi
else
if sleep --interruptible 3 ; then
set timeout=0
fi
fi
fi
### 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 ###

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

=============================== sda7/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/sda7 during installation
UUID=8ab16281-16b2-4427-b8f2-47d483735a96 / ext4 errors=remount-ro 0 1
# /home was on /dev/sda8 during installation
UUID=408d044d-e33a-4407-a848-0267039cfe4a /home ext4 defaults 0 2
# swap was on /dev/sda6 during installation
UUID=3a0d058c-86e9-48c4-bdc5-b7c95af534c9 none swap sw 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
--------------------------------------------------------------------------------

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

GiB - GB File Fragment(s)

14.042236328 = 15.077736448 boot/grub/core.img 1
62.241790771 = 66.831613952 boot/grub/grub.cfg 1
3.041240692 = 3.265507328 boot/initrd.img-2.6.38-8-generic 2
14.040508270 = 15.075880960 boot/vmlinuz-2.6.38-8-generic 1
3.041240692 = 3.265507328 initrd.img 2
14.040508270 = 15.075880960 vmlinuz 1

======================== Unknown MBRs/Boot Sectors/etc: ========================

Unknown BootLoader on sda2

00000000 f1 3f 8a fc 55 e2 24 3a ad eb 5c 23 e0 43 2c 71 |.?..U.$:..\#.C,q|
00000010 61 41 52 01 40 98 e0 0c 8c 12 72 79 c9 e3 9f 63 |aAR.@.....ry...c|
00000020 f0 ff 00 c0 5f 0f f8 da da 25 d7 63 b7 05 a3 68 |...._....%.c...h|
00000030 65 31 80 ed 86 52 0a 9c 60 67 07 92 00 c1 f7 ad |e1...R..`g......|
00000040 1e 22 9d 34 a3 51 5c e6 50 fa db bd 3f 75 93 f8 |.".4.Q\.P...?u..|
00000050 6f f6 ee f0 df 88 52 2d 3a 6d 56 de 59 08 22 37 |o.....R-:mV.Y."7|
00000060 47 0a 83 18 38 62 d8 00 a8 ce 78 f9 8e 07 a5 54 |G...8b....x....T|
00000070 f1 07 c5 b8 b5 8b f8 af 52 48 94 ae d5 62 b6 c2 |........RH...b..|
00000080 39 01 e4 82 73 ea 07 4c 63 81 e9 5a c3 f6 0d f0 |9...s..Lc..Z....|
00000090 6e 9b 66 6f bc 3f 16 25 68 b0 b1 5b c7 be 13 2b |n.fo.?.%h..[...+|
000000a0 01 b8 32 92 41 da a0 60 b7 e3 5e 2d f1 bf e1 3f |..2.A..`..^-...?|
000000b0 8b 3e 11 c0 a9 a5 c1 1c 91 ac 8e 51 3c b6 e8 5b |.>.........Q<..[|
000000c0 20 03 9c 6c da 0e 33 92 73 d3 8a df 0a b0 f5 9f | ..l..3.s.......|
000000d0 2c 74 bf 73 93 11 5b 17 87 8d aa 6a 8f ac 3e 11 |,t.s..[....j..>.|
000000e0 f8 96 c3 5d b4 8a 1b 39 e2 54 24 b8 67 61 19 ce |...]...9.T$.ga..|
000000f0 38 08 bc e4 1e 38 eb d6 ae 7c 42 f0 83 ea 36 12 |8....8...|B...6.|
00000100 b2 14 32 31 06 3b 70 8b 85 20 12 64 e7 81 8c 75 |..21.;p.. .d...u|
00000110 1d 47 6e 2b e5 6f d9 1f f6 8b d3 b4 df 11 ad be |.Gn+.o..........|
00000120 bb 74 f1 47 24 4a f2 dd b8 91 04 43 19 c0 1c b6 |.t.G$J.....C....|
00000130 41 c0 e3 af 03 8e 45 7d c3 a6 5e 69 1a d6 9d 14 |A.....E}..^i....|
00000140 90 88 e3 68 d3 2c c0 a6 5f 1d 48 03 a7 f4 a1 51 |...h.,.._.H....Q|
00000150 9d 1a 8e 9c be 46 f4 2b 52 c5 53 e6 4f 63 c2 ec |.....F.+R.S.Oc..|
00000160 7e 05 6b 50 4b 2d e5 89 96 12 15 43 99 24 04 39 |~.kPK-.....C.$.9|
00000170 65 c6 0b 1f 97 18 23 1d 3b 56 07 8b 6f f5 df 85 |e.....#.;V..o...|
00000180 d3 4c f3 dc cd 25 bc 39 48 56 68 f6 fd 9a 42 bc |.L...%.9HVh...B.|
00000190 c6 b8 e3 19 cf cb c9 ce 7a 66 be 9d b1 9a ce da |........zf......|
000001a0 40 ef 68 cb b7 20 06 50 d9 5c 0c 8d bd 3a 7b 71 |@.h.. .P.\...:{q|
000001b0 5c 5f c6 5f 07 69 3e 25 b0 95 6d f4 bd f8 00 01 |\_._.i>%..m.....|
000001c0 c1 ff 07 fe ff ff b2 e6 8d 12 50 a9 b4 12 00 20 |..........P.... |
000001d0 20 00 05 f7 3f f8 01 00 00 00 01 00 3d 00 00 00 | ...?.......=...|
000001e0 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


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

unlzma: Decoder error

ahivarn
June 18th, 2011, 06:46 AM
I faced the same problem.. I did sudo update-grub and it got fixed.. Maybe you need to remove the menu entry you added. These days the entries are not hda but sda.. maybe try it again..

Rubi1200
June 18th, 2011, 06:52 AM
Hi and welcome to the forums badhabits :-)

Try this in the terminal and see if it picks up the Windows install:


sudo os-prober

If it reports the package is not installed, then do so:


sudo apt-get install os-prober

Then run the first command again as well as the update-grub command.

Let us know if this helps.

badhabits
June 18th, 2011, 06:59 AM
Hello Rubi1200, hello ahivarn :p

sudo os-prober returned nothing.

Rubi1200
June 18th, 2011, 07:17 AM
I think I see the problem; you have Windows in an extended partition, which would be theoretically fine except that you may have deleted a partition with essential boot files?

Also the boot flag that Windows needs is not set on sda5.

Was the Windows 7 install an upgrade?

If yes, and you deleted sda1 where XP was you may have also deleted those Windows boot files.

I do not believe that restoring the Windows boot loader will work in this situation since it requires a primary partition for this.

I am not a Windows user, so I suggest you wait for others to comment and it may be worth asking on a Windows forum such as this one which I have heard good things about:
http://www.sevenforums.com/

badhabits
June 18th, 2011, 07:23 AM
Oh, yes, it seems that's the situation. Thank you very much! I think i'll have to do some formatting again, but it's ok :D