Results 1 to 6 of 6

Thread: Can't get grub2 to boot Windows 7

  1. #1
    Join Date
    Feb 2013
    Beans
    4

    Can't get grub2 to boot Windows 7

    Hello. It's my first time using these forums, so I apologise in advance if I do something incorrect.

    Since Saturday I have been trying to dual-boot Windows 7 and Ubuntu 12.10 using grub2, with no success. What I can do is change the boot options order in the UEFI, which means both MBR and grub2 are working correctly, since I can boot both operating systems.

    My laptop is an Asus G75V, and the disks and partitions are as follows in the RESULTS.txt obtained from running the bootinfoscript found here
    HTML Code:
     http://sourceforge.net/projects/bootinfoscript/
    Code:
                      Boot Info Script 0.61      [1 April 2012]
    
    
    ============================= Boot Info Summary: ===============================
    
     => No boot loader is installed in the MBR of /dev/sda.
     => No boot loader is installed in the MBR of /dev/sdb.
    
    sda1: __________________________________________________________________________
    
        File system:       vfat
        Boot sector type:  Windows 7: FAT32
        Boot sector info:  No errors found in the Boot Parameter Block.
        Operating System:  
        Boot files:        /efi/Boot/bootx64.efi /efi/ubuntu/grubx64.efi
    
    sda2: __________________________________________________________________________
    
        File system:       
        Boot sector type:  -
        Boot sector info: 
        Mounting failed:   mount: unknown filesystem type ''
    
    sda3: __________________________________________________________________________
    
        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
    
    sda4: __________________________________________________________________________
    
        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:        
    
    sdb1: __________________________________________________________________________
    
        File system:       swap
        Boot sector type:  -
        Boot sector info: 
    
    sdb2: __________________________________________________________________________
    
        File system:       ext4
        Boot sector type:  -
        Boot sector info: 
        Operating System:  Ubuntu 12.10
        Boot files:        /boot/grub/grub.cfg /etc/fstab
    
    sdb3: __________________________________________________________________________
    
        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:        
    
    ============================ Drive/Partition Info: =============================
    
    Drive: sda _____________________________________________________________________
    
    Disk /dev/sda: 256.1 GB, 256060514304 bytes
    255 heads, 63 sectors/track, 31130 cylinders, total 500118192 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                   1   500,118,191   500,118,191  ee GPT
    
    
    GUID Partition Table detected.
    
    Partition    Start Sector    End Sector  # of Sectors System
    /dev/sda1           2,048       206,847       204,800 EFI System partition
    /dev/sda2         206,848       468,991       262,144 Microsoft Reserved Partition (Windows)
    /dev/sda3         468,992   104,859,647   104,390,656 Data partition (Windows/Linux)
    /dev/sda4     104,859,648   500,117,503   395,257,856 Data partition (Windows/Linux)
    
    Drive: sdb _____________________________________________________________________
    
    Disk /dev/sdb: 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 / 4096 bytes
    
    Partition  Boot  Start Sector    End Sector  # of Sectors  Id System
    
    /dev/sdb1                   1 1,465,149,167 1,465,149,167  ee GPT
    
    
    GUID Partition Table detected.
    
    Partition    Start Sector    End Sector  # of Sectors System
    /dev/sdb1           2,048    33,556,479    33,554,432 Swap partition (Linux)
    /dev/sdb2      33,556,480   243,271,323   209,714,844 Data partition (Windows/Linux)
    /dev/sdb3     243,271,680 1,465,147,391 1,221,875,712 Data partition (Windows/Linux)
    
    "blkid" output: ________________________________________________________________
    
    Device           UUID                                   TYPE       LABEL
    
    /dev/sda1        DC3D-B7C2                              vfat       
    /dev/sda3        4CCC487CCC4861F6                       ntfs       
    /dev/sda4        2A12269212266355                       ntfs       
    /dev/sdb1        3917587a-6a91-4f2b-90d2-b6ebaeeb4881   swap       
    /dev/sdb2        39b9485f-7aa1-442d-a96d-f4d4f269c90f   ext4       Ubuntu
    /dev/sdb3        150640C744CA3519                       ntfs       Data
    
    ================================ Mount points: =================================
    
    Device           Mount_Point              Type       Options
    
    /dev/sda1        /boot/efi                vfat       (rw)
    /dev/sdb2        /                        ext4       (rw,errors=remount-ro)
    /dev/sdb3        /windows                 fuseblk    (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096)
    
    
    =========================== sdb2/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 [ x"${feature_menuentry_id}" = xy ]; then
      menuentry_id_option="--id"
    else
      menuentry_id_option=""
    fi
    
    export menuentry_id_option
    
    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 {
      if [ x$feature_all_video_module = xy ]; then
        insmod all_video
      else
        insmod efi_gop
        insmod efi_uga
        insmod ieee1275_fb
        insmod vbe
        insmod vga
        insmod video_bochs
        insmod video_cirrus
      fi
    }
    
    if [ x$feature_default_font_path = xy ] ; then
       font=unicode
    else
    insmod part_gpt
    insmod ext2
    set root='hd1,gpt2'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  39b9485f-7aa1-442d-a96d-f4d4f269c90f
    else
      search --no-floppy --fs-uuid --set=root 39b9485f-7aa1-442d-a96d-f4d4f269c90f
    fi
        font="/usr/share/grub/unicode.pf2"
    fi
    
    if loadfont $font ; then
      set gfxmode=auto
      load_video
      insmod gfxterm
      set locale_dir=$prefix/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' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-39b9485f-7aa1-442d-a96d-f4d4f269c90f' {
    recordfail
        gfxmode $linux_gfx_mode
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd1,gpt2'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  39b9485f-7aa1-442d-a96d-f4d4f269c90f
        else
          search --no-floppy --fs-uuid --set=root 39b9485f-7aa1-442d-a96d-f4d4f269c90f
        fi
        linux    /boot/vmlinuz-3.5.0-17-generic root=UUID=39b9485f-7aa1-442d-a96d-f4d4f269c90f ro   quiet splash $vt_handoff
        initrd    /boot/initrd.img-3.5.0-17-generic
    }
    submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-39b9485f-7aa1-442d-a96d-f4d4f269c90f' {
        menuentry 'Ubuntu, with Linux 3.5.0-17-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.5.0-17-generic-advanced-39b9485f-7aa1-442d-a96d-f4d4f269c90f' {
        recordfail
            gfxmode $linux_gfx_mode
            insmod gzio
            insmod part_gpt
            insmod ext2
            set root='hd1,gpt2'
            if [ x$feature_platform_search_hint = xy ]; then
              search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  39b9485f-7aa1-442d-a96d-f4d4f269c90f
            else
              search --no-floppy --fs-uuid --set=root 39b9485f-7aa1-442d-a96d-f4d4f269c90f
            fi
            echo    'Loading Linux 3.5.0-17-generic ...'
            linux    /boot/vmlinuz-3.5.0-17-generic root=UUID=39b9485f-7aa1-442d-a96d-f4d4f269c90f ro   quiet splash $vt_handoff
            echo    'Loading initial ramdisk ...'
            initrd    /boot/initrd.img-3.5.0-17-generic
        }
        menuentry 'Ubuntu, with Linux 3.5.0-17-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.5.0-17-generic-recovery-39b9485f-7aa1-442d-a96d-f4d4f269c90f' {
        recordfail
            insmod gzio
            insmod part_gpt
            insmod ext2
            set root='hd1,gpt2'
            if [ x$feature_platform_search_hint = xy ]; then
              search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  39b9485f-7aa1-442d-a96d-f4d4f269c90f
            else
              search --no-floppy --fs-uuid --set=root 39b9485f-7aa1-442d-a96d-f4d4f269c90f
            fi
            echo    'Loading Linux 3.5.0-17-generic ...'
            linux    /boot/vmlinuz-3.5.0-17-generic root=UUID=39b9485f-7aa1-442d-a96d-f4d4f269c90f ro recovery nomodeset 
            echo    'Loading initial ramdisk ...'
            initrd    /boot/initrd.img-3.5.0-17-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+ ###
    ### END /etc/grub.d/20_memtest86+ ###
    
    ### BEGIN /etc/grub.d/30_os-prober ###
    ### END /etc/grub.d/30_os-prober ###
    
    ### BEGIN /etc/grub.d/30_uefi-firmware ###
    ### END /etc/grub.d/30_uefi-firmware ###
    
    ### 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 7' {
    set root='(hd0,msdos1)'
    chainloader +1
    }
    ### END /etc/grub.d/40_custom ###
    
    ### BEGIN /etc/grub.d/41_custom ###
    if [ -f  ${config_directory}/custom.cfg ]; then
      source ${config_directory}/custom.cfg
    elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
      source $prefix/custom.cfg;
    fi
    ### END /etc/grub.d/41_custom ###
    --------------------------------------------------------------------------------
    
    =============================== sdb2/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>
    # / was on /dev/sdb2 during installation
    UUID=39b9485f-7aa1-442d-a96d-f4d4f269c90f /               ext4    errors=remount-ro 0       1
    # /boot/efi was on /dev/sda1 during installation
    UUID=DC3D-B7C2  /boot/efi       vfat    defaults        0       1
    # /windows was on /dev/sdb3 during installation
    UUID=150640C744CA3519 /windows        ntfs    defaults,umask=007,gid=46 0       0
    # swap was on /dev/sdb1 during installation
    UUID=3917587a-6a91-4f2b-90d2-b6ebaeeb4881 none            swap    sw              0       0
    --------------------------------------------------------------------------------
    
    =================== sdb2: Location of files loaded by Grub: ====================
    
               GiB - GB             File                                 Fragment(s)
    
                   =                boot/grub/grub.cfg                             1
                   =                boot/initrd.img-3.5.0-17-generic               1
                   =                boot/vmlinuz-3.5.0-17-generic                  1
                   =                initrd.img                                     1
                   =                initrd.img.old                                 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
    Last edited by Throst Gunnulf; February 13th, 2013 at 06:42 PM.

  2. #2
    Join Date
    Jun 2009
    Location
    Chicago Suburbs
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Can't get grub2 to boot Windows 7

    You have the new UEFI with gpt partitions.

    While the Windows partition looks ok, the Windows boot files normally in the efi partition are missing. Only Ubuntu files are there.

    You should have a copy here. Or maybe from installer?
    C:\Windows\Boot\EFI\bootmgfw.efi

    But you also need the BCD created into this folder.
    /boot/efi/EFI/Microsoft/Boot/BCD

    And Windows normally has these:
    /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi
    /boot/efi/EFI/Microsoft/Boot/bootmgr.efi
    /boot/efi/EFI/Microsoft/Boot/memtest.efi


    This is mounted as /boot/efi, so in efi partition it is just /EFI/Microsoft/Boot.

    This site may know more about Windows with UEFI.
    http://www.eightforums.com/
    http://www.sevenforums.com/

    Its just with UEFI the BCD is in a different location.
    http://www.ms-windows.info/Help/boot...bcd-17554.aspx

    How to fix Vista/Window 7 when the boot files are missing - rebuild BCD with bcdedit
    http://ubuntuforums.org/showpost.php...32&postcount=4
    For info on UEFI boot install & repair:
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to close thread when/if answered completely.







  3. #3
    Join Date
    Feb 2013
    Beans
    4

    Re: Can't get grub2 to boot Windows 7

    Thanks a lot for you quick reply. I'm going to try and follow that guide and I'll come back to say if it worked or not.

  4. #4
    Join Date
    Feb 2013
    Beans
    4

    Re: Can't get grub2 to boot Windows 7

    After following the guide in the last link and running the following command
    Code:
    sudo update-grub2
    another entry was added to the grub menu, with the label "Windows Recovery Environment (loader) (on /dev/sda3)".

    When choosing the new entry, an error message appeared.
    Code:
    error: can't find command 'drivemap'.
    error: invalid EFI file path.
    I went back to Ubuntu and ran bootinfoscrip again, receiving the following output.
    Code:
                      Boot Info Script 0.61      [1 April 2012]
    
    
    ============================= Boot Info Summary: ===============================
    
     => No boot loader is installed in the MBR of /dev/sda.
     => No boot loader is installed in the MBR of /dev/sdb.
    
    sda1: __________________________________________________________________________
    
        File system:       vfat
        Boot sector type:  Windows 7: FAT32
        Boot sector info:  No errors found in the Boot Parameter Block.
        Operating System:  
        Boot files:        /efi/Boot/bootx64.efi /efi/ubuntu/grubx64.efi
    
    sda2: __________________________________________________________________________
    
        File system:       
        Boot sector type:  -
        Boot sector info: 
        Mounting failed:   mount: unknown filesystem type ''
    
    sda3: __________________________________________________________________________
    
        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:        /bootmgr /BOOT/bcd /Windows/System32/winload.exe
    
    sda4: __________________________________________________________________________
    
        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:        
    
    sdb1: __________________________________________________________________________
    
        File system:       swap
        Boot sector type:  -
        Boot sector info: 
    
    sdb2: __________________________________________________________________________
    
        File system:       ext4
        Boot sector type:  -
        Boot sector info: 
        Operating System:  Ubuntu 12.10
        Boot files:        /boot/grub/grub.cfg /etc/fstab
    
    sdb3: __________________________________________________________________________
    
        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:        
    
    ============================ Drive/Partition Info: =============================
    
    Drive: sda _____________________________________________________________________
    
    Disk /dev/sda: 256.1 GB, 256060514304 bytes
    255 heads, 63 sectors/track, 31130 cylinders, total 500118192 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                   1   500,118,191   500,118,191  ee GPT
    
    
    GUID Partition Table detected.
    
    Partition    Start Sector    End Sector  # of Sectors System
    /dev/sda1           2,048       206,847       204,800 EFI System partition
    /dev/sda2         206,848       468,991       262,144 Microsoft Reserved Partition (Windows)
    /dev/sda3         468,992   104,859,647   104,390,656 Data partition (Windows/Linux)
    /dev/sda4     104,859,648   500,117,503   395,257,856 Data partition (Windows/Linux)
    
    Drive: sdb _____________________________________________________________________
    
    Disk /dev/sdb: 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 / 4096 bytes
    
    Partition  Boot  Start Sector    End Sector  # of Sectors  Id System
    
    /dev/sdb1                   1 1,465,149,167 1,465,149,167  ee GPT
    
    
    GUID Partition Table detected.
    
    Partition    Start Sector    End Sector  # of Sectors System
    /dev/sdb1           2,048    33,556,479    33,554,432 Swap partition (Linux)
    /dev/sdb2      33,556,480   243,271,323   209,714,844 Data partition (Windows/Linux)
    /dev/sdb3     243,271,680 1,465,147,391 1,221,875,712 Data partition (Windows/Linux)
    
    "blkid" output: ________________________________________________________________
    
    Device           UUID                                   TYPE       LABEL
    
    /dev/sda1        DC3D-B7C2                              vfat       
    /dev/sda3        4CCC487CCC4861F6                       ntfs       Windows
    /dev/sda4        2A12269212266355                       ntfs       Data (SSD)
    /dev/sdb1        3917587a-6a91-4f2b-90d2-b6ebaeeb4881   swap       
    /dev/sdb2        39b9485f-7aa1-442d-a96d-f4d4f269c90f   ext4       Ubuntu
    /dev/sdb3        150640C744CA3519                       ntfs       Data (HDD)
    /dev/sr0                                                udf        UDF Volume
    
    ================================ Mount points: =================================
    
    Device           Mount_Point              Type       Options
    
    /dev/sda1        /boot/efi                vfat       (rw)
    /dev/sdb2        /                        ext4       (rw,errors=remount-ro)
    /dev/sdb3        /windows                 fuseblk    (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096)
    /dev/sr0         /media/joaonuno/UDF Volume udf        (ro,nosuid,nodev,uid=1000,gid=1000,iocharset=utf8,umask=0077,uhelper=udisks2)
    
    
    =========================== sdb2/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 [ x"${feature_menuentry_id}" = xy ]; then
      menuentry_id_option="--id"
    else
      menuentry_id_option=""
    fi
    
    export menuentry_id_option
    
    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 {
      if [ x$feature_all_video_module = xy ]; then
        insmod all_video
      else
        insmod efi_gop
        insmod efi_uga
        insmod ieee1275_fb
        insmod vbe
        insmod vga
        insmod video_bochs
        insmod video_cirrus
      fi
    }
    
    if [ x$feature_default_font_path = xy ] ; then
       font=unicode
    else
    insmod part_gpt
    insmod ext2
    set root='hd1,gpt2'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  39b9485f-7aa1-442d-a96d-f4d4f269c90f
    else
      search --no-floppy --fs-uuid --set=root 39b9485f-7aa1-442d-a96d-f4d4f269c90f
    fi
        font="/usr/share/grub/unicode.pf2"
    fi
    
    if loadfont $font ; then
      set gfxmode=auto
      load_video
      insmod gfxterm
      set locale_dir=$prefix/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' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-39b9485f-7aa1-442d-a96d-f4d4f269c90f' {
    recordfail
    	gfxmode $linux_gfx_mode
    	insmod gzio
    	insmod part_gpt
    	insmod ext2
    	set root='hd1,gpt2'
    	if [ x$feature_platform_search_hint = xy ]; then
    	  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  39b9485f-7aa1-442d-a96d-f4d4f269c90f
    	else
    	  search --no-floppy --fs-uuid --set=root 39b9485f-7aa1-442d-a96d-f4d4f269c90f
    	fi
    	linux	/boot/vmlinuz-3.5.0-17-generic root=UUID=39b9485f-7aa1-442d-a96d-f4d4f269c90f ro   quiet splash $vt_handoff
    	initrd	/boot/initrd.img-3.5.0-17-generic
    }
    submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-39b9485f-7aa1-442d-a96d-f4d4f269c90f' {
    	menuentry 'Ubuntu, with Linux 3.5.0-17-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.5.0-17-generic-advanced-39b9485f-7aa1-442d-a96d-f4d4f269c90f' {
    	recordfail
    		gfxmode $linux_gfx_mode
    		insmod gzio
    		insmod part_gpt
    		insmod ext2
    		set root='hd1,gpt2'
    		if [ x$feature_platform_search_hint = xy ]; then
    		  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  39b9485f-7aa1-442d-a96d-f4d4f269c90f
    		else
    		  search --no-floppy --fs-uuid --set=root 39b9485f-7aa1-442d-a96d-f4d4f269c90f
    		fi
    		echo	'Loading Linux 3.5.0-17-generic ...'
    		linux	/boot/vmlinuz-3.5.0-17-generic root=UUID=39b9485f-7aa1-442d-a96d-f4d4f269c90f ro   quiet splash $vt_handoff
    		echo	'Loading initial ramdisk ...'
    		initrd	/boot/initrd.img-3.5.0-17-generic
    	}
    	menuentry 'Ubuntu, with Linux 3.5.0-17-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.5.0-17-generic-recovery-39b9485f-7aa1-442d-a96d-f4d4f269c90f' {
    	recordfail
    		insmod gzio
    		insmod part_gpt
    		insmod ext2
    		set root='hd1,gpt2'
    		if [ x$feature_platform_search_hint = xy ]; then
    		  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  39b9485f-7aa1-442d-a96d-f4d4f269c90f
    		else
    		  search --no-floppy --fs-uuid --set=root 39b9485f-7aa1-442d-a96d-f4d4f269c90f
    		fi
    		echo	'Loading Linux 3.5.0-17-generic ...'
    		linux	/boot/vmlinuz-3.5.0-17-generic root=UUID=39b9485f-7aa1-442d-a96d-f4d4f269c90f ro recovery nomodeset 
    		echo	'Loading initial ramdisk ...'
    		initrd	/boot/initrd.img-3.5.0-17-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+ ###
    ### END /etc/grub.d/20_memtest86+ ###
    
    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry 'Windows Recovery Environment (loader) (on /dev/sda3)' --class windows --class os $menuentry_id_option 'osprober-chain-4CCC487CCC4861F6' {
    	insmod part_gpt
    	insmod ntfs
    	set root='hd0,gpt3'
    	if [ x$feature_platform_search_hint = xy ]; then
    	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3  4CCC487CCC4861F6
    	else
    	  search --no-floppy --fs-uuid --set=root 4CCC487CCC4861F6
    	fi
    	drivemap -s (hd0) ${root}
    	chainloader +1
    }
    ### END /etc/grub.d/30_os-prober ###
    
    ### BEGIN /etc/grub.d/30_uefi-firmware ###
    ### END /etc/grub.d/30_uefi-firmware ###
    
    ### 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  ${config_directory}/custom.cfg ]; then
      source ${config_directory}/custom.cfg
    elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
      source $prefix/custom.cfg;
    fi
    ### END /etc/grub.d/41_custom ###
    --------------------------------------------------------------------------------
    
    =============================== sdb2/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>
    # / was on /dev/sdb2 during installation
    UUID=39b9485f-7aa1-442d-a96d-f4d4f269c90f /               ext4    errors=remount-ro 0       1
    # /boot/efi was on /dev/sda1 during installation
    UUID=DC3D-B7C2  /boot/efi       vfat    defaults        0       1
    # /windows was on /dev/sdb3 during installation
    UUID=150640C744CA3519 /windows        ntfs    defaults,umask=007,gid=46 0       0
    # swap was on /dev/sdb1 during installation
    UUID=3917587a-6a91-4f2b-90d2-b6ebaeeb4881 none            swap    sw              0       0
    --------------------------------------------------------------------------------
    
    =================== sdb2: Location of files loaded by Grub: ====================
    
               GiB - GB             File                                 Fragment(s)
    
                   =                boot/grub/grub.cfg                             1
                   =                boot/initrd.img-3.5.0-17-generic               1
                   =                boot/vmlinuz-3.5.0-17-generic                  1
                   =                initrd.img                                     1
                   =                initrd.img.old                                 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
    Atfterwards I tried using the Windows Startup Repair available when booting from the Windows CD and no problems where found. I brought up the Command Prompt and ran all of the Bootrec.exe commands, and nothing changed.

    I don't know what else to do, mainly because I don't have the required knowledge to understand all of these concepts.

  5. #5
    Join Date
    Jun 2009
    Location
    Chicago Suburbs
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Can't get grub2 to boot Windows 7

    It looks like you did a BIOS type repair of Windows as it has the BIOS bootmgr in the Windows partition not the UEFI bootmgr.efi andbootmgfw.efi in the efi partition.
    Not sure of exact steps to repair boot loader in efi partition. You may be able just to copy the file, if you put them in the correct places.

    But grub2's os-prober has a bug anyway and only creates BIOS type entries which will not work with UEFI.
    grub2's os-prober creates wrong style (BIOS) chain boot entry
    https://bugs.launchpad.net/ubuntu/+s...2/+bug/1024383
    Type of entry that does not work:
    'Windows ...) (on /dev/sdXY)'
    Boot Repair -Also handles LVM, GPT, separate /boot and UEFI dual boot.:
    https://help.ubuntu.com/community/Boot-Repair

    Windows 8 UEFI repair USB must be FAT32
    http://www.eightforums.com/tutorials...ndows-8-a.html
    http://social.msdn.microsoft.com/For...-166dddf32205/

    http://www.eightforums.com/

    You can look at the BootInfo reports these users posted. For more detail on where files should be.
    Asus N56VJ-SH71-CD - shows partitions after install
    http://ubuntuforums.org/showthread.php?t=2105622
    ASUS K55A Windows 8 & Ubuntu Some Asus need this boot parameter pci=nomsi
    http://ubuntuforums.org/showthread.php?t=2088499
    Asus K55n will not boot in UEFI mode. Boot Parameters? Feb 2013
    http://ubuntuforums.org/showthread.php?t=2111720
    Asus x202e dual boot Win 8 full and Ubuntu post #13
    http://ubuntuforums.org/showthread.php?t=2092966
    Last edited by oldfred; February 13th, 2013 at 11:58 PM.
    For info on UEFI boot install & repair:
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to close thread when/if answered completely.







  6. #6
    Join Date
    Feb 2013
    Beans
    4

    Re: Can't get grub2 to boot Windows 7

    Boot-Repair did it for me, problem solved! Thank you very much for your help!

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •