LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-17-2014, 10:19 AM   #16
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,872

Rep: Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249

Quote:
All solutions I found put Windows to grub2.cfg but NOT actually create any entry to menu in GRUB.
Does that mean you see a windows entry in the grub2.cfg file but do not see it on boot? Some distributions which have switched to Grub2 have a grub directory as well as a grub2 directory. Do you have a grub directory in your boot directory as well? You might go to the site below and download and run the bootinfoscript and view the output, a results.txt file or post it here. Do this on CentOS and read the instructions in the link in the Description box. It will provide more details on your boot files, drives and partitions which might help resolve the problem.

http://sourceforge.net/projects/bootinfoscript/
 
1 members found this post helpful.
Old 08-18-2014, 06:07 PM   #17
Hopsahejsa
LQ Newbie
 
Registered: Aug 2014
Distribution: CentOS 7
Posts: 21

Rep: Reputation: 0
Thanks for bearing with me...
My grub folder in /boot contains only file splash.xpm.gz

Here is the output of the script:


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, but core.img can not be found at this
location.

sda1: __________________________________________________________________________

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

sda2: __________________________________________________________________________

File system: xfs
Boot sector type: -
Boot sector info:
Operating System:
Boot files: /grub2/grub.cfg

sda3: __________________________________________________________________________

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

centos-root': __________________________________________________________________

File system:
Boot sector type: Unknown
Boot sector info:
Mounting failed: mount: unknown filesystem type ''

centos-home': __________________________________________________________________

File system:
Boot sector type: Unknown
Boot sector info:
Mounting failed: mount: unknown filesystem type ''
mount: unknown filesystem type ''

centos-swap': __________________________________________________________________

File system:
Boot sector type: Unknown
Boot sector info:
Mounting failed: mount: unknown filesystem type ''
mount: unknown filesystem type ''
mount: unknown filesystem type ''

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

Drive: sda _____________________________________________________________________

Disk /dev/sda: 512.1 GB, 512110190592 bytes, 1000215216 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

Partition Boot Start Sector End Sector # of Sectors Id System

/dev/sda1 * 2,048 701,765,631 701,763,584 7 NTFS / exFAT / HPFS
/dev/sda2 701,765,632 702,789,631 1,024,000 83 Linux
/dev/sda3 702,789,632 1,000,214,527 297,424,896 8e Linux LVM


"blkid" output: ________________________________________________________________

Device UUID TYPE LABEL

/dev/mapper/centos-home d9fd154a-2712-4bb2-97c3-659eb4b59916 xfs
/dev/mapper/centos-root 55d59e60-001f-4d87-96f1-d54e29bdbd0e xfs
/dev/mapper/centos-swap 31f2b4bb-59b8-4fa6-bf1b-69392bc163e2 swap
/dev/sda1 387052087051CCEE ntfs Windows
/dev/sda2 5c133d63-4da7-4ec2-811f-10a3f35ef84d xfs
/dev/sda3 ZXOeaU-r3Bb-fpva-qcox-Ah5T-4UeM-F5TeQH LVM2_member

========================= "ls -R /dev/mapper/" output: =========================

/dev/mapper:
centos-home
centos-root
centos-swap
control

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

Device Mount_Point Type Options

/dev/mapper/centos-home /home xfs (rw,relatime,seclabel,attr2,inode64,noquota)
/dev/mapper/centos-root / xfs (rw,relatime,seclabel,attr2,inode64,noquota)
/dev/sda2 /boot xfs (rw,relatime,seclabel,attr2,inode64,noquota)


============================= sda2/grub2/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 ###
set pager=1

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="${saved_entry}"
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
}

terminal_output console
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'CentOS Linux (3.10.0-123.6.3.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-123.el7.x86_64-advanced-55d59e60-001f-4d87-96f1-d54e29bdbd0e' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod xfs
set root='hd0,msdos2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 --hint='hd0,msdos2' 5c133d63-4da7-4ec2-811f-10a3f35ef84d
else
search --no-floppy --fs-uuid --set=root 5c133d63-4da7-4ec2-811f-10a3f35ef84d
fi
linux16 /vmlinuz-3.10.0-123.6.3.el7.x86_64 root=/dev/mapper/centos-root ro rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos/root crashkernel=auto vconsole.keymap=us rhgb quiet LANG=en_US.UTF-8
initrd16 /initramfs-3.10.0-123.6.3.el7.x86_64.img
}
menuentry 'CentOS Linux, with Linux 3.10.0-123.el7.x86_64' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-123.el7.x86_64-advanced-55d59e60-001f-4d87-96f1-d54e29bdbd0e' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod xfs
set root='hd0,msdos2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 --hint='hd0,msdos2' 5c133d63-4da7-4ec2-811f-10a3f35ef84d
else
search --no-floppy --fs-uuid --set=root 5c133d63-4da7-4ec2-811f-10a3f35ef84d
fi
linux16 /vmlinuz-3.10.0-123.el7.x86_64 root=UUID=55d59e60-001f-4d87-96f1-d54e29bdbd0e ro rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos/root crashkernel=auto vconsole.keymap=us rhgb quiet LANG=en_US.UTF-8
initrd16 /initramfs-3.10.0-123.el7.x86_64.img
}
menuentry 'CentOS Linux, with Linux 0-rescue-56a5525b6585421c9014090c1b0b09ac' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-56a5525b6585421c9014090c1b0b09ac-advanced-55d59e60-001f-4d87-96f1-d54e29bdbd0e' {
load_video
insmod gzio
insmod part_msdos
insmod xfs
set root='hd0,msdos2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 --hint='hd0,msdos2' 5c133d63-4da7-4ec2-811f-10a3f35ef84d
else
search --no-floppy --fs-uuid --set=root 5c133d63-4da7-4ec2-811f-10a3f35ef84d
fi
linux16 /vmlinuz-0-rescue-56a5525b6585421c9014090c1b0b09ac root=UUID=55d59e60-001f-4d87-96f1-d54e29bdbd0e ro rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos/root crashkernel=auto vconsole.keymap=us rhgb quiet
initrd16 /initramfs-0-rescue-56a5525b6585421c9014090c1b0b09ac.img
}
if [ "x$default" = 'CentOS Linux, with Linux 3.10.0-123.el7.x86_64' ]; then default='Advanced options for CentOS Linux>CentOS Linux, with Linux 3.10.0-123.el7.x86_64'; fi;
### 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_ppc_terminfo ###
### END /etc/grub.d/20_ppc_terminfo ###

### 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 ###
--------------------------------------------------------------------------------

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

GiB - GB File Fragment(s)


================= sda2: Location of files loaded by Syslinux: ==================

GiB - GB File Fragment(s)


============== sda2: Version of COM32(R) files used by Syslinux: ===============

extlinux/cat.c32 : COM32R module (v4.xx)
extlinux/chain.c32 : COM32R module (v4.xx)
extlinux/cmd.c32 : COM32R module (v4.xx)
extlinux/config.c32 : COM32R module (v4.xx)
extlinux/cpuid.c32 : COM32R module (v4.xx)
extlinux/cpuidtest.c32 : COM32R module (v4.xx)
extlinux/disk.c32 : COM32R module (v4.xx)
extlinux/dmitest.c32 : COM32R module (v4.xx)
extlinux/elf.c32 : COM32R module (v4.xx)
extlinux/ethersel.c32 : COM32R module (v4.xx)
extlinux/gfxboot.c32 : COM32R module (v4.xx)
extlinux/gpxecmd.c32 : COM32R module (v4.xx)
extlinux/hdt.c32 : COM32R module (v4.xx)
extlinux/host.c32 : COM32R module (v4.xx)
extlinux/ifcpu64.c32 : COM32R module (v4.xx)
extlinux/ifcpu.c32 : COM32R module (v4.xx)
extlinux/ifplop.c32 : COM32R module (v4.xx)
extlinux/kbdmap.c32 : COM32R module (v4.xx)
extlinux/linux.c32 : COM32R module (v4.xx)
extlinux/ls.c32 : COM32R module (v4.xx)
extlinux/lua.c32 : COM32R module (v4.xx)
extlinux/mboot.c32 : COM32R module (v4.xx)
extlinux/meminfo.c32 : COM32R module (v4.xx)
extlinux/menu.c32 : COM32R module (v4.xx)
extlinux/pcitest.c32 : COM32R module (v4.xx)
extlinux/pmload.c32 : COM32R module (v4.xx)
extlinux/pwd.c32 : COM32R module (v4.xx)
extlinux/reboot.c32 : COM32R module (v4.xx)
extlinux/rosh.c32 : COM32R module (v4.xx)
extlinux/sanboot.c32 : COM32R module (v4.xx)
extlinux/sdi.c32 : COM32R module (v4.xx)
extlinux/sysdump.c32 : COM32R module (v4.xx)
extlinux/vesainfo.c32 : COM32R module (v4.xx)
extlinux/vesamenu.c32 : COM32R module (v4.xx)
extlinux/vpdtest.c32 : COM32R module (v4.xx)
extlinux/whichsys.c32 : COM32R module (v4.xx)
extlinux/zzjson.c32 : COM32R module (v4.xx)

======================== Unknown MBRs/Boot Sectors/etc: ========================

Unknown BootLoader on centos-root'


Unknown BootLoader on centos-home'


Unknown BootLoader on centos-swap'



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

cat: /tmp/BootInfo-KbQEKL4i/Tmp_Log: No such file or directory
cat: /tmp/BootInfo-KbQEKL4i/Tmp_Log: No such file or directory
One or more specified logical volume(s) not found.
One or more specified logical volume(s) not found.
One or more specified logical volume(s) not found.
hexdump: /dev/mapper/centos-root': No such file or directory
hexdump: stdin: Bad file descriptor
hexdump: /dev/mapper/centos-root': No such file or directory
hexdump: all input file arguments failed
One or more specified logical volume(s) not found.
One or more specified logical volume(s) not found.
One or more specified logical volume(s) not found.
hexdump: /dev/mapper/centos-home': No such file or directory
hexdump: stdin: Bad file descriptor
hexdump: /dev/mapper/centos-home': No such file or directory
hexdump: all input file arguments failed
One or more specified logical volume(s) not found.
One or more specified logical volume(s) not found.
One or more specified logical volume(s) not found.
hexdump: /dev/mapper/centos-swap': No such file or directory
hexdump: stdin: Bad file descriptor
hexdump: /dev/mapper/centos-swap': No such file or directory
hexdump: all input file arguments failed
mdadm: No arrays found in config file or automatically

================================================================

In grub2.cfg I have:


# 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 ###
set pager=1

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="${saved_entry}"
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
}

terminal_output console
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'CentOS Linux, with Linux 3.10.0-123.el7.x86_64' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-123.el7.x86_64-advanced-55d59e60-001f-4d87-96f1-d54e29bdbd0e' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod xfs
set root='hd0,msdos2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 --hint='hd0,msdos2' 5c133d63-4da7-4ec2-811f-10a3f35ef84d
else
search --no-floppy --fs-uuid --set=root 5c133d63-4da7-4ec2-811f-10a3f35ef84d
fi
linux16 /vmlinuz-3.10.0-123.el7.x86_64 root=UUID=55d59e60-001f-4d87-96f1-d54e29bdbd0e ro rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos/root crashkernel=auto vconsole.keymap=us rhgb quiet
initrd16 /initramfs-3.10.0-123.el7.x86_64.img
}
menuentry 'CentOS Linux, with Linux 3.10.0-123.6.3.el7.x86_64' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-123.6.3.el7.x86_64-advanced-55d59e60-001f-4d87-96f1-d54e29bdbd0e' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod xfs
set root='hd0,msdos2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 --hint='hd0,msdos2' 5c133d63-4da7-4ec2-811f-10a3f35ef84d
else
search --no-floppy --fs-uuid --set=root 5c133d63-4da7-4ec2-811f-10a3f35ef84d
fi
linux16 /vmlinuz-3.10.0-123.6.3.el7.x86_64 root=UUID=55d59e60-001f-4d87-96f1-d54e29bdbd0e ro rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos/root crashkernel=auto vconsole.keymap=us rhgb quiet
initrd16 /initramfs-3.10.0-123.6.3.el7.x86_64.img
}
menuentry 'CentOS Linux, with Linux 0-rescue-56a5525b6585421c9014090c1b0b09ac' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-56a5525b6585421c9014090c1b0b09ac-advanced-55d59e60-001f-4d87-96f1-d54e29bdbd0e' {
load_video
insmod gzio
insmod part_msdos
insmod xfs
set root='hd0,msdos2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 --hint='hd0,msdos2' 5c133d63-4da7-4ec2-811f-10a3f35ef84d
else
search --no-floppy --fs-uuid --set=root 5c133d63-4da7-4ec2-811f-10a3f35ef84d
fi
linux16 /vmlinuz-0-rescue-56a5525b6585421c9014090c1b0b09ac root=UUID=55d59e60-001f-4d87-96f1-d54e29bdbd0e ro rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos/root crashkernel=auto vconsole.keymap=us rhgb quiet
initrd16 /initramfs-0-rescue-56a5525b6585421c9014090c1b0b09ac.img
}

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

### BEGIN /etc/grub.d/15_Win7 ###
menuentry "Windows" {
set root=(hd0,1)
chainloader +1
}
### END /etc/grub.d/15_Win7 ###

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

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

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows 7 (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-387052087051CCEE' {
insmod part_msdos
insmod ntfs
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1' 387052087051CCEE
else
search --no-floppy --fs-uuid --set=root 387052087051CCEE
fi
chainloader +1
}
### 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 ###
 
Old 08-18-2014, 07:14 PM   #18
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,872

Rep: Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249
You indicate in your last post that you have both a grub.cfg file as well as a grub2.cfg file. The bootinfoscript output shows grub.cfg with no entry for windows. At the end of your post where you inidcate "In grub2.cfg I have:" and you post another grub2.cfg file. This second file has an entry for windows. What I would do is copy that windows entry to the grub.cfg file, save it and reboot to see if you have the windows entry and can boot. If that doesn't work, I have no idea as I don't use CentOS and don't know what modifications they might have made. If you are able to boot, then copy that windows entry to the 40_custom file, save and then run grub-mkconfig.
 
2 members found this post helpful.
Old 08-19-2014, 10:10 AM   #19
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181
I recently hit the same issues described in this thread: I installed Centos 7 after Windows 7. The grub installer did not automatically detect Windows. When I later ran grub2-mkconfig, the os-prober did not detect Windows.

I manually edited /etc/grub.d/40_custom trying a few different sets of contents that I found with google searches, several of which might have worked if I hadn't been confused and trying to boot Windows from sda3 (which is my Windows C partition). This copy of Windows had been booting sda3 through the recovery partition sda2. sda3 by itself was not bootable. Once I realized that, I used the following /etc/grub.d/40_custom, which (when I next used grub2-mkconfig) inserted itself into /boot/grub2/grub.cfg and worked (which directory, file and command names have the "2" after "grub" and which don't seems to be a strange mix that I have not seen in other distributions using grub2. Be careful to get each of those right when working with grub2 in Centos 7).

Code:
### 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" {
        insmod part_msdos
           set root='hd0,msdos2'
        chainloader +1
}
Note the above probably depends on having an old style partition table (on my 1TB disk). I haven't tried any of this on a bigger disk with a new style partition.

After verifying that worked, I enabled the EPEL repository and installed ntfs-3g (which is something I expect anyone dual booting Windows 7 and Centos 7 should do). Then I reran grub2-mkconfig and now os-prober detects the bootable Windows on sda2 and sets up a slightly more complicated menuentry for it. I haven't tested it yet, but it looks like it ought to work.

I'm not certain, but I think installing ntfs-3g was the reason os-prober now works. That is strange because sda2 (where the Windows 7 boot code is) is not ntfs. sda3 (the C partition) is ntfs but os-prober found the Windows boot on sda2. Maybe it needed to read sda3 in order to act on what it saw in sda2.

So, probably there was never any need to search grub2 info online and manually edit /etc/grub.d/40_custom. I just needed to install ntfs-3g and then rerun
Code:
grub2-mkconfig -o /boot/grub2/grub.cfg
Quote:
Originally Posted by yancek View Post
output shows grub.cfg with no entry for windows. At the end of your post where you inidcate "In grub2.cfg I have:" and you post another grub2.cfg file. This second file has an entry for windows. What I would do is copy that windows entry to the grub.cfg file, save it and reboot to see if you have the windows entry and can boot.
I think that is the correct answer for Hopsahejs. In the following command there is a 2 after "grub" in only two of the three places "grub" occurs:
Code:
grub2-mkconfig -o /boot/grub2/grub.cfg

Last edited by johnsfine; 08-19-2014 at 10:38 AM.
 
1 members found this post helpful.
Old 08-19-2014, 10:34 AM   #20
Hopsahejsa
LQ Newbie
 
Registered: Aug 2014
Distribution: CentOS 7
Posts: 21

Rep: Reputation: 0
I added the entry to /boot/grub2/grub.cfg manually (which I was origially afraid of) and it is working now. Thanks

I just do not understand why there are two grub configs in the folder.
But as johnsfine stated it seems to be only in Centos7.

I am glad it is solved. Thanks...
 
Old 08-19-2014, 11:42 AM   #21
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181
Quote:
Originally Posted by Hopsahejsa View Post
I just do not understand why there are two grub configs in the folder.
/boot/grub2/grub.cfg is the correct file and existed (I assume with incorrect contents) before you started trying to fix your problem.

/boot/grub2/grub2.cfg was created by a mistake in your use of grub2-mkconfig. It is there because YOU put it there. You ought to delete it to reduce future confusion.

The random mixing of the name grub or grub2 in the way this was all set up certainly contributed to your mistake.
 
1 members found this post helpful.
Old 08-19-2014, 12:21 PM   #22
Hopsahejsa
LQ Newbie
 
Registered: Aug 2014
Distribution: CentOS 7
Posts: 21

Rep: Reputation: 0
Nice explanation. Cheers!
 
Old 08-21-2014, 03:01 AM   #23
Mridulj
Member
 
Registered: Jan 2008
Posts: 48

Original Poster
Rep: Reputation: 15
this is my output of grub.cfg
which does not quite match with the one posted above

#
# 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 ###
set pager=1

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="${saved_entry}"
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
}

terminal_output console
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'CentOS Linux, with Linux 3.10.0-123.el7.x86_64' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-123.el7.x86_64-advanced-aad7538b-39be-480e-9d10-f863b33cdb65' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod xfs
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 --hint='hd0,msdos7' aad7538b-39be-480e-9d10-f863b33cdb65
else
search --no-floppy --fs-uuid --set=root aad7538b-39be-480e-9d10-f863b33cdb65
fi
linux16 /boot/vmlinuz-3.10.0-123.el7.x86_64 root=UUID=aad7538b-39be-480e-9d10-f863b33cdb65 ro vconsole.keymap=us crashkernel=auto vconsole.font=latarcyrheb-sun16 rhgb quiet LANG=en_US.UTF-8
initrd16 /boot/initramfs-3.10.0-123.el7.x86_64.img
}
menuentry 'CentOS Linux, with Linux 0-rescue-8fb8d2167f2d4c74a88ad2b6b7700795' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-8fb8d2167f2d4c74a88ad2b6b7700795-advanced-aad7538b-39be-480e-9d10-f863b33cdb65' {
load_video
insmod gzio
insmod part_msdos
insmod xfs
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 --hint='hd0,msdos7' aad7538b-39be-480e-9d10-f863b33cdb65
else
search --no-floppy --fs-uuid --set=root aad7538b-39be-480e-9d10-f863b33cdb65
fi
linux16 /boot/vmlinuz-0-rescue-8fb8d2167f2d4c74a88ad2b6b7700795 root=UUID=aad7538b-39be-480e-9d10-f863b33cdb65 ro vconsole.keymap=us crashkernel=auto vconsole.font=latarcyrheb-sun16 rhgb quiet
initrd16 /boot/initramfs-0-rescue-8fb8d2167f2d4c74a88ad2b6b7700795.img
}
if [ "x$default" = 'CentOS Linux, with Linux 3.10.0-123.el7.x86_64' ]; then default='Advanced options for CentOS Linux>CentOS Linux, with Linux 3.10.0-123.el7.x86_64'; fi;
### 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_ppc_terminfo ###
### END /etc/grub.d/20_ppc_terminfo ###

### 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 ###

---------- Post added 08-21-14 at 12:32 PM ----------

using fdisk -l shows this

Disk /dev/sda: 160.0 GB, 160041885696 bytes, 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 label type: dos
Disk identifier: 0x75bd7821

Device Boot Start End Blocks Id System
/dev/sda1 * 63 61432559 30716248+ 7 HPFS/NTFS/exFAT
/dev/sda2 61432560 122865119 30716280 7 HPFS/NTFS/exFAT
/dev/sda3 122865120 184297679 30716280 7 HPFS/NTFS/exFAT
/dev/sda4 184297680 312576704 64139512+ f W95 Ext'd (LBA)
/dev/sda5 184297743 245730239 30716248+ 7 HPFS/NTFS/exFAT
/dev/sda6 245733376 246757375 512000 83 Linux
/dev/sda7 246759424 308314111 30777344 83 Linux
/dev/sda8 308316160 312575999 2129920 82 Linux swap / Solaris
 
Old 08-21-2014, 08:21 AM   #24
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181
It appears that sda1 is your bootable Windows partition. But so far nothing has put a menuentry for it in your grub.cfg.

Have you tried the command to configure grub?
Code:
grub2-mkconfig -o /boot/grub2/grub.cfg
Have you enabled the EPEL repository and installed ntfs-3g ?
If you are using Centos 7 dual boot with Windows, you will almost certainly want ntfs-3g installed anyway. It may also be the step needed to make grub2-mkconfig work correctly.

If none of that solves the dual boot, you could force it the same way I did, by replacing the contents of /etc/grub.d/40_custom with the following and then rerunning grub2-mkconfig (as shown above).

Code:
### 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" {
        insmod part_msdos
           set root='hd0,msdos1'
        chainloader +1
}
The instructions I found for enabling EPEL are:
Code:
cd /tmp
wget http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm
sudo yum install epel-release-7-0.2.noarch.rpm
Once EPEL is enabled, you can install ntfs-3g with
Code:
sudo yum install ntfs-3g

Last edited by johnsfine; 08-21-2014 at 08:24 AM.
 
1 members found this post helpful.
Old 08-28-2014, 02:24 AM   #25
Mridulj
Member
 
Registered: Jan 2008
Posts: 48

Original Poster
Rep: Reputation: 15
thanks Johnfine .

it did solve the problem .

Centos7 doesnot initially support ntfs file system and once installed then running the mkconfig command helps which detects the file system .
 
Old 09-16-2014, 04:53 AM   #26
rajeshkarivellur
LQ Newbie
 
Registered: Sep 2014
Posts: 2

Rep: Reputation: Disabled
Centos7 dual boot solved

The dual boot option can be provided during the centos installation
by giving an extra partition /boot/efi
 
Old 09-16-2014, 04:54 AM   #27
rajeshkarivellur
LQ Newbie
 
Registered: Sep 2014
Posts: 2

Rep: Reputation: Disabled
for more details watch the video
https://www.youtube.com/watch?v=9QzbX8o7pSY
 
Old 10-26-2014, 12:23 AM   #28
nm_dennis
LQ Newbie
 
Registered: Oct 2014
Posts: 2

Rep: Reputation: Disabled
I'm trying to set up a dual-boot Windows 7 Pro 64-bit and CentOS 7 and failing miserably. I

think I've tried every option listed in this thread and everywhere else I can find. After installing Windows 7 and then CentOS 7, I can't boot into Windows.

Here's what I can think of to start out with...
1. This is going on a brand new HP G1 400 i7 with 8GB memory and a single 1TB hard drive.
2. I've followed various directions to shrink the drive and it shows the following in the

Computer Management/Disk Management utility in Windows 7.
a. EFI System Partition - 100 MB.
b. C:/ drive -585.94GB NTFS Windows disk (Boot, Page File, Crash Dump, Primary Partition).
c. 345.35GB Unallocated (ready for CentOS 7).
3. Downloaded CentOS 7, burned to DVD, booted to it and did a Gnome install. The following is

what the partitions show:
a. Under Unknown:
i. SDA1 - EFI System Partition: 100 MB
ii. SDA2 - Unknown: 128 MB
iii. SDA3 - ntfs: 600 GB
b. under New CentOS 7 Installation (automatic build):
i. DATA
a. sda8 - /home: 293.78 GB
ii.SYSTEM
a. sda5 - /boot: 500 MB
b. sda4 - /boot/efi: 200 MB
c. sda7 - /: 51.2 GB
d. sda6 - /swap: 7.95 GB

What I've tried:
- grub2-mkconfig -o /boot/grub2/grub.cfg of course but it did not add any entry.
- Created the 15_Win and made it executable shown in reply 9 to this thread and reran grub2-mkconfig. This created the Windows menu item on boot, but it didn't work.
- In the set root line of 15_win, edited the second number (partition number) to each of the partitions, reran grub2-mkconfig still with no luck on reboot.
- fdisk -l doesn't list ANY boot disk
- tried enabling EPEL and installing ntfs-3g and re-running grub2-mkconfig still with no luck.
- tried watching the video from reply 27 and following it -- still no luck. This appears to be for Windows 8 instead of Windows 7.

Side note
- As a last resort, I downloaded VirtualBox but it appears to only support 32-bit for some reason. Tried downloading a couple of different disk images and still had the same problem -- won't work because it's convince I'm using 32-bit.

I can provide whatever info you may need, but this was all I could think of. For now, I'm back to a fresh install of Windows 7 Pro 64-bit.

Any new ideas (preferably with dual boot instead of VirtualBox) would be much appreciated.

Thanks,

Dennis
 
Old 12-14-2014, 11:09 AM   #29
turboron
LQ Newbie
 
Registered: Dec 2014
Posts: 1

Rep: Reputation: Disabled
Thank you!

Quote:
Originally Posted by johnsfine View Post
It appears that sda1 is your bootable Windows partition. But so far nothing has put a menuentry for it in your grub.cfg.

Have you tried the command to configure grub?
Code:

grub2-mkconfig -o /boot/grub2/grub.cfg

Have you enabled the EPEL repository and installed ntfs-3g ?
If you are using Centos 7 dual boot with Windows, you will almost certainly want ntfs-3g installed anyway. It may also be the step needed to make grub2-mkconfig work correctly.

If none of that solves the dual boot, you could force it the same way I did, by replacing the contents of /etc/grub.d/40_custom with the following and then rerunning grub2-mkconfig (as shown above).

Code:

### 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" {
insmod part_msdos
set root='hd0,msdos1'
chainloader +1
}

The instructions I found for enabling EPEL are:
Code:

cd /tmp
wget http://dl.fedoraproject.org/pub/epel...0.2.noarch.rpm
sudo yum install epel-release-7-0.2.noarch.rpm

Once EPEL is enabled, you can install ntfs-3g with
Code:

sudo yum install ntfs-3g
Thank you for this! This enabled me to be able to get back into the Windows partition after installing CentOS alongside it. There's only one thing I had to change. The link for the rpm is no longer valid.

---------- Post added 12-14-14 at 11:10 AM ----------

Here is the current link for the rpm.

http://dl.fedoraproject.org/pub/epel...7-5.noarch.rpm

Last edited by turboron; 12-14-2014 at 11:11 AM.
 
Old 01-24-2015, 07:50 AM   #30
hhaswan
LQ Newbie
 
Registered: Jan 2015
Location: Indonesian
Distribution: Centos 7, Debian
Posts: 1

Rep: Reputation: Disabled
I also get same problem with Mridulj, after search i find a solution and I've been successfully
I edit file 40_custom in the /etc/grub.d

nano /etc/grub.d/40_custom

then, I fill it :

menuentry "Windows 7" {
set root='(hd0,1)'
chainloader +1
}


after that,

grub2-mkconfig -o /boot/grub2/grub.cfg

last step, I restart my laptop and "Windows 7" has added in entry bootloader.


btw, my system preserved is located on /dev/sda1
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot dual boot Centos 6.5 32 bit with windows 7 SarahGurung Linux - Newbie 2 04-09-2014 02:49 PM
Problems with Windows and CentOS dual-boot nidishady Linux - Newbie 13 05-24-2013 12:32 AM
[SOLVED] Want to dual boot CentOs 5.5 onto Windows 7 HP G62 laptop missrose1991 Linux - Laptop and Netbook 6 01-11-2011 03:07 PM
How to dual boot Centos 5.0 and Windows XP pro (XP installed first) UMadara Linux - Newbie 2 05-13-2010 10:23 PM
CentOS 4.0 + Windows XP Dual Boot laserlight Linux - Enterprise 9 02-01-2010 01:51 PM


All times are GMT -5. The time now is 04:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration