PDA

View Full Version : [SOLVED] No grub after installing 12.04... Direct Windows 7



Races1986
May 14th, 2012, 04:00 PM
Hi Everyone,

Thank you very much for any help in advance. My system boots directly to windows instead of the grub.
I have run the bootinfoscript, please let me know how I can solve this problem.

Thanks


Boot Info Script 0.61 [1 April 2012]


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

=> Windows is installed in the MBR of /dev/sda.

sda1: __________________________________________________ ________________________

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

sda2: __________________________________________________ ________________________

File system: ntfs
Boot sector type: Windows Vista/7: 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: -
Boot sector info:

sda5: __________________________________________________ ________________________

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

sda6: __________________________________________________ ________________________

File system:
Boot sector type: -
Boot sector info:
Mounting failed: mount: unknown filesystem type ''

============================ 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 / 4096 bytes

Partition Boot Start Sector End Sector # of Sectors Id System

/dev/sda1 * 2,048 206,847 204,800 7 NTFS / exFAT / HPFS
/dev/sda2 206,848 780,425,150 780,218,303 7 NTFS / exFAT / HPFS
/dev/sda3 780,425,214 1,953,523,711 1,173,098,498 5 Extended
/dev/sda5 780,425,216 1,936,965,631 1,156,540,416 83 Linux
/dev/sda6 1,936,967,680 1,953,523,711 16,556,032 82 Linux swap / Solaris


"blkid" output: __________________________________________________ ______________

Device UUID TYPE LABEL

/dev/loop0 squashfs
/dev/sda1 086007FE6007F0EC ntfs System Reserved
/dev/sda2 16B609DBB609BC6D ntfs
/dev/sda5 66f7ab5c-2fa6-4d73-ae61-9a1806f4043e ext4
/dev/sr0 iso9660 Ubuntu 12.04 LTS amd64

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

Device Mount_Point Type Options

/dev/loop0 /rofs squashfs (ro,noatime)
/dev/sr0 /cdrom iso9660 (ro,noatime)


=========================== sda5/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 efi_gop
insmod efi_uga
insmod video_bochs
insmod video_cirrus
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set=root 66f7ab5c-2fa6-4d73-ae61-9a1806f4043e
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=auto
load_video
insmod gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set=root 66f7ab5c-2fa6-4d73-ae61-9a1806f4043e
set locale_dir=($root)/boot/grub/locale
set lang=en_US
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' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set=root 66f7ab5c-2fa6-4d73-ae61-9a1806f4043e
linux /boot/vmlinuz-3.2.0-23-generic root=UUID=66f7ab5c-2fa6-4d73-ae61-9a1806f4043e ro quiet splash $vt_handoff
initrd /boot/initrd.img-3.2.0-23-generic
}
menuentry 'Ubuntu, with Linux 3.2.0-23-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set=root 66f7ab5c-2fa6-4d73-ae61-9a1806f4043e
echo 'Loading Linux 3.2.0-23-generic ...'
linux /boot/vmlinuz-3.2.0-23-generic root=UUID=66f7ab5c-2fa6-4d73-ae61-9a1806f4043e ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.2.0-23-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,msdos5)'
search --no-floppy --fs-uuid --set=root 66f7ab5c-2fa6-4d73-ae61-9a1806f4043e
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set=root 66f7ab5c-2fa6-4d73-ae61-9a1806f4043e
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)" --class windows --class os {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 086007FE6007F0EC
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 ###

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

=============================== sda5/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/sda5 during installation
UUID=66f7ab5c-2fa6-4d73-ae61-9a1806f4043e / ext4 errors=remount-ro 0 1
# swap was on /dev/sda6 during installation
#UUID=ed2a8e9d-dbaa-4885-aeed-5748c4fc09c3 none swap sw 0 0
/dev/mapper/cryptswap1 none swap sw 0 0
--------------------------------------------------------------------------------

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

GiB - GB File Fragment(s)

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

========= Devices which don't seem to have a corresponding hard drive: =========

sdb sdc sdd sde sdf

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

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

darkod
May 14th, 2012, 04:14 PM
Looks like grub2 didn't install correctly at all. From live mode you will have to enter your root with chroot and install it:

sudo mount /dev/sda5 /mnt
sudo mount --bind /proc /mnt/proc
sudo mount --bind /dev /mnt/dev
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt

Purge and reinstall grub2, make new config files:

apt-get remove --purge grub-pc grub-common
apt-get install grub-pc
grub-mkconfig
update-grub
grub-install /dev/sda

Exit chroot and unmount everything:

exit
sudo umount /mnt/sys
sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt

Restart and see if you get a grub2 menu now.

carl4926
May 14th, 2012, 04:17 PM
Try this

Use the live cd
open gparted and switch the boot flag off sda1 and put it on sda3

carl4926
May 14th, 2012, 04:20 PM
Try this

Use the live cd
open gparted and switch the boot flag off sda1 and put it on sda3
I'm thinking you switched the default bootloader setting on sda MBR to sda5?
Putting the flag on the extended should work
As has been said, grub looks to installed correctly

oldfred
May 14th, 2012, 04:25 PM
The Windows boot loader uses the boot flag, grub does not, so moving boot flag will not fix booting other than preventing Windows from working.

Darko's instructions should get your grub installed correctly.

With a very large drive and a large / (root) partition you may just have another issue. There was (is?) a bug in grub that very large root partitions, grub just seemed to get lost. About half of those I have suggested smaller / (root) partitions and separate /home have solved grub boot issues. I normally suggest / (root) of 25GB and the rest for /home or data partitions. With Windows I also do not suggest writing much into the Window partition, but create another shared NTFS partition to use read/write for both systems. Windows sometimes has issues with too much data written directly into its system or c: partition.

Races1986
May 15th, 2012, 02:01 AM
Hi Everyone,

I followed Darko instruction and it is working now.
I have another problem now. I dont know if I should open another thread.
The problem is that Ubuntu is completely freezing.
I tried to switch desktop with ctr+alt+f1 but it does not even allow me to do that...
The quick solution that I have applied so far is manually powering off the computer but of course this is not an actual solutions.

Does anyone have any idea about what could be happening?

Thanks

oldfred
May 15th, 2012, 04:52 AM
Do not power off without remembering the elephants.

Holding down Alt and SysRq (which is the Print Screen key) while slowly typing REISUB
R-E-I-S-U-B to force shutdown
A good way to remember it is.
Raising Skinny Elephants Is Utterly Boring ...or
Reboot System Even If Ultimately Broken ...LOL.
http://kember.net/articles/reisub-the-gentle-linux-restart/

You may cause grub to not reboot without effort or if writing in the middle you may have to run e2fsck to check file system.

If you open top from terminal is any task using a lot of system?

top

What graphic mode are you in?