Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Grub not detecting Windows 7
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
310354
n00b
n00b


Joined: 01 Aug 2013
Posts: 59

PostPosted: Tue Nov 26, 2013 4:19 pm    Post subject: [SOLVED] Grub not detecting Windows 7 Reply with quote

Hi, I have a problem: grub2 does not detect the Windows 7 boot partition, but only the Gentoo one, here are some information:

Code:
fdisk -l

Disk /dev/sda: 750.2 GB, 750156374016 bytes, 1465149168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0xa51e1827

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      206847      102400    7  HPFS/NTFS/exFAT
/dev/sda2          206848  1198530559   599161856    7  HPFS/NTFS/exFAT
/dev/sda3      1198530560  1459816447   130642944   83  Linux
/dev/sda4      1459816448  1465147391     2665472   82  Linux swap / Solaris


Code:
cat /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

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 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_msdos
insmod ext2
set root='hd0,msdos3'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  1019184f-525c-4204-b825-21a1893eee5a
else
  search --no-floppy --fs-uuid --set=root 1019184f-525c-4204-b825-21a1893eee5a
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=
  insmod gettext
fi
terminal_output gfxterm
if sleep --interruptible 0 ; then
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-1019184f-525c-4204-b825-21a1893eee5a' {
   load_video
   insmod gzio
   insmod part_msdos
   insmod ext2
   set root='hd0,msdos3'
   if [ x$feature_platform_search_hint = xy ]; then
     search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  1019184f-525c-4204-b825-21a1893eee5a
   else
     search --no-floppy --fs-uuid --set=root 1019184f-525c-4204-b825-21a1893eee5a
   fi
   echo   'Loading Linux 3.10.17-gentoo ...'
   linux   /boot/kernel-3.10.17-gentoo root=/dev/sda3 ro 
}
submenu 'Advanced options for Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-1019184f-525c-4204-b825-21a1893eee5a' {
   menuentry 'Gentoo GNU/Linux, with Linux 3.10.17-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.10.17-gentoo-advanced-1019184f-525c-4204-b825-21a1893eee5a' {
      load_video
      insmod gzio
      insmod part_msdos
      insmod ext2
      set root='hd0,msdos3'
      if [ x$feature_platform_search_hint = xy ]; then
        search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  1019184f-525c-4204-b825-21a1893eee5a
      else
        search --no-floppy --fs-uuid --set=root 1019184f-525c-4204-b825-21a1893eee5a
      fi
      echo   'Loading Linux 3.10.17-gentoo ...'
      linux   /boot/kernel-3.10.17-gentoo root=/dev/sda3 ro 
   }
   menuentry 'Gentoo GNU/Linux, with Linux 3.10.17-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.10.17-gentoo-recovery-1019184f-525c-4204-b825-21a1893eee5a' {
      load_video
      insmod gzio
      insmod part_msdos
      insmod ext2
      set root='hd0,msdos3'
      if [ x$feature_platform_search_hint = xy ]; then
        search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  1019184f-525c-4204-b825-21a1893eee5a
      else
        search --no-floppy --fs-uuid --set=root 1019184f-525c-4204-b825-21a1893eee5a
      fi
      echo   'Loading Linux 3.10.17-gentoo ...'
      linux   /boot/kernel-3.10.17-gentoo root=/dev/sda3 ro single
   }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### 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  ${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 ###


I followed the Gentoo handbook (en) to install (on MBR of /dev/sda) and configure (I used grub2-mkconfig -o /boot/grub/grub.cfg to generate the config file) grub2 . I also asked in #gentoo irc for this, and someone told me that it is normal because Windows 7 was installed in 'legacy mode' (but I don't know what it means). Thanks in advance, now I am restoring the MBR with Windows 7 repair disk waiting for solutions :)


Last edited by 310354 on Tue Dec 03, 2013 12:58 pm; edited 4 times in total
Back to top
View user's profile Send private message
eyoung100
Veteran
Veteran


Joined: 23 Jan 2004
Posts: 1428

PostPosted: Tue Nov 26, 2013 5:44 pm    Post subject: Reply with quote

Look at this post:
Grub2 - Windows 7
_________________
The Birth and Growth of Science is the Death and Atrophy of Art -- Unknown
Registerd Linux User #363735
Adopt a Post | Strip Comments| Emerge Wrapper
Back to top
View user's profile Send private message
310354
n00b
n00b


Joined: 01 Aug 2013
Posts: 59

PostPosted: Tue Nov 26, 2013 5:49 pm    Post subject: Reply with quote

jobug29 wrote:
post the entire contents of the RESULTS.txt file generated by the boot info script so we can see exactly your setup & boot process. Multi-boot: Arch linux, Ubuntu 13.04, Mint 13 & Windows 7


Code:
cat RESULTS.txt
                  Boot Info Script 0.61      [1 April 2012]


============================= 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
    in partition 99 for .

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:       ext4
    Boot sector type:  -
    Boot sector info:
    Operating System:   This is . ()
    Boot files:        /boot/grub/grub.cfg /etc/fstab

sda4: __________________________________________________________________________

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

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

Drive: sda _____________________________________________________________________

Disk /dev/sda: 750.2 GB, 750156374016 bytes, 1465149168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 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 1,198,530,559 1,198,323,712   7 NTFS / exFAT / HPFS
/dev/sda3       1,198,530,560 1,459,816,447   261,285,888  83 Linux
/dev/sda4       1,459,816,448 1,465,147,391     5,330,944  82 Linux swap / Solaris


"blkid" output: ________________________________________________________________

Device           UUID                                   TYPE       LABEL

/dev/sda1        14DE6CBEDE6C99AE                       ntfs       Riservato per il sistema
/dev/sda2        38F48EBEF48E7E3E                       ntfs       windows
/dev/sda3        1019184f-525c-4204-b825-21a1893eee5a   ext4       
/dev/sda4        7732eee8-97b5-4c45-b09d-736f31101cb4   swap       

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

Device           Mount_Point              Type       Options

/dev/sda3        /                        ext4       (rw,noatime,commit=0)


=========================== sda3/boot/grub/grub.cfg: ===========================

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

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

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 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_msdos
insmod ext2
set root='hd0,msdos3'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  1019184f-525c-4204-b825-21a1893eee5a
else
  search --no-floppy --fs-uuid --set=root 1019184f-525c-4204-b825-21a1893eee5a
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=
  insmod gettext
fi
terminal_output gfxterm
if sleep --interruptible 0 ; then
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-1019184f-525c-4204-b825-21a1893eee5a' {
   load_video
   insmod gzio
   insmod part_msdos
   insmod ext2
   set root='hd0,msdos3'
   if [ x$feature_platform_search_hint = xy ]; then
     search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  1019184f-525c-4204-b825-21a1893eee5a
   else
     search --no-floppy --fs-uuid --set=root 1019184f-525c-4204-b825-21a1893eee5a
   fi
   echo   'Loading Linux 3.10.17-gentoo ...'
   linux   /boot/kernel-3.10.17-gentoo root=/dev/sda3 ro 
}
submenu 'Advanced options for Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-1019184f-525c-4204-b825-21a1893eee5a' {
   menuentry 'Gentoo GNU/Linux, with Linux 3.10.17-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.10.17-gentoo-advanced-1019184f-525c-4204-b825-21a1893eee5a' {
      load_video
      insmod gzio
      insmod part_msdos
      insmod ext2
      set root='hd0,msdos3'
      if [ x$feature_platform_search_hint = xy ]; then
        search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  1019184f-525c-4204-b825-21a1893eee5a
      else
        search --no-floppy --fs-uuid --set=root 1019184f-525c-4204-b825-21a1893eee5a
      fi
      echo   'Loading Linux 3.10.17-gentoo ...'
      linux   /boot/kernel-3.10.17-gentoo root=/dev/sda3 ro 
   }
   menuentry 'Gentoo GNU/Linux, with Linux 3.10.17-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.10.17-gentoo-recovery-1019184f-525c-4204-b825-21a1893eee5a' {
      load_video
      insmod gzio
      insmod part_msdos
      insmod ext2
      set root='hd0,msdos3'
      if [ x$feature_platform_search_hint = xy ]; then
        search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  1019184f-525c-4204-b825-21a1893eee5a
      else
        search --no-floppy --fs-uuid --set=root 1019184f-525c-4204-b825-21a1893eee5a
      fi
      echo   'Loading Linux 3.10.17-gentoo ...'
      linux   /boot/kernel-3.10.17-gentoo root=/dev/sda3 ro single
   }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### 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  ${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 ###
--------------------------------------------------------------------------------

=============================== sda3/etc/fstab: ================================

--------------------------------------------------------------------------------
# /etc/fstab: static file system information.
#
# noatime turns off atimes for increased performance (atimes normally aren't
# needed); notail increases performance of ReiserFS (at the expense of storage
# efficiency).  It's safe to drop the noatime options if you want and to
# switch between notail / tail freely.
#
# The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
#
# See the manpage fstab(5) for more information.
#

# <fs>         <mountpoint>   <type>      <opts>      <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/sda3      /      ext4      noatime      0 1
/dev/sda4      none      swap      sw      0 0
--------------------------------------------------------------------------------

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

           GiB - GB             File                                 Fragment(s)


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

cat: /tmp/BootInfo-zGtNjlOM/Tmp_Log: No such file or directory
  No volume groups found
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Tue Nov 26, 2013 9:50 pm    Post subject: Reply with quote

Do you have os-prober installed? You need it before running grub2-mkconfig.
Back to top
View user's profile Send private message
310354
n00b
n00b


Joined: 01 Aug 2013
Posts: 59

PostPosted: Tue Nov 26, 2013 10:05 pm    Post subject: Reply with quote

eyoung100 wrote:
Look at this post:
Grub2 - Windows 7

It didn't work.. Thanks, anyway
Back to top
View user's profile Send private message
epsilon72
Guru
Guru


Joined: 20 Sep 2007
Posts: 568

PostPosted: Thu Nov 28, 2013 5:01 am    Post subject: Reply with quote

tant0c1b0, it looks like you need to install ' os-prober '. Emerge it and re-run grub2-mkconfig, like creaker said above.
Back to top
View user's profile Send private message
luciano
Tux's lil' helper
Tux's lil' helper


Joined: 18 Nov 2004
Posts: 132

PostPosted: Thu Nov 28, 2013 8:11 pm    Post subject: Reply with quote

I had the same problem; the guys above are right. Install that package, and it should auto-detect when you run grub-config.
Back to top
View user's profile Send private message
310354
n00b
n00b


Joined: 01 Aug 2013
Posts: 59

PostPosted: Thu Nov 28, 2013 9:47 pm    Post subject: Reply with quote

First of all, sorry for the wrong section (stupid..). Secondly: yep, I had to emerge os-prober and... It worked! Thank you all :) However, I had to re-emerge grub:2 in order to make os-prober find the Windows partition. How did you understand I missed os-prober?
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Tue Dec 03, 2013 7:43 am    Post subject: Reply with quote

tant0c1b0 wrote:
How did you understand I missed os-prober?

it is a most common mistake when grub doesn't see any other systems.
most of us passed this way
Back to top
View user's profile Send private message
nenemsis5
n00b
n00b


Joined: 23 Oct 2007
Posts: 72

PostPosted: Tue Dec 03, 2013 9:59 am    Post subject: Reply with quote

1) os-prober + grub2 dont work in chroot environment

2) after successfully installation of gentoo make

a) grub2-install /dev/sda
b) mkconfig -o /boot/grub/grub.cfg
c) emerge os-prober
d)reboot and start gentoo
e) exercute mkconfig -o /boot/grub/grub.cfg again
and grub2 will find also your windowX and your gentoo
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Tue Dec 03, 2013 12:10 pm    Post subject: Reply with quote

nenemsis5 wrote:
1) os-prober + grub2 dont work in chroot environment


it works, and finds all the systems, except the system, from which was chrooted.
Back to top
View user's profile Send private message
310354
n00b
n00b


Joined: 01 Aug 2013
Posts: 59

PostPosted: Tue Dec 03, 2013 12:57 pm    Post subject: Reply with quote

Thanks all :)
Back to top
View user's profile Send private message
kanliot
n00b
n00b


Joined: 05 Feb 2015
Posts: 1

PostPosted: Thu Feb 05, 2015 4:28 am    Post subject: Reply with quote

had exactly the same problem on new gentoo install.

had to menuconfig the kernel to make the fuse library in addition to these steps. also had to reboot as modprobe fuse didn't seem to help grub-mkconfig find windows for some reason. I dono. it's working now tho.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum