PDA

View Full Version : [SOLVED] Grub2 Dual Boot problem (9.10 & MSWindowsXP) no Menu



Hakunka-Matata
December 9th, 2010, 04:08 AM
machine boots straight to Windows, Grub2 does not display the normal boot menu choices. Therefore, not able to boot into Ubuntu 9.10

Perhaps someone could look at this Results.txt file and shed some light on what went wrong. This machine was working fine for a long time, then all of a sudden, it starting booting straight to Windows. Any help appreciated.
Thanks in advance------------


Boot Info Script 0.55 dated February 15th, 2010

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

=> Windows is installed in the MBR of /dev/sda
=> Grub 2 is installed in the MBR of /dev/sdb and looks on the same drive in
partition #1 for /boot/grub.

sda1: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows XP
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows XP
Boot files/dirs: /boot.ini /ntldr /NTDETECT.COM

sdb1: __________________________________________________ _______________________

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

sdb2: __________________________________________________ _______________________

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

sdb5: __________________________________________________ _______________________

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

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

Drive: sda ___________________ __________________________________________________ ___

Disk /dev/sda: 20.0 GB, 20020396032 bytes
255 heads, 63 sectors/track, 2434 cylinders, total 39102336 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 39,086,144 39,086,082 7 HPFS/NTFS


Drive: sdb ___________________ __________________________________________________ ___

Disk /dev/sdb: 80.0 GB, 80000000000 bytes
255 heads, 63 sectors/track, 9726 cylinders, total 156250000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition Boot Start End Size Id System

/dev/sdb1 * 63 149,790,059 149,789,997 83 Linux
/dev/sdb2 149,790,060 156,248,189 6,458,130 5 Extended
/dev/sdb5 149,790,123 156,248,189 6,458,067 82 Linux swap / Solaris


blkid -c /dev/null: __________________________________________________ __________

Device UUID TYPE LABEL

/dev/loop0 squashfs
/dev/sda1 72642D18642CE119 ntfs
/dev/sda: PTTYPE="dos"
/dev/sdb1 4cff4967-2dcd-4d08-a5e5-247192aa82d0 ext4
/dev/sdb2: PTTYPE="dos"
/dev/sdb5 d100959c-ef95-4098-b963-13aae42db634 swap
/dev/sdb: PTTYPE="dos"

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

Device Mount_Point Type Options

aufs / aufs (rw)
/dev/sr0 /cdrom iso9660 (ro,noatime)
/dev/loop0 /rofs squashfs (ro,noatime)
/dev/sda1 /media/72642D18642CE119 fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_ permissions)


================================ sda1/boot.ini: ================================

[boot loader]
timeout=1
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOW S
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect /NoExecute=OptIn

=========================== sdb1/boot/grub/grub.cfg: ===========================

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s /boot/grub/grubenv ]; then
have_grubenv=true
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
saved_entry=${prev_saved_entry}
save_env saved_entry
prev_saved_entry=
save_env prev_saved_entry
fi
insmod ext2
set root=(hd0,1)
search --no-floppy --fs-uuid --set 4cff4967-2dcd-4d08-a5e5-247192aa82d0
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
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/white
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-22-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,1)
search --no-floppy --fs-uuid --set 4cff4967-2dcd-4d08-a5e5-247192aa82d0
linux /boot/vmlinuz-2.6.31-22-generic root=UUID=4cff4967-2dcd-4d08-a5e5-247192aa82d0 ro quiet splash
initrd /boot/initrd.img-2.6.31-22-generic
}
menuentry "Ubuntu, Linux 2.6.31-22-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd0,1)
search --no-floppy --fs-uuid --set 4cff4967-2dcd-4d08-a5e5-247192aa82d0
linux /boot/vmlinuz-2.6.31-22-generic root=UUID=4cff4967-2dcd-4d08-a5e5-247192aa82d0 ro single
initrd /boot/initrd.img-2.6.31-22-generic
}
menuentry "Ubuntu, Linux 2.6.31-21-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,1)
search --no-floppy --fs-uuid --set 4cff4967-2dcd-4d08-a5e5-247192aa82d0
linux /boot/vmlinuz-2.6.31-21-generic root=UUID=4cff4967-2dcd-4d08-a5e5-247192aa82d0 ro quiet splash
initrd /boot/initrd.img-2.6.31-21-generic
}
menuentry "Ubuntu, Linux 2.6.31-21-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd0,1)
search --no-floppy --fs-uuid --set 4cff4967-2dcd-4d08-a5e5-247192aa82d0
linux /boot/vmlinuz-2.6.31-21-generic root=UUID=4cff4967-2dcd-4d08-a5e5-247192aa82d0 ro single
initrd /boot/initrd.img-2.6.31-21-generic
}
menuentry "Ubuntu, Linux 2.6.31-20-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,1)
search --no-floppy --fs-uuid --set 4cff4967-2dcd-4d08-a5e5-247192aa82d0
linux /boot/vmlinuz-2.6.31-20-generic root=UUID=4cff4967-2dcd-4d08-a5e5-247192aa82d0 ro quiet splash
initrd /boot/initrd.img-2.6.31-20-generic
}
menuentry "Ubuntu, Linux 2.6.31-20-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd0,1)
search --no-floppy --fs-uuid --set 4cff4967-2dcd-4d08-a5e5-247192aa82d0
linux /boot/vmlinuz-2.6.31-20-generic root=UUID=4cff4967-2dcd-4d08-a5e5-247192aa82d0 ro single
initrd /boot/initrd.img-2.6.31-20-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,1)
search --no-floppy --fs-uuid --set 4cff4967-2dcd-4d08-a5e5-247192aa82d0
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=4cff4967-2dcd-4d08-a5e5-247192aa82d0 ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd0,1)
search --no-floppy --fs-uuid --set 4cff4967-2dcd-4d08-a5e5-247192aa82d0
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=4cff4967-2dcd-4d08-a5e5-247192aa82d0 ro single
initrd /boot/initrd.img-2.6.31-14-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Microsoft Windows XP Professional (on /dev/sdb1)" {
insmod ntfs
set root=(hd1,1)
search --no-floppy --fs-uuid --set 72642d18642ce119
drivemap -s (hd0) ${root}
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 ###

=============================== sdb1/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 defaults 0 0
# / was on /dev/sda1 during installation
UUID=4cff4967-2dcd-4d08-a5e5-247192aa82d0 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=d100959c-ef95-4098-b963-13aae42db634 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0

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


.1GB: boot/grub/core.img
3.8GB: boot/grub/grub.cfg
.5GB: boot/initrd.img-2.6.31-14-generic
1.2GB: boot/initrd.img-2.6.31-20-generic
1.8GB: boot/initrd.img-2.6.31-21-generic
6.2GB: boot/initrd.img-2.6.31-22-generic
.5GB: boot/vmlinuz-2.6.31-14-generic
1.0GB: boot/vmlinuz-2.6.31-20-generic
1.4GB: boot/vmlinuz-2.6.31-21-generic
1.7GB: boot/vmlinuz-2.6.31-22-generic
6.2GB: initrd.img
1.8GB: initrd.img.old
1.7GB: vmlinuz
1.4GB: vmlinuz.old

Quackers
December 9th, 2010, 04:11 AM
Which hard drive is the bios set to boot from please?

lindsay7
December 9th, 2010, 04:17 AM
You have windows on drive sda and Ubuntu on sdb. So it is a little more complicated. You need to have grub installed on sda if you want a dual boot menu. Right now if you change the boot order in bios you can boot to either windows on sda or ubuntu on sdb.

I would reinstall grub to sda and see if if will set up a dual boot with the os's on different drives. Here is the info on that. If you do this and still can not get a dual boot menu that works repost and ask for help on that issue.


http://www.webupd8.org/2009/12/how-to-recover-grub2-linux.html

Quackers
December 9th, 2010, 04:21 AM
That may be a little premature boss :-)
Although Windows is on sda1 if you look at the output for the os-prober it is detecting Windows XP professional on HD1,1 which is sdb1. It looks dodgy :-)

Hakunka-Matata
December 9th, 2010, 04:22 AM
The Results.txt was generated by using a Live CD to boot into Ubuntu. The machine has one 80GB drive partitioned into two equal size (40GB) partitions.

Quackers
December 9th, 2010, 04:26 AM
The Results.txt was generated by using a Live CD to boot into Ubuntu. The machine has one 80GB drive partitioned into two equal size (40GB) partitions.

Wow, that's not what the boot script is reporting. It says that sda is 20GB and sdb is 80GB

Disk /dev/sda: 20.0 GB, 20020396032 bytes
255 heads, 63 sectors/track, 2434 cylinders, total 39102336 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 39,086,144 39,086,082 7 HPFS/NTFS


Drive: sdb ___________________ __________________________________________________ ___

Disk /dev/sdb: 80.0 GB, 80000000000 bytes
255 heads, 63 sectors/track, 9726 cylinders, total 156250000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition Boot Start End Size Id System

/dev/sdb1 * 63 149,790,059 149,789,997 83 Linux
/dev/sdb2 149,790,060 156,248,189 6,458,130 5 Extended
/dev/sdb5 149,790,123 156,248,189 6,458,067 82 Linux swap / Solaris

Hakunka-Matata
December 9th, 2010, 04:26 AM
Check that, sorry, that is not correct. I cannot say for sure at this moment, will have to check with person having the problem. It does have only one hard drive, I'm certain of that, but it looks like it's a 100GB drive partitioned into a 20GB and 80GB partition.

Quackers
December 9th, 2010, 04:29 AM
The boot script is saying that there are 2 hard drives. One may, of course, be a usb drive.

Hakunka-Matata
December 9th, 2010, 04:29 AM
I'm doing this long distance with someone in St. Paul. A specific question if I may, this section looks suspicious to me:


================================ sda1/boot.ini: ================================

[boot loader]
timeout=1
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOW S
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect /NoExecute=OptIn

=========================== sdb1/boot/grub/grub.cfg: ===========================

Does this timeout=1 statement mean the menu would remain visible for only one second before automatically booting?

lindsay7
December 9th, 2010, 04:30 AM
Quackers, is this what you are talking about?


### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Microsoft Windows XP Professional (on /dev/sdb1)" {
insmod ntfs
set root=(hd1,1)
search --no-floppy --fs-uuid --set 72642d18642ce119
drivemap -s (hd0) ${root}
chainloader +1



I am not an expert but you are right this does look funny!

Quackers
December 9th, 2010, 04:32 AM
I'm not sure, possibly.
But this does
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Microsoft Windows XP Professional (on /dev/sdb1)" {
insmod ntfs
set root=(hd1,1)
search --no-floppy --fs-uuid --set 72642d18642ce119
drivemap -s (hd0) ${root}
chainloader +1
}

Hakunka-Matata
December 9th, 2010, 04:32 AM
OK, understood, sorry about the confusion straight out of the gate, I will get the correct information (maybe he has changed something and didn't tell me?) and come back to this post.

Apologies for wasting your time........

Quackers
December 9th, 2010, 04:34 AM
OK, understood, sorry about the confusion straight out of the gate, I will get the correct information (maybe he has changed something and didn't tell me?) and come back to this post.

Apologies for wasting your time........

No problem, if I minded I wouldn't be here :-)

lindsay7
December 9th, 2010, 04:34 AM
After looking at this again, I bet there is an usb drive and grub is installed to that.

Hakunka-Matata
December 9th, 2010, 04:36 AM
OK, I see that section, you both jumped on that as looking suspicious, what's up with it? Does it reveal a problem?

Quackers
December 9th, 2010, 04:36 AM
It seems likely - or a second internal has been added. There may be a couple of problems with Windows entries. Time will tell :-)

Quackers
December 9th, 2010, 04:38 AM
OK, I see that section, you both jumped on that as looking suspicious, what's up with it? Does it reveal a problem?

Windows appears to be on sda1 in the boot script, but the os-prober is picking up a Windows install on sdb1 - even though the initial stanzas of the boot script don't pick Windows up there.

Hakunka-Matata
December 9th, 2010, 04:45 AM
OK, thanks, I'm glad to see you all see problems with the "sdb1/boot/grub/grub.cfg:" file and I am going to clarify some information with the person having the problem. I will return to the thread when I have more information. Thanks for your time and help

Quackers
December 9th, 2010, 04:49 AM
No problem at all :-)
I'm going to sleep soon though, it's nearly 4am here. See you tomorrow maybe :-)

Hakunka-Matata
December 9th, 2010, 04:54 AM
Yep, I'm off to bed also, will check in as soon as I get more information, thanks all.

oldfred
December 9th, 2010, 06:53 AM
Just to add my 2 cents.

The osprober at the time it wrote the menu had both drives reversed. set root is hd0,1 or sda but it is clearly on sdb in boot script. It still works as search finds correct partition by UUID.

Also windows thought it was hd0 as its boot.ini says rdisk 0.

It is as if the drives have been reversed. I think I have seen this before and it can happen with mixed PATA & SATA drives as BIOS does not bring them up at same time. Also it just could be OP switched them.

Hakunka-Matata
December 10th, 2010, 05:30 AM
@oldfred: Thanks for your 2 cents worth, all input is appreciated.

OK, I did not remember how I built that machine, it does indeed have two drives, see attached Gparted Screenshots.

It appears Grub has the drives reversed, am I reading this correctly???

the plot thickens...........

oldfred
December 10th, 2010, 05:37 AM
What does BIOS say about drives. Are they both SATA or PATA or one of each?

Is there a difference between warm boot and cold boot?

Hakunka-Matata
December 10th, 2010, 06:17 PM
Gparted Reports the following information on the two hard drives installed:

/dev/sda is a 80GB (This is a SATA drive, Western Digital Caviar Blue WD800JD 80GB 7200 RPM 8MB Cache SATA 3.0Gb/s 3.5") This drive contains the Linux/Ubuntu OS instance, formatted as ext4 and swap.

/dev/sdb is a 20GB (This is a Seagate PATA drive, very old one, maybe it's failing). It is formatted as ntfs and contains the MSWindowsXP OS instance.



However, Results.txt reports these drives in reversed order:

Boot Info Script 0.55 dated February 15th, 2010
============================= Boot Info Summary: ==============================

=> Windows is installed in the MBR of /dev/sda
=> Grub 2 is installed in the MBR of /dev/sdb and looks on the same drive in
partition #1 for /boot/grub.

sda1: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows XP
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows XP
Boot files/dirs: /boot.ini /ntldr /NTDETECT.COM

sdb1: __________________________________________________ _______________________

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

sdb2: __________________________________________________ _______________________



and so forth, ..........................

I don't know if there is a difference between Cold and warm boot, I'll ask and find out. I've also asked the owner to switch First boot device order in BIOS and see what results. Will report in when I get the answers to my requests.

Hakunka-Matata
January 7th, 2011, 06:00 AM
Changing Boot order in BIOS allowed machine to boot to either hard drive. After doing that, we booted into a Recovery kernel and selected the "update Grub" option, #3?, and that was all it took to repair the Grub Boot Loader menu at startup. Working fine now.

Thanks all for your help.

attached is Results-Fixed.txt file which I'm going to compare now to hopefully see what changed, and understand what happened.

oldfred
January 7th, 2011, 05:15 PM
Grub's drivemap command must be working. You are booting Ubuntu drive as sda and windows as sdb, but windows boot.ini says it is drive 0. Most times it seems to be easier to just have windows as sda so it matches drive 0. Ubuntu does not care what drive it is.

But if it works that is great.