Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm finding myself in a rather unique situation. I've read through just about every resource I can find about this and while things have helped me understand some background, I haven't yet been able to find a solution. So I'm asking here.

I originally had just a Windows 7 64-bit OS installation on my desktop. Learning that I couldn't do anything with Apache, PHP and MySql from within a 64-bit system, I did some research and found out that I could use Ubuntu. I've installed the latest version: 11.04.

I created a CD to install Ubuntu from and the install went just fine. I installed it side-by-side with Windows 7. I can boot into Ubuntu just fine through the dual-boot option.

When I reboot to load Windows though, the Grub2 list shows Windows 7 (loader) and when I select this option the Windows System Recovery loads instead of the actual OS. I haven't made it past there because I didn't know what to do. I just shut the computer down and rebooted into Ubuntu. I've been working for the last hour and a half to try to figure out how to boot into the Windows 7 OS and I haven't got a clue.

While I'm somewhat proficient with Windows 7, I'm totally new to Ubuntu, so if you do know what needs to happen, please keep it simple enough that I'll be able to understand. Thanks for all your help in advance.

Here's the results after using the Boot Info Script: 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 #5 for cbh.
=> Windows is installed in the MBR of /dev/sdb
=> Grub 2 is installed in the MBR of /dev/mapper/pdc_bdadcfbdif and looks on 
the same drive in partition #5 for cbh.

sda1: _________________________________________________________________________

File system:       ntfs
Boot sector type:  Windows Vista/7
Boot sector info:  No errors found in the Boot Parameter Block.
Mounting failed:
fuse: mount failed: Device or resource busy
fuse: mount failed: Device or resource busy

sda2: _________________________________________________________________________

File system:       ntfs
Boot sector type:  Windows Vista/7
Boot sector info:  No errors found in the Boot Parameter Block.
Mounting failed:
fuse: mount failed: Device or resource busy
fuse: mount failed: Device or resource busy
fuse: mount failed: Device or resource busy
fuse: mount failed: Device or resource busy

sda3: _________________________________________________________________________

File system:       ntfs
Boot sector type:  Windows Vista/7
Boot sector info:  No errors found in the Boot Parameter Block.
Mounting failed:
fuse: mount failed: Device or resource busy
fuse: mount failed: Device or resource busy
fuse: mount failed: Device or resource busy
fuse: mount failed: Device or resource busy
fuse: mount failed: Device or resource busy
fuse: mount failed: Device or resource busy

sdb1: _________________________________________________________________________

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

sdb2: _________________________________________________________________________

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

sdb3: _________________________________________________________________________

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

sdb4: _________________________________________________________________________

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

sdb5: _________________________________________________________________________

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

sdb6: _________________________________________________________________________

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

pdc_bdadcfbdif1:    _________________________________________________________________________

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

pdc_bdadcfbdif2:     _________________________________________________________________________

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

pdc_bdadcfbdif3: _________________________________________________________________________

File system:       
Boot sector type:  Unknown
Boot sector info:  
Mounting failed:
fuse: mount failed: Device or resource busy
fuse: mount failed: Device or resource busy
fuse: mount failed: Device or resource busy
fuse: mount failed: Device or resource busy
fuse: mount failed: Device or resource busy
fuse: mount failed: Device or resource busy
mount: unknown filesystem type ''

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

Drive: sda ___________________ _____________________________________________________

Disk /dev/sda: 750.2 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders, total 1465149168 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    *          2,048       206,847       204,800   7 HPFS/NTFS
/dev/sda2             206,911 1,440,372,735 1,440,165,825   7 HPFS/NTFS
/dev/sda3       1,440,372,736 1,464,856,575    24,483,840   7 HPFS/NTFS


Drive: sdb ___________________ _____________________________________________________

Disk /dev/sdb: 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 / 512 bytes

Partition  Boot         Start           End          Size  Id System

/dev/sdb1    *          2,048       206,847       204,800   7 HPFS/NTFS
/dev/sdb2             206,911 1,342,554,688 1,342,347,778   7 HPFS/NTFS
/dev/sdb3       1,930,344,448 1,953,521,663    23,177,216   7 HPFS/NTFS
/dev/sdb4       1,342,556,158 1,930,344,447   587,788,290   5 Extended
/dev/sdb5       1,342,556,160 1,896,806,399   554,250,240  83 Linux
/dev/sdb6       1,896,808,448 1,930,344,447    33,536,000  82 Linux swap / Solaris


Drive: pdc_bdadcfbdif ___________________     _____________________________________________________

Disk /dev/mapper/pdc_bdadcfbdif: 750.0 GB, 749999947776 bytes
255 heads, 63 sectors/track, 91182 cylinders, total 1464843648 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition  Boot         Start           End          Size  Id System

/dev/mapper/pdc_bdadcfbdif1   *          2,048       206,847       204,800   7     HPFS/NTFS
/dev/mapper/pdc_bdadcfbdif2            206,911 1,440,372,735 1,440,165,825   7 HPFS/NTFS
/dev/mapper/pdc_bdadcfbdif3      1,440,372,736 1,464,856,575    24,483,840   7 HPFS/NTFS

/dev/mapper/pdc_bdadcfbdif3 ends after the last sector of /dev/mapper/pdc_bdadcfbdif

blkid -c /dev/null: ____________________________________________________________

Device           UUID                                   TYPE           LABEL                         

/dev/mapper/pdc_bdadcfbdif1 888E54CC8E54B482                       ntfs        SYSTEM                        
/dev/mapper/pdc_bdadcfbdif2 C2766BF6766BEA1D                       ntfs       OS                            
/dev/mapper/pdc_bdadcfbdif: PTTYPE="dos" 
/dev/sda1        888E54CC8E54B482                       ntfs       SYSTEM                        
/dev/sda2        C2766BF6766BEA1D                       ntfs       OS                            
/dev/sda3        BE6CA31D6CA2CF87                       ntfs       HP_RECOVERY                   
/dev/sda                                                   promise_fasttrack_raid_member                               
/dev/sdb1        20B65685B6565B7C                       ntfs       SYSTEM                        
/dev/sdb2        B4467A314679F508                       ntfs       HP                            
/dev/sdb3        6E10B7A410B77227                       ntfs        FACTORY_IMAGE                 
/dev/sdb4: PTTYPE="dos" 
/dev/sdb5        266f9801-cf4f-4acc-affa-2092be035f0c     ext4                                     
/dev/sdb6        1df35749-a887-45ff-a3de-edd52239847d    swap                                     
/dev/sdb: PTTYPE="dos" 
error: /dev/mapper/pdc_bdadcfbdif3: No such file or directory
error: /dev/sdc: No medium found
error: /dev/sdd: No medium found
error: /dev/sde: No medium found
error: /dev/sdf: No medium found
error: /dev/sdg: No medium found

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

Device           Mount_Point              Type       Options

/dev/sdb5        /                        ext4       (rw,errors=remount-ro,commit=0)


=========================== sdb5/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='(/dev/sdb,msdos5)'
search --no-floppy --fs-uuid --set=root 266f9801-cf4f-4acc-affa-2092be035f0c
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=auto
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(/dev/sdb,msdos5)'
search --no-floppy --fs-uuid --set=root 266f9801-cf4f-4acc-affa-2092be035f0c
set locale_dir=($root)/boot/grub/locale
set lang=en_US
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
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, with Linux 2.6.38-8-generic-pae' --class ubuntu --class gnu-linux     --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod part_msdos
insmod ext2
set root='(/dev/sdb,msdos5)'
search --no-floppy --fs-uuid --set=root 266f9801-cf4f-4acc-affa-2092be035f0c
linux   /boot/vmlinuz-2.6.38-8-generic-pae root=UUID=266f9801-cf4f-4acc-  affa-2092be035f0c ro   quiet splash vt.handoff=7
initrd  /boot/initrd.img-2.6.38-8-generic-pae
}
menuentry 'Ubuntu, with Linux 2.6.38-8-generic-pae (recovery mode)' --class ubuntu     --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod part_msdos
insmod ext2
set root='(/dev/sdb,msdos5)'
search --no-floppy --fs-uuid --set=root 266f9801-cf4f-4acc-affa-2092be035f0c
echo    'Loading Linux 2.6.38-8-generic-pae ...'
linux   /boot/vmlinuz-2.6.38-8-generic-pae root=UUID=266f9801-cf4f-4acc-affa-2092be035f0c ro single 
echo    'Loading initial ramdisk ...'
initrd  /boot/initrd.img-2.6.38-8-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='(/dev/sdb,msdos5)'
search --no-floppy --fs-uuid --set=root 266f9801-cf4f-4acc-affa-2092be035f0c
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
set root='(/dev/sdb,msdos5)'
search --no-floppy --fs-uuid --set=root 266f9801-cf4f-4acc-affa-2092be035f0c
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/sdb1)" --class windows --class os {
insmod part_msdos
insmod ntfs
set root='(/dev/sdb,msdos1)'
search --no-floppy --fs-uuid --set=root 20B65685B6565B7C
chainloader +1
}
menuentry "Windows Recovery Environment (loader) (on /dev/sdb3)" --class windows  --class os {
insmod part_msdos
insmod ntfs
set root='(/dev/sdb,msdos3)'
search --no-floppy --fs-uuid --set=root 6E10B7A410B77227
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 ###

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

=============================== sdb5/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/sdb5 during installation
UUID=266f9801-cf4f-4acc-affa-2092be035f0c /               ext4    errors=remount-ro  0       1
# swap was on /dev/sdb6 during installation
UUID=1df35749-a887-45ff-a3de-edd52239847d none            swap    sw               0       0

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


 900.1GB: boot/grub/core.img
 825.0GB: boot/grub/grub.cfg
 688.7GB: boot/initrd.img-2.6.38-8-generic-pae
 688.0GB: boot/vmlinuz-2.6.38-8-generic-pae
 688.7GB: initrd.img
 688.0GB: vmlinuz
=========================== Unknown MBRs/Boot Sectors/etc =======================

Unknown BootLoader  on pdc_bdadcfbdif3



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

sdc sdd sde sdf sdg 
=============================== StdErr Messages: ===============================

ERROR: dos: partition address past end of RAID device
hexdump: /dev/mapper/pdc_bdadcfbdif3: No such file or directory
hexdump: /dev/mapper/pdc_bdadcfbdif3: No such file or directory
ERROR: dos: partition address past end of RAID device
share|improve this question

2 Answers 2

up vote 3 down vote accepted

The Ubuntu installer probably autodetected a recovery partition and set up GRUB (the bootloader) to boot to that instead of the proper Windows partition.

First just try doing sudo os-prober; sudo update-grub and see if that doesn't put the right entries in GRUB for you. If it doesn't, you'll need to edit your GRUB configuration to point to the right partition.

First we want to figure out what partition your Windows installation is on. Do sudo fdisk -l (don't worry, this is a safe operation; it just lists your disks and partitions) and you should see a list of partition entries formatted a bit like this:

/dev/sda3 * 1 6374 51199123+ 7 HPFS/NTFS

Note the device path of any partitions that are of type "HPFS/NTFS" or "MS-DOS" or something to that effect. What you'll probably see is a small NTFS partition at the start of the disk and a bigger NTFS partition elsewhere. The smaller one is your recovery partition and the bigger one is your Windows instance proper. Make a note of the device path of the larger one.

Now we need to know the UUID of that filesystem, which we will give to GRUB to help it find it. Say sudo blkid and find the entry corresponding to the partition you noted above. Note the value in quotes after UUID=.

Now use the editor of your choice to open /etc/grub.d/40_custom. sudo nano -w /etc/grub.d/40_custom will do nicely. At the end of this file add something like the following:

   menuentry "Windows 7" {
     insmod part_msdos
     insmod ntfs
     set root='(hd0,msdos1)'
     search --no-floppy --fs-uuid --set UUID-GOES-HERE
     chainloader +1
  }

Two things need to be substituted here. Where I've written UUID-GOES-HERE substitute the UUID you noted above (no quotation marks). Where I've written msdos1 substitute 1 with the number of the partition you noted before (sda6 would be msdos6 etc.).

Save this file and do sudo update-grub, then reboot. Try your new menu entry. Should work.

share|improve this answer
    
I just noticed that you seem to have Windows on /dev/sdb (your second hard drive), so you may need to swap hd0 for hd1 above. –  tgies May 4 '11 at 23:49
1  
It worked great. It took me a bit to recover my system back to where it was so that I could try your suggestion (I made a big mistake and had to reinstall Ubuntu), but that worked great! Thanks a ton. It loads just fine now. I do have two hard drives and the second one was at one time the main hard drive for another computer of mine, so I just used "hd0" in the new menu entry. One thing though, when I select the Windows 7 entry I just added, the screen says: "error: no argument specified. Press any key to continue...". Any idea why it would say that? –  Michael May 5 '11 at 5:30
1  
Looks like they changed the format of the search line on me. Change --set in that 40_custom file to --set=root and rerun sudo update-grub and you should be fine. –  tgies May 5 '11 at 21:22

I had the very same problem. I had Windows 7 on my laptop and decided to give Ubuntu a try too. So I made a new partition, allocated 15 gigabyte of my hard disk to it and installed Ubuntu on the new partition. Every thing went smoothly, the installation wizard rebooted the system and GRUB loaded with Ubuntu and Windows 7 on its menu.

I could load into Windows 7 but when I chose Ubuntu, all I could get was a black screen. I searched the web and tried almost everything I could get but the problem remained. So I decided to format the Ubuntu partition and reinstall Ubuntu. During my search for a solution, I noticed that it is important where to install GRUB.

Originally I had chosen to install GRUB on the same partition that Ubuntu was going to be installed (sda8 in my case) and that was the problem. When installing GRUB, it is important to specify a hard disk (and not a partition) for GRUB to be installed on. Specifying a partition instead could lead to trouble.

So this time I chose 'sda' for GRUB to be installed on and installed Ubuntu on 'sda8' and that was it. The problem was solved and now I have both Windows 7 and Ubuntu 12.04 on my laptop working smoothly.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.