PDA

View Full Version : [ubuntu] No Grub screen when I start my computer



calande
February 16th, 2012, 12:16 AM
Hello,

I have Ubuntu Oneiric and Windows 7 on this SSD. I installed Grub2 during installation but it doesn't show up when I start my computer. os-prober doesn't return anything. No OS is listed in /etc/default/grub or in /etc/grub.d/40_custom so I added this into /etc/grub.d/40_custom:


menuentry "Windows" {
set root=(hd0,3)
chainloader +1
}

And ran update-grub but this returned only Ubuntu and memtest.

The SSD layout is:

sda1 - Windows recovery files
sda2 - Ubuntu
sda3 - swap space
sda4 - Windows 7

When I browse my Windows 7 partition with Nautilus, I can see my files, but the partition isn't detected by Grub. Any idea?
Thanks,

darkod
February 16th, 2012, 12:20 AM
Run the boot info script from my signature and post the results as explained there.

Win7 sometimes has the boot files on separate partition. These boot files are detected by grub2, it then makes the entry in the boot menu, and when you select win7 these boot files continue to boot it.
If you deleted this partition grub2 will not create entry for win7, and can't boot it. The script will show more info including whether the boot files are there.

calande
February 16th, 2012, 06:53 AM
Thank you Darko. Here you go:


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 ?? on this drive.

sda1: __________________________________________________ ________________________

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

sda2: __________________________________________________ ________________________

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

sda3: __________________________________________________ ________________________

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

sda4: __________________________________________________ ________________________

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

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

Drive: sda __________________________________________________ ___________________

Disk /dev/sda: 64.0 GB, 64023257088 bytes
255 têtes, 63 secteurs/piste, 7783 cylindres, total 125045424 secteurs
Unités = secteurs de 1 * 512 = 512 octets
Taille de secteur (logique / physique)*: 512*octets / 512*octets

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 51,406,847 51,200,000 83 Linux
/dev/sda3 51,406,848 53,503,999 2,097,152 82 Linux swap / Solaris
/dev/sda4 53,504,000 125,042,687 71,538,688 7 NTFS / exFAT / HPFS


"blkid" output: __________________________________________________ ______________

Device UUID TYPE LABEL

/dev/sda1 60346858346832E8 ntfs Réservé au système
/dev/sda2 aea95c66-0424-4b1a-8242-6cce7dae5445 ext4
/dev/sda3 5a7a517a-88b7-43ef-87a7-ebf4b8aadeeb swap
/dev/sda4 BCF4BBFDF4BBB84A ntfs

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

Device Mount_Point Type Options

/dev/sda2 / ext4 (rw,errors=remount-ro,commit=0)
/dev/sda4 /home/charles/windows fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_ permissions)


=========================== sda2/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,msdos2)'
search --no-floppy --fs-uuid --set=root aea95c66-0424-4b1a-8242-6cce7dae5445
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=auto
load_video
insmod gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos2)'
search --no-floppy --fs-uuid --set=root aea95c66-0424-4b1a-8242-6cce7dae5445
set locale_dir=($root)/boot/grub/locale
set lang=fr_FR
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 ###
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, avec Linux 3.0.0-12-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos2)'
search --no-floppy --fs-uuid --set=root aea95c66-0424-4b1a-8242-6cce7dae5445
linux /boot/vmlinuz-3.0.0-12-generic root=UUID=aea95c66-0424-4b1a-8242-6cce7dae5445 ro splash splash quiet vt.handoff=7
initrd /boot/initrd.img-3.0.0-12-generic
}
menuentry 'Ubuntu, avec Linux 3.0.0-12-generic (mode de dépannage)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos2)'
search --no-floppy --fs-uuid --set=root aea95c66-0424-4b1a-8242-6cce7dae5445
echo 'Chargement de Linux 3.0.0-12-generic ...'
linux /boot/vmlinuz-3.0.0-12-generic root=UUID=aea95c66-0424-4b1a-8242-6cce7dae5445 ro recovery nomodeset splash
echo 'Chargement du disque mémoire initial ...'
initrd /boot/initrd.img-3.0.0-12-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,msdos2)'
search --no-floppy --fs-uuid --set=root aea95c66-0424-4b1a-8242-6cce7dae5445
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos2)'
search --no-floppy --fs-uuid --set=root aea95c66-0424-4b1a-8242-6cce7dae5445
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.

menuentry "Windows" {
set root=(hd0,3)
chainloader +1
}

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

=============================== sda2/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/sda2 during installation
UUID=aea95c66-0424-4b1a-8242-6cce7dae5445 / ext4 errors=remount-ro 0 1
# /home/charles/windows was on /dev/sda4 during installation
UUID=BCF4BBFDF4BBB84A /home/charles/windows ntfs defaults,nls=utf8,umask=007,gid=46 0 0
# swap was on /dev/sda3 during installation
UUID=5a7a517a-88b7-43ef-87a7-ebf4b8aadeeb none swap sw 0 0
--------------------------------------------------------------------------------

=================== sda2: 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.0.0-12-generic 1
= boot/vmlinuz-3.0.0-12-generic 1
= initrd.img 1
= vmlinuz 1

=============================== 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
awk: cmd. line:36: Math support is not compiled in


Did you point out the problem? ;)

darkod
February 16th, 2012, 04:49 PM
Have you tried in ubuntu running:
sudo update-grub

EDIT: I just saw in your first post that you already tried that. The results look fine, the boot files are on /dev/sda1. I don't know why update-grub is not finding win7. As for your manual entry in 40_custom, the partition is not number 3, it's number 1, so it should be like:
set root=(hd0,1)

Also you can try adding makeactive after set root.

oldfred
February 16th, 2012, 06:23 PM
Windows NTFS boot sectors also have internally info on whether to boot with ntldr (XP) or bootmgr(Vista/7). Yours does not seem to have Operating System listed like this one from another boot script:


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


Perhaps using a Windows repairCD or USB you can run the fixBoot command which updates the PBR. You also may need to run chkdsk, as it also does some updates to PBR.

calande
February 16th, 2012, 06:45 PM
Thanks. I changed to root=(hd0,1), I added makeactive, and I ran the update-grub script. I rebooted but I don't see any Grub screen. Ubuntu starts right away. It should at least display Ubuntu and memtest, no?

oldfred
February 16th, 2012, 07:19 PM
If there is only one system found, it boots directly to the one system. You have to hold shift key from BIOS until menu appears to get a menu if you only have one system. It still has not found Windows.

calande
February 16th, 2012, 07:22 PM
What is weird is that Windows is a fresh install. Yesterday I installed Windows, rebooted into the Ubuntu USB key and installed Ubuntu on the other partition. What could I do?

darkod
February 16th, 2012, 08:07 PM
Did you resize the win7 partition with the ubuntu installer or you left unpartitioned space for ubuntu and installed it there?

calande
February 16th, 2012, 08:09 PM
I had free space for Ubuntu. I didn't resize the Windows 7 partition. Thanks.

darkod
February 16th, 2012, 08:25 PM
I was wondering if resizing win7 might have corrupted it. But since it's not the case, I'm running out of ideas.

Even though everything looks fine, you can try this:
Get your win7 dvd and do the Repair process, so that it installs the windows bootloader on the MBR again and starts booting windows directly.
Once you confirm win7 is booting fine, use the ubuntu cd to reinstall grub2 to the MBR. Boot ubuntu and run the update-grub again to see if it maybe detects win7 this time.

calande
February 16th, 2012, 09:09 PM
I rebooted using the Windows 7 USB flash key, I selected the "Repair" option, I selected the Windows partition and selected the option to fix any issues preventing Windows from booting. When done, I rebooted but my computer launched Ubuntu :(
I really don't know what is going on...Thanks.

darkod
February 16th, 2012, 09:22 PM
Windows often needs two or three times to do all the repairs even though it will not show any errors. Run it few more times.

calande
February 16th, 2012, 09:39 PM
Now I found out how to display the Grub menu with Windows listed! I have to hold down the Shift key during bios initialization. But I don't want to have to do it all the time. I power on my computer, I go away for a minute and when I come back, I want to have it ready. I tried to edit /etc/default/grub and I changed:
GRUB_HIDDEN_TIMEOUT=5
GRUB_HIDDEN_TIMEOUT_QUIET=false
GRUB_TIMEOUT=5
I ran sudo update-grub, but this still doesn't toggle the grub menu at bootup :(
Thanks,

calande
March 4th, 2012, 06:45 PM
Any idea?

darkod
March 4th, 2012, 07:07 PM
Boot again with the win7 usb stick and try to repair the boot process with the procedure explained here:
http://ubuntuforums.org/showthread.php?t=1014708

Do it with the command line, not the auto method.

See if that can make win7 boot on its own. After you manage the computer to boot win7 directly, you can reinstall grub2 to the MBR using the ubuntu cd as explained in the same link.