How can I make grub2 boot into Windows 7?

Posted by Grzenio on Super User See other posts from Super User or by Grzenio
Published on 2010-01-30T08:21:24Z Indexed on 2013/06/24 16:26 UTC
Read the original article Hit count: 204

Filed under:
|
|
|

I had Windows 7 installed on my system, then I installed Debian testing with grub2 as its boot manager. Initially I couldn't see windows entry in grub at all, so I ran:

aptitude install os-prober kcpuload 
update-grub

Now I can see the entry, but when I select it I get only Win7 system restore, instead of the the real thing. Any ides how to make it work?

EDIT: I tried the suggested approach to add a new file to /etc/grub.d, which generated an entry in grub.cfg, but it does not appear in the grub menu on boot :(

I have this:

grzes:/home/ga# cat /etc/grub.d/11_Windows
#! /bin/sh -e
echo Adding Windows >&2
cat << EOF
menuentry “Windows 7? {
        set root=(hd0,2)
        chainloader +1
}

And I have the following grub.cfg file:

grzes:/home/ga# cat /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 $prefix/grubenv ]; then    
  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                          
}                             
insmod ext2                   
set root=(hd0,3)              
search --no-floppy --fs-uuid --set 6ce3ff31-0ef7-41df-a6f5-b6b886db3a94
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                                                                                                                                                           
set locale_dir=/boot/grub/locale                                                                                                                             
set lang=en                                                                                                                                                  
insmod gettext                                                                                                                                               
set timeout=5                                                                                                                                                
### END /etc/grub.d/00_header ###  

© Super User or respective owner

Related posts about windows-7

Related posts about linux