Windows 7 doesn't appear in grub list, but still exists
Hello together!
I'm new to linux and wanted to try it out a couple of weeks ago. So far I'm quiet happy with it, but I still need to use Windows for professional reasons. After a Linux reinstallation, I can not choose between Linux and Windows in the grub list. The remaining options there are: Ununtu, Advanced Ubuntu Options, and the two memory tests.
I tried so far:
$ sudo update-grub
$ grub-install /dev/sda
but it didn't help. I also ran fdisk -lu and here is what I got:
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x19c4dbcd
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 158205172 79101562+ 7 HPFS/NTFS/exFAT
/dev/sda2 209717248 312575999 51429376 7 HPFS/NTFS/exFAT
/dev/sda3 158207998 209717247 25754625 5 Extended
/dev/sda5 158208000 203263999 22528000 83 Linux
/dev/sda6 203266048 209717247 3225600 82 Linux swap / Solaris
Partition table entries are not in disk order
I also ran the bootinfoscript and will post the result file below. Unfortunately I cannot really conclude anything from this file. Further more I DON'T HAVE A WINDOWS CD here.
Here the bootinfoscript file:
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 72 for .
sda1: __________________________________________________ ________________________
File system:
Boot sector type: Windows Vista/7: NTFS
Boot sector info:
Mounting failed: mount: unknown filesystem type ''
sda2: __________________________________________________ ________________________
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:
sda3: __________________________________________________ ________________________
File system: Extended Partition
Boot sector type: -
Boot sector info:
sda5: __________________________________________________ ________________________
File system: ext3
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 12.10
Boot files: /boot/grub/grub.cfg /etc/fstab
sda6: __________________________________________________ ________________________
File system: swap
Boot sector type: -
Boot sector info:
============================ Drive/Partition Info: =============================
Drive: sda __________________________________________________ ___________________
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 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 * 2,048 158,205,172 158,203,125 7 NTFS / exFAT / HPFS
/dev/sda2 209,717,248 312,575,999 102,858,752 7 NTFS / exFAT / HPFS
/dev/sda3 158,207,998 209,717,247 51,509,250 5 Extended
/dev/sda5 158,208,000 203,263,999 45,056,000 83 Linux
/dev/sda6 203,266,048 209,717,247 6,451,200 82 Linux swap / Solaris
"blkid" output: __________________________________________________ ______________
Device UUID TYPE LABEL
================================ Mount points: =================================
Device Mount_Point Type Options
/dev/sda5 / ext3 (rw,errors=remount-ro)
=========================== sda5/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_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 da1c9173-a29b-4843-9b8d-2ac8495d99cc
else
search --no-floppy --fs-uuid --set=root da1c9173-a29b-4843-9b8d-2ac8495d99cc
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-da1c9173-a29b-4843-9b8d-2ac8495d99cc' {
recordfail
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 da1c9173-a29b-4843-9b8d-2ac8495d99cc
else
search --no-floppy --fs-uuid --set=root da1c9173-a29b-4843-9b8d-2ac8495d99cc
fi
linux /boot/vmlinuz-3.5.0-26-generic root=UUID=da1c9173-a29b-4843-9b8d-2ac8495d99cc ro quiet splash $vt_handoff
initrd /boot/initrd.img-3.5.0-26-generic
}
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-da1c9173-a29b-4843-9b8d-2ac8495d99cc' {
menuentry 'Ubuntu, with Linux 3.5.0-26-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.5.0-26-generic-advanced-da1c9173-a29b-4843-9b8d-2ac8495d99cc' {
recordfail
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 da1c9173-a29b-4843-9b8d-2ac8495d99cc
else
search --no-floppy --fs-uuid --set=root da1c9173-a29b-4843-9b8d-2ac8495d99cc
fi
echo 'Loading Linux 3.5.0-26-generic ...'
linux /boot/vmlinuz-3.5.0-26-generic root=UUID=da1c9173-a29b-4843-9b8d-2ac8495d99cc ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.5.0-26-generic
}
menuentry 'Ubuntu, with Linux 3.5.0-26-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.5.0-26-generic-recovery-da1c9173-a29b-4843-9b8d-2ac8495d99cc' {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 da1c9173-a29b-4843-9b8d-2ac8495d99cc
else
search --no-floppy --fs-uuid --set=root da1c9173-a29b-4843-9b8d-2ac8495d99cc
fi
echo 'Loading Linux 3.5.0-26-generic ...'
linux /boot/vmlinuz-3.5.0-26-generic root=UUID=da1c9173-a29b-4843-9b8d-2ac8495d99cc ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.5.0-26-generic
}
menuentry 'Ubuntu, with Linux 3.5.0-25-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.5.0-25-generic-advanced-da1c9173-a29b-4843-9b8d-2ac8495d99cc' {
recordfail
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 da1c9173-a29b-4843-9b8d-2ac8495d99cc
else
search --no-floppy --fs-uuid --set=root da1c9173-a29b-4843-9b8d-2ac8495d99cc
fi
echo 'Loading Linux 3.5.0-25-generic ...'
linux /boot/vmlinuz-3.5.0-25-generic root=UUID=da1c9173-a29b-4843-9b8d-2ac8495d99cc ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.5.0-25-generic
}
menuentry 'Ubuntu, with Linux 3.5.0-25-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.5.0-25-generic-recovery-da1c9173-a29b-4843-9b8d-2ac8495d99cc' {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 da1c9173-a29b-4843-9b8d-2ac8495d99cc
else
search --no-floppy --fs-uuid --set=root da1c9173-a29b-4843-9b8d-2ac8495d99cc
fi
echo 'Loading Linux 3.5.0-25-generic ...'
linux /boot/vmlinuz-3.5.0-25-generic root=UUID=da1c9173-a29b-4843-9b8d-2ac8495d99cc ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.5.0-25-generic
}
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-da1c9173-a29b-4843-9b8d-2ac8495d99cc' {
recordfail
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 da1c9173-a29b-4843-9b8d-2ac8495d99cc
else
search --no-floppy --fs-uuid --set=root da1c9173-a29b-4843-9b8d-2ac8495d99cc
fi
echo 'Loading Linux 3.5.0-17-generic ...'
linux /boot/vmlinuz-3.5.0-17-generic root=UUID=da1c9173-a29b-4843-9b8d-2ac8495d99cc 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-da1c9173-a29b-4843-9b8d-2ac8495d99cc' {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 da1c9173-a29b-4843-9b8d-2ac8495d99cc
else
search --no-floppy --fs-uuid --set=root da1c9173-a29b-4843-9b8d-2ac8495d99cc
fi
echo 'Loading Linux 3.5.0-17-generic ...'
linux /boot/vmlinuz-3.5.0-17-generic root=UUID=da1c9173-a29b-4843-9b8d-2ac8495d99cc 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+ ###
menuentry "Memory test (memtest86+)" {
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 da1c9173-a29b-4843-9b8d-2ac8495d99cc
else
search --no-floppy --fs-uuid --set=root da1c9173-a29b-4843-9b8d-2ac8495d99cc
fi
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 da1c9173-a29b-4843-9b8d-2ac8495d99cc
else
search --no-floppy --fs-uuid --set=root da1c9173-a29b-4843-9b8d-2ac8495d99cc
fi
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
if [ "x${timeout}" != "x-1" ]; then
if keystatus; then
if keystatus --shift; then
set timeout=-1
else
set timeout=0
fi
else
if sleep --interruptible 3 ; then
set timeout=0
fi
fi
fi
### 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 ###
--------------------------------------------------------------------------------
=============================== sda5/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/sda5 during installation
UUID=da1c9173-a29b-4843-9b8d-2ac8495d99cc / ext3 errors=remount-ro 0 1
# swap was on /dev/sda6 during installation
UUID=411ac84f-dd87-442b-a5d4-78b8ea75f07d none swap sw 0 0
--------------------------------------------------------------------------------
=================== sda5: Location of files loaded by Grub: ====================
GiB - GB File Fragment(s)
= boot/grub/grub.cfg 1
= boot/initrd.img-3.5.0-17-generic 22
= boot/initrd.img-3.5.0-25-generic 9
= boot/initrd.img-3.5.0-26-generic 46
= boot/vmlinuz-3.5.0-17-generic 4
= boot/vmlinuz-3.5.0-25-generic 4
= boot/vmlinuz-3.5.0-26-generic 3
= initrd.img 46
= initrd.img.old 9
= vmlinuz 3
= vmlinuz.old 4
=============================== 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
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
cat: /tmp/BootInfo-37Bp2VQT/BLKID_summary: No such file or directory
I really need to get my Windows back to work and would like to keep Linux for personal use
I appreciate any help and please let me know if you need more information.
Thank you so much!!
Rob
Re: Windows 7 doesn't appear in grub list, but still exists
Welcome to the forums!
Try update-grub2
Also, can you post the output of update-grub please?
Re: Windows 7 doesn't appear in grub list, but still exists
When grub runs the update-grub, it also runs os-prober to find other operating systems. But if it cannot find any, it does not add them to the menu.
Boot script was not able to open sda1 which probably is your Windows install as partition table says it is NTFS and has boot flag.
If Linux cannot mount it, it may need chkdsk or you left it hibernated. Both chkdsk & hibernation set flags that Linux sees to not mount a NTFS partition and cause more issues.
From your Windows repairCD or Flash drive, try running chkdsk.
Vista or 7 repair
Comments by others:
Repair often does not work, some say run 3 times others recommend the command line bootrec.exe
Always run chkdsk and run again until there are no errors, that may be all that is required
chkdsk c: /b
/b includes /r
http://technet.microsoft.com/en-us/l...=ws.10%29.aspx
Re: Windows 7 doesn't appear in grub list, but still exists
+1 to oldfred's suggestion. Get your win7 dvd or rescue cd (or make one rescue cd on any win7 computer at a friend) and run chkdsk from the repair command prompt. That should be the first step.
When the chkdsk is done you can try booting ubuntu and running update-grub to see if it will detect it.
I also don't like that the boot info says grub2 on /dev/sda is looking for partition 72 which is not true. But I think it can work as it is, your ubuntu seems to be booting fine.
Re: Windows 7 doesn't appear in grub list, but still exists
Hi and thanks for the fast replys!
@ Virtuality314: I tried update-grub2 and that's what it sais:
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.5.0-26-generic
Found initrd image: /boot/initrd.img-3.5.0-26-generic
Found linux image: /boot/vmlinuz-3.5.0-25-generic
Found initrd image: /boot/initrd.img-3.5.0-25-generic
Found linux image: /boot/vmlinuz-3.5.0-17-generic
Found initrd image: /boot/initrd.img-3.5.0-17-generic
Found memtest86+ image: /boot/memtest86+.bin
done
To get a Win rescue DVD I might have to wait until monday to ask work colleagues.
Once I have it, I boot with the DVD inserted and will run the chkdsk command in the repair command prompt. Then I should try to reboot Ubuntu and update grub again. This might help me. Is this correct so far?
Would the exact commands be?:
chkdsk c: /b
/b includes /r
Thanks a lot! Once its solved I'll definitely mark it that way!
1 Attachment(s)
Re: Windows 7 doesn't appear in grub list, but still exists
I actually get this screen just after the moment where grub is supposed to appear:
Attachment 240458
Maybe this is related to the Windows partition...
THX
Re: Windows 7 doesn't appear in grub list, but still exists
Re: Windows 7 doesn't appear in grub list, but still exists
I have no idea what that error means. But since the boot info script can't open the ntfs partitions sda1 and sda2 to look inside, there is definitely something wrong with them. For that reason, the win7 boot files are not even detected and no entry is made in the grub boot menu.
Yes, run the chkdsk and see how it goes with sudo update-grub after that. On occasions you might need to run chkdsk few times, but run it once for a start.
Re: Windows 7 doesn't appear in grub list, but still exists
Hi again,
so I created a Win7 32-bit recovery CD today at work and just tried to boot from it but it doesn't work. The CD definitely starts turning and I get a message at the very beginning of the boot process saying: "Press any key to boot from CD/DVD..." and so I do but the CD stops spinning and the screen stays just black. Furthermore I can't see the disk on Linux (at least it doesn't show up in Dolphin and there's no device notification). When I then started to boot Linux, I also got an unusual screen, saying something like: (appr. 20 lines like that)
end_request: I/O error, dev sr0, sector *some number*
Buffer I/O error on device sr0, logical block *some number*
After having burned the CD today, I checked the content and I could clearly see a file called "bootmgr" and two folders: "sources" and "boot". I actually downloaded the iso file because everybody at work runs 64-bit Win7 OS.
Can anybody help? Thanks so much!
Re: Windows 7 doesn't appear in grub list, but still exists
Sounds like it is not a bootable CD, or not correctly burned. Often best to write at slowest speed your CD/DVD allows.
I now prefer flash drives, but the Windows repair install is tiny or 256 to 300MB. I ended up repartitioning it, installing grub2 over the top of Windows and chain loading back to Windows and adding a bunch of Linux repair ISO to boot directly from grub, to have an all in one repair flash drive.
Make your own Windows repairCD (not vendor recovery):
http://forums.techarena.in/guides-tutorials/1114725.htm
Windows users only - Silverlight
http://windows.microsoft.com/en-GB/w...em-repair-disc
Windows 7 repair USB, Also Vista if service pack installed
http://www.intowindows.com/how-to-re...tion-dvd-disc/
http://www.webupd8.org/2010/10/creat...usb-drive.html