PDA

View Full Version : [SOLVED] Grub doesn't appear and so can't use my other O.S.



satya10123
May 20th, 2012, 07:40 AM
Hi everyone, I'll keep it short and to the point.

What I had initially:



120 GB hardisk divided into 3 partitions.
1st partition (22.2GB) with XP, second partition (30GB) with win 7 and rest (60 GB) as mass memory for storage.

What I did:



Installed Ubuntu 12.04 LTS desktop 32 bit with USB on the partition which had XP.
For that I had to format it and convert to ext4 and also create a swap memory of ~3GB.
Thus I finally have 1 partition with ubuntu another with win 7 and another with mass memory.

Now, Problem:

I don't see a grub during booting from the first boot itself. And hence I can't login to win 7 now. I see the two partions from ubuntu intact. But when I reboot to enter win7 I get nothing and goes straight to ubuntu.

I tried holding 'Shift' key during booting and I could just see a line stating 'Grub Loading' for a flash of second and then directs to ubuntu loading page.

I have run the bootinfo script and it looks something like this:


Boot Info Script 0.61 [1 April 2012]


============================= 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 (,msdos1)/boot/grub on this drive.

sda1: __________________________________________________ ________________________

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

sda2: __________________________________________________ ________________________

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

sda3: __________________________________________________ ________________________

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

sda5: __________________________________________________ ________________________

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

sda6: __________________________________________________ ________________________

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

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

Drive: sda __________________________________________________ ___________________

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 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 * 63 40,000,062 40,000,000 83 Linux
/dev/sda2 172,281,060 234,436,544 62,155,485 7 NTFS / exFAT / HPFS
/dev/sda3 40,001,534 172,281,059 132,279,526 f W95 Extended (LBA)
/dev/sda5 46,652,823 172,281,059 125,628,237 7 NTFS / exFAT / HPFS
/dev/sda6 40,001,536 46,651,391 6,649,856 82 Linux swap / Solaris


"blkid" output: __________________________________________________ ______________

Device UUID TYPE LABEL

/dev/sda1 05b0f1f6-da48-437b-b0e9-2b4dec099f94 ext4
/dev/sda2 2CEC8990EC89554C ntfs
/dev/sda5 8CD84B66D84B4DA0 ntfs Mass Memory
/dev/sda6 14f91072-9704-4c85-bab0-628396be812d swap

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

Device Mount_Point Type Options

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


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

insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 05b0f1f6-da48-437b-b0e9-2b4dec099f94
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=auto
load_video
insmod gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 05b0f1f6-da48-437b-b0e9-2b4dec099f94
set locale_dir=($root)/boot/grub/locale
set lang=en_IN
insmod gettext
fi
terminal_output gfxterm
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 ###
function gfxmode {
set gfxpayload="$1"
if [ "$1" = "keep" ]; then
set vt_handoff=vt.handoff=7
else
set vt_handoff=
fi
}
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 3.2.0-23-generic-pae' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 05b0f1f6-da48-437b-b0e9-2b4dec099f94
linux /boot/vmlinuz-3.2.0-23-generic-pae root=UUID=05b0f1f6-da48-437b-b0e9-2b4dec099f94 ro quiet splash i8042.reset $vt_handoff
initrd /boot/initrd.img-3.2.0-23-generic-pae
}
menuentry 'Ubuntu, with Linux 3.2.0-23-generic-pae (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 05b0f1f6-da48-437b-b0e9-2b4dec099f94
echo 'Loading Linux 3.2.0-23-generic-pae ...'
linux /boot/vmlinuz-3.2.0-23-generic-pae root=UUID=05b0f1f6-da48-437b-b0e9-2b4dec099f94 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.2.0-23-generic-pae
}
### 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=root 05b0f1f6-da48-437b-b0e9-2b4dec099f94
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=root 05b0f1f6-da48-437b-b0e9-2b4dec099f94
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' 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=05b0f1f6-da48-437b-b0e9-2b4dec099f94 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda6 during installation
UUID=14f91072-9704-4c85-bab0-628396be812d none swap sw 0 0
--------------------------------------------------------------------------------

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

GiB - GB File Fragment(s)

= boot/grub/core.img 1
= boot/grub/grub.cfg 1
= boot/initrd.img-3.2.0-23-generic-pae 2
= boot/vmlinuz-3.2.0-23-generic-pae 1
= initrd.img 2
= vmlinuz 1

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

Unknown BootLoader on sda3

00000000 99 5b 1a e4 4e 7b fa 17 8b 71 50 45 7b d5 e4 a9 |.[..N{...qPE{...|
00000010 c9 75 e1 90 af 4e 5c b5 5e f9 09 4a b1 a2 06 7a |.u...N\.^..J...z|
00000020 1c 37 2b 89 ca b6 e6 43 8f 2c c0 7c a6 f0 f8 22 |.7+....C.,.|..."|
00000030 b3 fb b0 81 2c 15 4a 81 58 d1 19 2d a0 25 18 65 |....,.J.X..-.%.e|
00000040 3a a4 80 ec 94 36 c7 56 8e 98 33 0d de 81 e4 a2 |:....6.V..3.....|
00000050 7e 0e 05 62 80 c8 72 55 42 61 d5 a9 b2 6c 5d ac |~..b..rUBa...l].|
00000060 54 fd be 2d 3d b6 2f 5e b8 78 56 ae ae f7 91 49 |T..-=./^.xV....I|
00000070 ab 14 bb 23 21 57 37 f9 02 ce aa f0 22 05 ab e3 |...#!W7....."...|
00000080 db e1 19 c7 76 27 f9 3b 36 43 9c 90 99 03 53 4f |....v'.;6C....SO|
00000090 4c 5b 81 4f 88 2e 8a e1 10 70 3a 0d b9 4f e1 02 |L[.O.....p:..O..|
000000a0 57 05 25 07 f0 40 7a df c0 6d ca 6b 8e 6d 35 47 |W.%..@z..m.k.m5G|
000000b0 b9 35 27 db 95 f7 08 3f d8 2c e9 69 10 de ec 81 |.5'....?.,.i....|
000000c0 63 20 d0 a1 ca 18 d7 bc ff 9b 86 ab 8d 8a 8f 8d |c ..............|
000000d0 63 2b 5c e2 b3 60 22 83 a0 d9 92 07 49 5d b3 a0 |c+\..`".....I]..|
000000e0 e3 a6 f8 8c 96 5d fc 08 e7 be 07 4e e9 64 f9 bc |.....].....N.d..|
000000f0 d9 a3 28 22 d1 c9 30 21 05 ef af 66 cc 2e 0a 41 |..("..0!...f...A|
00000100 e2 53 da aa db 63 7e 89 2a 75 70 5b 38 cf 11 f7 |.S...c~.*up[8...|
00000110 a9 71 89 1d c4 d4 c5 05 07 83 dc ec ad 6f cd 7e |.q...........o.~|
00000120 54 c1 7b 2c 0b 6c 34 2a 1d 5c 04 d4 a8 04 6c c9 |T.{,.l4*.\....l.|
00000130 44 40 e9 6e 81 20 f7 c1 b7 13 cb 35 39 33 b1 5a |D@.n. .....593.Z|
00000140 c7 2a d6 e0 19 91 e9 0e 9e 48 11 94 33 c2 c6 b4 |.*.......H..3...|
00000150 e5 c3 d1 32 47 e2 30 c7 7a 87 44 19 2d b8 af 85 |...2G.0.z.D.-...|
00000160 b8 e6 da 2f 26 12 85 aa c6 8d b6 f0 b6 5f 3f c2 |.../&........_?.|
00000170 7d 60 86 92 ff 15 38 b8 71 21 6d 5c d7 25 e5 65 |}`....8.q!m\.%.e|
00000180 ab 2e 9c ad 0d ea 2d 35 f1 df d4 95 cb ab 8d d3 |......-5........|
00000190 30 25 35 dc c6 19 64 6f 4b 1e 5e 5c 3c d2 58 3c |0%5...doK.^\<.X<|
000001a0 dc 58 5a 92 8b 47 5a 8b 2f 36 16 8f 2f 2e 82 b0 |.XZ..GZ./6../...|
000001b0 71 55 0f 8c db 4c b7 d4 58 3a 2a 97 9e 6f 00 fe |qU...L..X:*..o..|
000001c0 ff ff 07 fe ff ff 99 7d 65 00 4d ef 7c 07 00 fe |.......}e.M.|...|
000001d0 ff ff 05 fe ff ff 01 00 00 00 01 78 65 00 00 00 |...........xe...|
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: ===============================

xz: (stdin): Compressed data is corrupt
awk: cmd. line:36: Math support is not compiled in
awk: cmd. line:36: Math support is not compiled in
awk: cmd. line:36: Math support is not compiled in
awk: cmd. line:36: Math support is not compiled in
awk: cmd. line:36: Math support is not compiled in
awk: cmd. line:36: Math support is not compiled in


Please help.

wilee-nilee
May 20th, 2012, 08:18 AM
You are missing these files in windows.
/bootmgr /Boot/BCD

You also need to put a boot flag on the partition sda2 from gparted in Ubuntu, before starting this repair, gparted may need a install. Open gparted right click sda2 then flags then click boot. You then need to boot a W7 recovery or install disc and navigate to the recovery terminal, here are the commands to be run once there at the recovery terminal. The link below the commands shows the path to this recovery terminal.

BootRec.exe /fixmbr
BootRec.exe /FixBoot
BootRec.exe /ScanOs
BootRec.exe /RebuildBcd
http://www.sevenforums.com/tutorials/20864-mbr-restore-windows-7-master-boot-record.html

So do this and reboot and windows should boot straight in, if it wants to run a disc check let it, once you have that done we can reload grub to the mbr and you should have the dual boot in the grub menu.

So to reinstall grub 2 in the mbr after you have windows all fixed run these commands from a ubuntu live cd.


sudo mount /dev/sda1 /mnt

for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt$i; done

sudo chroot /mnt

grub-install /dev/sda

grub-install --recheck /dev/sda

update-grub

Exit chroot: CTRL-D on keyboard

sudo reboot

You should be at the grub menu on reboot with W7 and ubuntu showing.

satya10123
May 22nd, 2012, 02:45 PM
Thanks.. finally its resolved with your help. Actually MBR couldn't be repaired with recovery CD and hence had to re-install win 7. However I was lucky to get a backup before that :D