PDA

View Full Version : Adding windows 7 grub entry



theowilde
July 31st, 2013, 11:29 PM
Hi guys,

I have installed ubuntu on my SSD , but i made a little mistake while installing the grub.

And now the windows 7 option doesn't come up at the grub loader.
But i can acces the HDD with in ubuntu.

I have tried to manually add the windows 7 entry but no luck.

It has been a while for me to run native linux on my system, so this will take time for me to fix on my own.

So with boot-repair i made a report, to ask you guys for your help.
Can anybody help to set my entry right?

http://paste.ubuntu.com/5934276/




#
# 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="menuentry ‘Windows 7′ {"

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='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 86992651-89b1-409e-bf98-dff05ae8e8ea
else
search --no-floppy --fs-uuid --set=root 86992651-89b1-409e-bf98-dff05ae8e8ea
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=10
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
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-86992651-89b1-409e-bf98-dff05ae8e8ea' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 86992651-89b1-409e-bf98-dff05ae8e8ea
else
search --no-floppy --fs-uuid --set=root 86992651-89b1-409e-bf98-dff05ae8e8ea
fi
linux /boot/vmlinuz-3.8.0-27-generic root=UUID=86992651-89b1-409e-bf98-dff05ae8e8ea ro quiet splash security=selinux selinux=1 $vt_handoff
initrd /boot/initrd.img-3.8.0-27-generic
}
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-86992651-89b1-409e-bf98-dff05ae8e8ea' {
menuentry 'Ubuntu, with Linux 3.8.0-27-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.8.0-27-generic-advanced-86992651-89b1-409e-bf98-dff05ae8e8ea' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 86992651-89b1-409e-bf98-dff05ae8e8ea
else
search --no-floppy --fs-uuid --set=root 86992651-89b1-409e-bf98-dff05ae8e8ea
fi
echo 'Loading Linux 3.8.0-27-generic ...'
linux /boot/vmlinuz-3.8.0-27-generic root=UUID=86992651-89b1-409e-bf98-dff05ae8e8ea ro quiet splash security=selinux selinux=1 $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.8.0-27-generic
}
menuentry 'Ubuntu, with Linux 3.8.0-27-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.8.0-27-generic-recovery-86992651-89b1-409e-bf98-dff05ae8e8ea' {
recordfail
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 86992651-89b1-409e-bf98-dff05ae8e8ea
else
search --no-floppy --fs-uuid --set=root 86992651-89b1-409e-bf98-dff05ae8e8ea
fi
echo 'Loading Linux 3.8.0-27-generic ...'
linux /boot/vmlinuz-3.8.0-27-generic root=UUID=86992651-89b1-409e-bf98-dff05ae8e8ea ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.8.0-27-generic
}
menuentry 'Ubuntu, with Linux 3.8.0-19-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.8.0-19-generic-advanced-86992651-89b1-409e-bf98-dff05ae8e8ea' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 86992651-89b1-409e-bf98-dff05ae8e8ea
else
search --no-floppy --fs-uuid --set=root 86992651-89b1-409e-bf98-dff05ae8e8ea
fi
echo 'Loading Linux 3.8.0-19-generic ...'
linux /boot/vmlinuz-3.8.0-19-generic root=UUID=86992651-89b1-409e-bf98-dff05ae8e8ea ro quiet splash security=selinux selinux=1 $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.8.0-19-generic
}
menuentry 'Ubuntu, with Linux 3.8.0-19-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.8.0-19-generic-recovery-86992651-89b1-409e-bf98-dff05ae8e8ea' {
recordfail
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 86992651-89b1-409e-bf98-dff05ae8e8ea
else
search --no-floppy --fs-uuid --set=root 86992651-89b1-409e-bf98-dff05ae8e8ea
fi
echo 'Loading Linux 3.8.0-19-generic ...'
linux /boot/vmlinuz-3.8.0-19-generic root=UUID=86992651-89b1-409e-bf98-dff05ae8e8ea ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.8.0-19-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+ ###
menuentry "Memory test (memtest86+)" {
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 86992651-89b1-409e-bf98-dff05ae8e8ea
else
search --no-floppy --fs-uuid --set=root 86992651-89b1-409e-bf98-dff05ae8e8ea
fi
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 86992651-89b1-409e-bf98-dff05ae8e8ea
else
search --no-floppy --fs-uuid --set=root 86992651-89b1-409e-bf98-dff05ae8e8ea
fi
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### 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=’(hd1,msdos2)’
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 ###


Thank you in advanced :)

Greetings,
Theo

oldfred
August 1st, 2013, 12:39 AM
When Windows 7 (or 8) installs it has a (hidden) 100MB boot/repair partition that it installs to the drive you boot from with BIOS. I think you SSD was the boot drive when you installed Windows so the Windows boot partition was on the SSD. So your install is missing the boot files in sdb1 and grub cannot find it to let you boot it.

You have to run Windows repairs. You can just add the boot files & BCD to the Windows install as it will boot from one partition. The main reason for the separate /boot was to allow encryption of the main install as boot files could not be encrypted. The boot partition also has the repair console which then may allow repairs if main install is broken but boot partition is ok. Better to have repairCD or flash drive anyway.

Vista/7 (with 7 the first two files are usually in a separate 100MB boot partition)
/bootmgr /Boot/BCD /Windows/System32/winload.exe

Some have just copied bootmgr into an install then used bcdEdit to create the new BCD. Not sure what other files are in Boot partition, but most may be for the repari console.


http://www.sevenforums.com/tutorials/681-startup-repair.html
http://www.w7forums.com/startup-repair-t441.html
http://www.bleepingcomputer.com/tutorials/tutorial148.html

theowilde
August 1st, 2013, 12:26 PM
Thank you for your reply!

Now that you mention it, there was a 100mb partition on the SSD before in installed ubuntu, i thought i made a mistake in paritioning the drives.
So i deleted the partition :Stupid: i didnt really looked what the partition was, i have tried to use the boot repair of the windows 7 CD but no luck, is there a other way i can create the /boot partition for the windows and repair it?
Or do i need to start crying, because i really need to reinstall windows? ( It takes sooo much time to get everything right again...) i really need that ****** windows for the applications for at the office.

So if anybody can point me in the right way, that would be awsome.

oldfred
August 1st, 2013, 03:52 PM
You do not need Windows boot partition. Make sure boot flag is on your sdb1 partition as it was in BootInfo report, set BIOS to boot sdb and run the Windows repairs. If that does not work, just copy bootmgr into the c: drive and create the /boot/BCD file with editBCD.
Some have used EasyBCD, but I do not suggest using it to dual boot as I prefer grub. But you should have the Windows boot loader on sdb and make sdb be a fully bootable Windows drive with no other drive installed.
http://neosmart.net/blog/

theowilde
August 2nd, 2013, 06:47 PM
Thank you oldfred!!

This was very helpful for me!
Now i need to solve the rest of my linux problems, but those are driver related so thats a job for a different day :)