PDA

View Full Version : [ubuntu] Grub and windows 7



Skrip
March 30th, 2011, 09:22 PM
Hello Here is the result of the boot info script...
What can i do to add windows 7 in the grub menu of ubuntu :/
i tried update grub .. nothing
sudo grub command dont work ..
:S Any ideas ?


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 #1 for (,msdos1)/boot/grub.

sda1: __________________________________________________ _______________________

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

sda2: __________________________________________________ _______________________

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

sda5: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: According to the info in the boot sector, sda5 starts
at sector 1. But according to the info from fdisk,
sda5 starts at sector 95715333.
Operating System:
Boot files/dirs:

sda6: __________________________________________________ _______________________

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

sda3: __________________________________________________ _______________________

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: /Windows/System32/winload.exe

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

Drive: sda ___________________ __________________________________________________ ___

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 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 * 63 78,140,159 78,140,097 83 Linux
/dev/sda2 78,140,284 214,925,311 136,785,028 5 Extended
/dev/sda5 95,715,333 214,925,311 119,209,979 7 HPFS/NTFS
/dev/sda6 78,140,286 95,715,269 17,574,984 82 Linux swap / Solaris
/dev/sda3 214,933,635 312,576,704 97,643,070 7 HPFS/NTFS


blkid -c /dev/null: __________________________________________________ __________

Device UUID TYPE LABEL

/dev/sda1 ebd837aa-6e14-4867-bae4-61edf865d81f ext4
/dev/sda2: PTTYPE="dos"
/dev/sda3 289C84449C840E8E ntfs
/dev/sda5 F818726E18722BAE ntfs All My Data
/dev/sda6 a0c01e92-cf09-41a4-a7c0-bc11c9d43814 swap
/dev/sda: PTTYPE="dos"

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

Device Mount_Point Type Options

/dev/sda1 / ext4 (rw,errors=remount-ro,commit=0)
/dev/sda5 /media/All My Data fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_ permissions)


=========================== 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 ebd837aa-6e14-4867-bae4-61edf865d81f
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 ebd837aa-6e14-4867-bae4-61edf865d81f
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.35-28-generic' --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 ebd837aa-6e14-4867-bae4-61edf865d81f
linux /boot/vmlinuz-2.6.35-28-generic root=UUID=ebd837aa-6e14-4867-bae4-61edf865d81f ro quiet splash
initrd /boot/initrd.img-2.6.35-28-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-28-generic (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 ebd837aa-6e14-4867-bae4-61edf865d81f
echo 'Loading Linux 2.6.35-28-generic ...'
linux /boot/vmlinuz-2.6.35-28-generic root=UUID=ebd837aa-6e14-4867-bae4-61edf865d81f ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-28-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-22-generic' --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 ebd837aa-6e14-4867-bae4-61edf865d81f
linux /boot/vmlinuz-2.6.35-22-generic root=UUID=ebd837aa-6e14-4867-bae4-61edf865d81f ro quiet splash
initrd /boot/initrd.img-2.6.35-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-22-generic (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 ebd837aa-6e14-4867-bae4-61edf865d81f
echo 'Loading Linux 2.6.35-22-generic ...'
linux /boot/vmlinuz-2.6.35-22-generic root=UUID=ebd837aa-6e14-4867-bae4-61edf865d81f ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-22-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='(hd0,msdos1)'
search --no-floppy --fs-uuid --set ebd837aa-6e14-4867-bae4-61edf865d81f
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 ebd837aa-6e14-4867-bae4-61edf865d81f
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 ###

=============================== 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=ebd837aa-6e14-4867-bae4-61edf865d81f / ext4 errors=remount-ro 0 1
# swap was on /dev/sda6 during installation
UUID=a0c01e92-cf09-41a4-a7c0-bc11c9d43814 none swap sw 0 0

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


21.6GB: boot/grub/core.img
24.5GB: boot/grub/grub.cfg
1.4GB: boot/initrd.img-2.6.35-22-generic
26.8GB: boot/initrd.img-2.6.35-28-generic
21.6GB: boot/vmlinuz-2.6.35-22-generic
21.7GB: boot/vmlinuz-2.6.35-28-generic
26.8GB: initrd.img
1.4GB: initrd.img.old
21.7GB: vmlinuz
21.6GB: vmlinuz.old
=========================== Unknown MBRs/Boot Sectors/etc =======================

Unknown BootLoader on sda2

00000000 7d 23 c2 0d 46 e8 56 bd 93 86 00 00 c1 5b 14 00 |}#..F.V......[..|
00000010 13 70 f6 0d 74 10 8d 18 c9 d5 00 00 6b 6b 14 00 |.p..t.......kk..|
00000020 eb c9 4c 18 da 84 53 45 89 79 02 00 d9 8b 1c 00 |..L...SE.y......|
00000030 a4 31 2e 32 c1 b4 eb 88 a4 ab 02 00 f2 ec 17 00 |.1.2............|
00000040 dd df 4d 66 a3 a3 1e 31 9d 11 21 00 84 1c 1d 00 |..Mf...1..!.....|
00000050 4c 71 4c 68 c4 b5 7c 31 3c b1 10 00 14 7d 19 00 |LqLh..|1<....}..|
00000060 08 61 ac 7e 8b 63 e8 50 88 b7 00 00 ab e1 19 00 |.a.~.c.P........|
00000070 40 93 e8 9a 0a b2 59 07 84 a1 00 00 34 03 05 00 |@.....Y.....4...|
00000080 05 06 d2 a7 a9 69 35 f2 f2 09 09 00 87 48 1d 00 |.....i5......H..|
00000090 ec f3 1b ef 5e 0b 8f d8 fc b4 27 00 16 0f 09 80 |....^.....'.....|
000000a0 f0 b4 09 00 15 f8 4a 2a d0 1c 04 00 8a 18 0e 00 |......J*........|
000000b0 73 a5 29 00 50 a3 c9 cc 77 0d 00 00 2f 4e 0e 00 |s.).P...w.../N..|
000000c0 d0 19 e0 00 7f b3 c3 68 18 b1 05 00 81 0f 0f 00 |.......h........|
000000d0 58 93 5a 01 fc 41 d1 94 2f 3a 00 00 20 5f 0f 00 |X.Z..A../:.. _..|
000000e0 b8 75 d0 01 b5 92 3b d8 44 dc 01 00 0b a3 0f 00 |.u....;.D.......|
000000f0 9a d9 57 02 0a 36 8f 07 e0 73 00 00 db 8a 09 00 |..W..6...s......|
00000100 ac 3f 17 08 ab 17 f1 70 94 9f 02 00 94 b5 12 00 |.?.....p........|
00000110 22 6f f1 0b e4 f6 f1 4e fe cc 00 00 68 f2 13 00 |"o.....N....h...|
00000120 22 6f f1 0b 25 9a 4c 5e fe cc 00 00 69 f2 13 00 |"o..%.L^....i...|
00000130 22 6f f1 0b d7 cb 1d 92 fe cc 00 00 6a f2 13 00 |"o..........j...|
00000140 22 6f f1 0b 45 af 23 96 fe cc 00 00 6b f2 13 00 |"o..E.#.....k...|
00000150 22 6f f1 0b bf f7 af 99 fe cc 00 00 6c f2 13 00 |"o..........l...|
00000160 22 6f f1 0b f0 81 60 ad fe cc 00 00 6d f2 13 00 |"o....`.....m...|
00000170 22 6f f1 0b 29 89 86 c3 fe cc 00 00 6e f2 13 00 |"o..).......n...|
00000180 22 6f f1 0b 3b c9 c5 d0 fe cc 00 00 6f f2 13 00 |"o..;.......o...|
00000190 22 6f f1 0b 47 50 9b e5 fe cc 00 00 70 f2 13 00 |"o..GP......p...|
000001a0 8f 98 6a 0d 4b fb 44 6e c4 3d 0c 00 22 48 1c 00 |..j.K.Dn.=.."H..|
000001b0 74 a0 f7 0f 39 10 c0 14 ac 07 02 00 66 d8 00 fe |t...9.......f...|
000001c0 ff ff 07 fe ff ff 89 2c 0c 01 fb ff 1a 07 00 fe |.......,........|
000001d0 ff ff 05 fe ff ff 01 00 00 00 49 2c 0c 01 00 00 |..........I,....|
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

coffeecat
March 30th, 2011, 09:27 PM
EDIT: Oops - missed something . I'll be back.

wilee-nilee
March 30th, 2011, 09:33 PM
You need to repair your set up your missing W7 boot files. So from gparted right click on the sda3 and move the boot flag there it is on sda1 as per the bootscript. Boot the windows recovery or install disc choose the language then hit r=repair, navigate to the command line terminal and run these two commands
bootrec.exe /fixmbr
then
bootrec.exe. /fixboot

reboot straight to W7 then if it is not working try the autorepair from the W7 bootable you used, may need to be run as many as 3 times.

If this gets W7 back in order follow this link for reloading grub2 to the mbr.
https://help.ubuntu.com/community/Grub2#Reinstalling%20GRUB%202

Just for reference the boot line in your sda3 should look like this, the highlight is what is missing.
Boot files/dirs: /bootmgr /Boot/BCD /Windows/System32/winload.exe

On windows installs these missing files can be on as many as 3 partitions, the C, the recovery and the firmware partitions, you must have removed one of them.

Here is a dowloadable W7 recovery ISO.
http://neosmart.net/blog/2009/windows-7-system-repair-discs/

coffeecat
March 30th, 2011, 09:37 PM
Your sda3 partition would appear to be your Windows 7 C: partition, but it is missing boot files, specifically /bootmgr and /Boot/BCD. This is why grub is not detecting it. You also have a NTFS logical partition at sda5. Is this a data partition? Also, sda5 seems to think its boot sector starts at sector 1, which is very odd. Nothing that I can think of should start at sector 1, apart from grub code, but that's another matter.

Did you have a Windows XP installation on partition #1 before you installed Ubuntu by any chance?

And - do you have a Windows 7 repair CD? A Windows repair CD can be prepared from within Windows 7 but since you can't boot it at the moment you won't be able to.

Skrip
April 7th, 2011, 08:30 PM
Well what i had was ... 1st i installed Windows Xp ... then installed Windows 7 was all ok ... but after i bored of windows xp and managed to delete windows xp partition completly... and after deleting it it was not booting in windows 7 , so i installed ubuntu 10.10 to try to boot in windows 7 with the grub .. so now what i have is that ubuntu is booting normally without showing the grub menu at startup ... :(