Anaconda did not cofigure grub 2 correctly
Anaconda did not cofigure grub 2 correctly
Hi everyone. I made a new account and this is my first post. I have been using Fedora for years on my laptop and I have a home server running Centos 6 with three Centos 6 VMs. My foray into Linux is not new but I have encountered a problem that is new to me and I seem to be stumped in solving it.
As the title states I installed Centos 7 over the weekend and the Anaconda installer did not configure my dual boot setup correctly. My laptop had a functioning Windows 7 Home Premium 64 bit installation prior to installing Centos 7. After installing Centos 7 I have no entry in Grub 2 for Windows. I have run this combination of dual booting Windows 7 and Fedora 16/17/18/19 without issue for years. Anaconda always got it right in the past, even when Fedora switched to the "new" Anaconda installer. I am typing this post in Centos 7 on the machine I am referring to, it is fully functional running Centos, I just cannot boot Windows 7.
Info on laptop:
Acer Aspire 5740G
Was dual booting Fedora 19 & Windows 7 Home Premium 64bit (replaced Fedora 19 with Centos 7)
Intel i7 Q740
8GB DDR3 1333
ATI 5650 1GB
[sda] Intel 320 120GB SSD
[sdb] Intel 330 120GB SSD (replaced DVD-ROM)
Typically I upgrade Fedora by wiping my Linux partitions and rebuilding my mdadm array. Grub has always been configured correctly with Fedora in all the times I have wiped/installed. Yes the drives are structures are atypical from a normal user. The root and /home partitions match and are mdadm raid0 pairs with encryption. When I installed I only formatted /, /boot, and /home. I left the ntfs partitions alone. What is different this time is I encrypted my / and /home partitions which I have never done prior. My partition scheme looks like this:
sda: [500MB /boot] [13GB /] [43GB /home] [64GB win D: (ntfs)]
sdb: [100MB win boot (ntfs)] [65GB win C:(ntfs)] [13GB /] [43GB /home]
This results in ~24GB for / and ~83GB for /home. I do not have any swap. The two windows partitions are stand alone ntfs since Windows Home Premium does not have the capability to do software raid.
What do I need to do to place a new entry into Grub 2 to point to the 100MB windows boot partition? The file system should be intact. Thanks in advance!
As the title states I installed Centos 7 over the weekend and the Anaconda installer did not configure my dual boot setup correctly. My laptop had a functioning Windows 7 Home Premium 64 bit installation prior to installing Centos 7. After installing Centos 7 I have no entry in Grub 2 for Windows. I have run this combination of dual booting Windows 7 and Fedora 16/17/18/19 without issue for years. Anaconda always got it right in the past, even when Fedora switched to the "new" Anaconda installer. I am typing this post in Centos 7 on the machine I am referring to, it is fully functional running Centos, I just cannot boot Windows 7.
Info on laptop:
Acer Aspire 5740G
Was dual booting Fedora 19 & Windows 7 Home Premium 64bit (replaced Fedora 19 with Centos 7)
Intel i7 Q740
8GB DDR3 1333
ATI 5650 1GB
[sda] Intel 320 120GB SSD
[sdb] Intel 330 120GB SSD (replaced DVD-ROM)
Typically I upgrade Fedora by wiping my Linux partitions and rebuilding my mdadm array. Grub has always been configured correctly with Fedora in all the times I have wiped/installed. Yes the drives are structures are atypical from a normal user. The root and /home partitions match and are mdadm raid0 pairs with encryption. When I installed I only formatted /, /boot, and /home. I left the ntfs partitions alone. What is different this time is I encrypted my / and /home partitions which I have never done prior. My partition scheme looks like this:
sda: [500MB /boot] [13GB /] [43GB /home] [64GB win D: (ntfs)]
sdb: [100MB win boot (ntfs)] [65GB win C:(ntfs)] [13GB /] [43GB /home]
This results in ~24GB for / and ~83GB for /home. I do not have any swap. The two windows partitions are stand alone ntfs since Windows Home Premium does not have the capability to do software raid.
What do I need to do to place a new entry into Grub 2 to point to the 100MB windows boot partition? The file system should be intact. Thanks in advance!
-
- Posts: 2
- Joined: 2014/07/22 00:53:09
Re: Anaconda did not cofigure grub 2 correctly
I am seeing this issue as well. I had expected the centos installer to recognise that there was a partition with another OS and offer dual boot.
It didn't. I now cannot boot my windows server 2008 OS.
Any help would be most appreciated.
It didn't. I now cannot boot my windows server 2008 OS.
Any help would be most appreciated.
-
- Posts: 2
- Joined: 2014/07/22 00:53:09
Re: Anaconda did not cofigure grub 2 correctly
I got my Windows boot option back by doing the following.I don't know if its the best way but it seems to have worked.
Check the partition that Windows resides on
In my case I had a recovery partition on sda2 (partition index 1) and main Windows on sda3 (partition index 2). Note that partition indexes start from 0, so the Dell utility partition is partition index 0.
Then I backed up and edited /etc/grub.d/40_custom to add the windows boot options. NOTE you shouldn't edit /etc/grub2.cfg directly as it is a generated file and your changes will be lost the next time it is recreated by some other process.
and add the following lines at the bottom of the file (as directed by comments).
You would obviously change your menu text (inside "" quotes), if you are not using Windows Server 2008 on /dev/sda3.
The line set root=(hd0,1) is the important part. The part inside the brackets may vary for you.
hd means hard drive and 0 is the first hard drive (/dev/sda) and 2 is the third partition (keep in mind indexing starts at 0).
Now you must run grub2-mkconfig to regenerate /etc/grub2.cfg. You must pass the location of the output file, otherwise it will generate the output but not write it anywhere (it does not default to /etc/grub2.cfg)
Now check your overwriting worked, you should see the content of /etc/grub.d/40_custom has been written into /etc/grub2.cfg somewhere near the bottom. If it hasn't you could be reloading and scratching your head about why no windows option is showing up.
Now reboot and wait to see your updated boot options.
Check the partition that Windows resides on
Code: Select all
>$ sudo fdisk /dev/sda
Code: Select all
Device Boot Start End Blocks Id System
/dev/sda1 63 80324 40131 de Dell Utility
/dev/sda2 * 81920 27865087 13891584 7 HPFS/NTFS/exFAT
/dev/sda3 27865088 929521663 450828288 7 HPFS/NTFS/exFAT
/dev/sda4 929521664 1953525167 512001752 5 Extended
/dev/sda5 929523712 930547711 512000 83 Linux
/dev/sda6 930549760 1953523711 511486976 8e Linux LVM
Then I backed up and edited /etc/grub.d/40_custom to add the windows boot options. NOTE you shouldn't edit /etc/grub2.cfg directly as it is a generated file and your changes will be lost the next time it is recreated by some other process.
Code: Select all
sudo cp /etc/grub.d/40_custom /etc/grub.d/40_custom.original
Code: Select all
sudo vim /etc/grub.d/40_custom
Code: Select all
menuentry "Windows Server 2008 (on /dev/sda3)" {
set root=(hd0,2)
chainloader +1
}
The line set root=(hd0,1) is the important part. The part inside the brackets may vary for you.
hd means hard drive and 0 is the first hard drive (/dev/sda) and 2 is the third partition (keep in mind indexing starts at 0).
Now you must run grub2-mkconfig to regenerate /etc/grub2.cfg. You must pass the location of the output file, otherwise it will generate the output but not write it anywhere (it does not default to /etc/grub2.cfg)
Code: Select all
>$ sudo grub2-mkconfig -o /etc/grub2.cfg
Code: Select all
>$ sudo cat /etc/grub2.cfg
Code: Select all
>$sudo reboot
Re: Anaconda did not cofigure grub 2 correctly
Nice one Paul!
I have my system booting correctly as well. My solution was not nearly as in depth.
Thanks too some nice discussion over on fedoraforum.org I found out I needed to run:
Don't worry the above command is nondestructive.
There were a couple of errors but it still placed a grub.cfg.new file in the /boot/grub2 directory. I opened and read this new file to verify the needed boot entry for Windows 7 was there. Your config will vary depending on what partitions you have which OS installed on. I just needed to verify the following:
Remember how I said this was nondestructive? The command actually creates a grub.cfg.new file. I wanted to be sure to be able to restore my partially working grub config so I renamed my files keeping the original config:
One more issue was grub.cfg (my new file) was not readable except by root a quick chmod to give it the same permissions as the original file:
There is now a bottom entry in my grub menu at boot for "Windows 7".
I have my system booting correctly as well. My solution was not nearly as in depth.
Thanks too some nice discussion over on fedoraforum.org I found out I needed to run:
Code: Select all
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
There were a couple of errors but it still placed a grub.cfg.new file in the /boot/grub2 directory. I opened and read this new file to verify the needed boot entry for Windows 7 was there. Your config will vary depending on what partitions you have which OS installed on. I just needed to verify the following:
Code: Select all
### 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.
cat << EOF
menuentry "Windows 7"{
set root=(hd1,1)
chainloader (hd1,1)+1
}
EOF
### END /etc/grub.d/40_custom ###
Code: Select all
mv grub.cfg grub.cfg.old
mv grub.cfg.new grub.cfg
Code: Select all
sudo chmod a+r grub.cfg
-
- Posts: 1
- Joined: 2014/08/19 04:35:32
Re: Anaconda did not cofigure grub 2 correctly
Hi Paul,
Thanks a lot for detailed information.
It worked for me.
Thanks a lot for detailed information.
It worked for me.
Re: Anaconda did not cofigure grub 2 correctly
Hi Paul,
Thanks a lot it worked for me too..
Thank you very much for this wonderful information..!
Thanks a lot it worked for me too..
Thank you very much for this wonderful information..!
-
- Posts: 1521
- Joined: 2014/05/21 20:16:00
- Location: Central New York, USA
Re: Anaconda did not cofigure grub 2 correctly
In a previous post was mentioned that CentOS 7 has intentionally "dropped' the creation of the Windows entry. Equally as obvious in same post was their/our bewilderment with this Red Hat decision.
Re: Anaconda did not cofigure grub 2 correctly
Hi Paul. Thanks a lot for the detailed step by step instructions and information.
Re: Anaconda did not cofigure grub 2 correctly
Hi there!
I have installed CentOS 7 beside Windows 8. Now it is a old laptop with BIOS not UEFI.
Installation went smoothly and CentOS 7 in running properly but when booting there is no windows 8 option.
So I started to follow the steps of paul, >$ sudo fdisk /dev/sda
but it's been almost an hour and nothing has happened. If I click to close the terminal, " There is still a process running in this terminal. Clising the terminal will kill it" message shows up. I have updated the OS and thought it will be solved, but another Linux line has been added in the boot menu but no windows 8 option.
What am I suppose to do now? Kindly help me.
Many thanks in advance,
B52bomber (I know it's weird)
I have installed CentOS 7 beside Windows 8. Now it is a old laptop with BIOS not UEFI.
Installation went smoothly and CentOS 7 in running properly but when booting there is no windows 8 option.
So I started to follow the steps of paul, >$ sudo fdisk /dev/sda
but it's been almost an hour and nothing has happened. If I click to close the terminal, " There is still a process running in this terminal. Clising the terminal will kill it" message shows up. I have updated the OS and thought it will be solved, but another Linux line has been added in the boot menu but no windows 8 option.
What am I suppose to do now? Kindly help me.
Many thanks in advance,
B52bomber (I know it's weird)
Re: Anaconda did not cofigure grub 2 correctly
If you just run fdisk /dev/sda then it will stop and wait for you to tell it what to do. If you wanted to list the partitions then you should run fdisk -l /dev/sda. If you want to quit your current fdisk then just type 'q' and hit enter and it will exit without saving any changes.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke