LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-29-2017, 06:08 PM   #1
binary.druid
LQ Newbie
 
Registered: Oct 2008
Location: Toronto, ON
Posts: 3

Rep: Reputation: 0
Trying to get Grub2 to see the Windows 7 partition.


Hi Guys, 1st off, I'm new to CentOS, but not new to computers.

I just installed CentOS 7.3 on my system and the Grub menu is not displaying the Window7 instance I have on a different drive. If I try to update the Grub2 config file by running the command:
Code:
grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
I get the following error message:
Code:
/etc/default/grub: line 3: 7: command not found
Can you guys shed some light into what I'm missing?

I've verified that the Package os-prober-1.58-9.el7.x86_64 is already installed. if I CAT /etc/default/grub, I get the following output:
Code:
    GRUB_TIMEOUT=5
    GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
    GRUB_DEFAULT=Windows 7
    GRUB_DISABLE_SUBMENU=true
    GRUB_TERMINAL_OUTPUT="console"
    GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=cl/root rd.lvm.lv=cl/swap rhgb quiet"
    GRUB_DISABLE_RECOVERY="true"
I'm guessing it's referring to the "GRUB_DEFAULT=Windows 7"??? I'm not sure what it's looking for here or how to fix this? I've read different posts that indicate to not touch this file, and that the "grub2-mkconfig" command will make the changes... which brings me back right to where I started.

For the record, I haven't changed or modified anything at this point, and If this helps, the "40_custom" file shows:

Code:
    #!/bin/sh
    exec tail -n +3 $0
    # 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=(hd0,1)
            chainloader +1
            }
Uname = Linux LX-WkSt 3.10.0-514.16.1.el7.x86_64 #1
CentOS Linux release 7.3.1611 (Core)
 
Old 05-29-2017, 08:43 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,974

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
See this to start. https://wiki.centos.org/HowTos/Grub2

A lot really going on with your question too.

Can I assume that you had windows 7 running and you just now installed Centos?

Is the system uefi really?
Was windows 7 running under uefi?
Is it possible that you copied over the windows loader?
 
Old 05-31-2017, 06:52 PM   #3
binary.druid
LQ Newbie
 
Registered: Oct 2008
Location: Toronto, ON
Posts: 3

Original Poster
Rep: Reputation: 0
@Jefro, All great questions there. I will attempt to answer the best that I can:

Can I assume that you had windows 7 running and you just now installed Centos? Yes.

Is the system uefi really? I think so. Is there a way I can confirm ?

Was windows 7 running under uefi? I think so. Is there a way I can confirm ?

Is it possible that you copied over the windows loader? I don't believe so. Is there a way I can confirm ?

Thank you for the provided link. Hopefully it will answer my questions.


-BD
 
Old 05-31-2017, 06:59 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
I would be guessing you need double quotes on that line to protect the space character. Very unusual for it to be generated like that. If you really didn't change it, raise a bug against CentOS.
That is one of the grub files you can safely change and have retained.
 
Old 05-31-2017, 09:52 PM   #5
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,492

Rep: Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488
Windows 7 default install would be the older MBR/CSM rather than UEFI so unless you installed UEFI, it probably is not.
If you have one system UEFI, they both should be or you will have boot problems. If one is MBR, they should both be. If you can boot CentOS, do that and run as root:

Quote:
fdisk -l
(Lower CAse Letter L in the command) and post the output here. You should also check to see if you have an EFI partition and on which disk and whether you have both windows and Linux efi files on it.

Last edited by yancek; 05-31-2017 at 09:53 PM.
 
Old 06-01-2017, 06:51 AM   #6
sum1nil
LQ Newbie
 
Registered: Jun 2013
Posts: 8

Rep: Reputation: Disabled
A temporary solution may be to use www.supergrubdisk.org/super-grub2-disk/.
You put it on a USB stick and boot from that. It also has diagnoses software. I used it after a reinstall of Windows overwrote grub.
 
  


Reply



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
GPT - grub2 wants BIOS partition CollieJim Gentoo 5 01-05-2015 12:52 AM
grub2 can't see my win 7 partition and yast2 bootloader can't reinstall grub2 jjrojaspy SUSE / openSUSE 5 07-07-2013 10:38 PM
grub2: error: no such partition aongusa Fedora 4 08-04-2012 05:03 AM
[SOLVED] Installing GRUB2 On Its Own Partition golmschenk Linux - Newbie 5 01-30-2012 10:20 PM
Install grub2 in partition is possible? miros84 Linux - Software 1 11-14-2010 01:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:55 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
Open Source Consulting | Domain Registration