Help with dual boot

General support questions
Post Reply
rick619
Posts: 8
Joined: 2017/09/19 05:42:42

Help with dual boot

Post by rick619 » 2017/09/19 05:50:44

I installed Windows 8.1 first, then installed Centos 7. I can boot to Centos fine and was able to install packages to mount my NTFS drive, but Win8 doesn't appear on the boot menu. Is there a way to add it?

Screenshot attached.

Any help would be appreciated.
Attachments
Disk.png
Disk.png (89.67 KiB) Viewed 2578 times

owl102
Posts: 413
Joined: 2014/06/10 19:13:41

Re: Help with dual boot

Post by owl102 » 2017/09/19 07:20:48

Since you have a GPT I assume Windows 8 is installed in UEFI mode. Furthermore I assume you have installed CentOS 7 in UEFI mode as well. (If you have installed CentOS 7 in Legacy/CSM mode instead, the following instructions will not work and there is no way to get a working "Windows 8" boot menu entry within the CentOS boot menu. But you can always boot Windows 8 using the boot manager of the UEFI BIOS.)

Add EPEL and install ntfs-3g:

Code: Select all

yum install epel-release
yum install ntfs-3g
Afterwards

Code: Select all

os-prober
should find your Windows 8 installation. If this is the case,

Code: Select all

grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
adds Windows 8 to the boot menu.
German speaking forum for Fedora and CentOS: https://www.fedoraforum.de/

rick619
Posts: 8
Joined: 2017/09/19 05:42:42

Re: Help with dual boot

Post by rick619 » 2017/09/19 13:51:38

You are correct: Win8 on uefi, then installed Centos second. Still not finding windows with your suggestions though. I had already installed the ntfs support and can see my Windows files.

# os-prober
# grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-693.2.2.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-693.2.2.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-693.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-693.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-36aef60fedaf48d6b81485c1ea7ac44a
Found initrd image: /boot/initramfs-0-rescue-36aef60fedaf48d6b81485c1ea7ac44a.img
done


Also, this was directly after a wipe and reload -- I had Win7 in non uefi, so had to wipe and reload Win8 in uefi because I wanted to install Centos.

Backups are current. Not a big deal to wipe and reload since I haven't even restored my data yet. Just would like to avoid if possible.

owl102
Posts: 413
Joined: 2014/06/10 19:13:41

Re: Help with dual boot

Post by owl102 » 2017/09/19 15:12:16

This is strange. The output of "os-prober" should be something like

Code: Select all

/dev/sda1@/EFI/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi
What's the output of

Code: Select all

ls /boot/efi/EFI
?

What's the output of

Code: Select all

efibootmgr -v
?

Can you boot Windows 8 via the boot manager menu of your UEFI BIOS?
German speaking forum for Fedora and CentOS: https://www.fedoraforum.de/

rick619
Posts: 8
Joined: 2017/09/19 05:42:42

Re: Help with dual boot

Post by rick619 » 2017/09/19 18:59:01

I'll try the commands tonight and post the results.

Unable to boot Win8 from the bios. I could boot to a Win8 install drive (usb since I don't have a DVD drive on the laptop). I'm a Windows admin, so I'm sure I could boot to the install USB and use the bootrec command to repair the Win8 boot loader. Though then I would have the opposite problem because it would kill the Centos loader.

owl102
Posts: 413
Joined: 2014/06/10 19:13:41

Re: Help with dual boot

Post by owl102 » 2017/09/19 19:46:48

rick619 wrote:Though then I would have the opposite problem because it would kill the Centos loader.
Since this is an UEFI system I wouldn't expect so. Installing/Restoring the Windows boot loader into the ESP should not affect the CentOS boot loader.

Based on the information so far I would guess that you have formatted your ESP (EFI System Partition) while installing CentOS, so the Windows boot loader is gone. (During installation the ESP should be added to /boot/efi without formatting it.) Either restoring it with Microsoft methods or restoring the folder /boot/efi/EFI/Microsoft from a backup should help.

But this is only a guess, based on the fact that os-prober does not find the MS-Windows bootloader and booting from UEFI BIOS does not work either. Let's see what the commands will reveal.

BTW: If you think that reinstalling the MS-Windows boot loader could harm the CentOS boot loader: Save /boot/efi/EFI/centos first. If this really gets lost one can simple restore the CentOS boot loader by restoring this folder content.
German speaking forum for Fedora and CentOS: https://www.fedoraforum.de/

rick619
Posts: 8
Joined: 2017/09/19 05:42:42

Re: Help with dual boot

Post by rick619 » 2017/09/19 20:00:32

The install did go a bit odd: I installed Centos once completely, then took out the USB key when complete and rebooted. It booted straight into Win8 with no sign of the Centos loader. Tried rebooting, still no boot loader. So I booted to the USB installer and installed it again with what I thought were the exact same steps. Of course, then lost the Win8 loader.

rick619
Posts: 8
Joined: 2017/09/19 05:42:42

Re: Help with dual boot

Post by rick619 » 2017/09/20 00:50:46

# ls /boot/efi/EFI
BOOT centos



# efibootmgr -v
BootCurrent: 0002
Timeout: 5 seconds
BootOrder: 0002,3002,0000,2001,2002,2003
Boot0000* EFI HDD Device (KINGSTON SUV400S37240G) PciRoot(0x0)/Pci(0x1f,0x2)/Sata(0,0,0)/HD(2,GPT,023d1605-f51b-426f-8a8e-e1630aff37a5,0x96800,0x32000)RC
Boot0002* CentOS HD(2,GPT,023d1605-f51b-426f-8a8e-e1630aff37a5,0x96800,0x32000)/File(\EFI\centos\shimx64.efi)
Boot2001* USB Drive (UEFI) RC
Boot3000* Internal Hard Disk or Solid State Disk RC
Boot3001* Internal Hard Disk or Solid State Disk RC
Boot3002* Internal Hard Disk or Solid State Disk RC
Boot3003* Internal Hard Disk or Solid State Disk RC

rick619
Posts: 8
Joined: 2017/09/19 05:42:42

Re: Help with dual boot

Post by rick619 » 2017/09/20 03:34:22

So analyzing the result of your commands above, I figure the WIn8 boot files had been deleted.

Since you mentioned the Win8 repair might not kill grub, I ran that repair and was able to boot to windows using the UFI boot menu.

So now results of os-prober:

os-prober
/dev/sda2@/EFI/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi


[root@CO7 rick]# grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-693.2.2.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-693.2.2.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-693.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-693.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-36aef60fedaf48d6b81485c1ea7ac44a
Found initrd image: /boot/initramfs-0-rescue-36aef60fedaf48d6b81485c1ea7ac44a.img
Found Windows Boot Manager on /dev/sda2@/EFI/Microsoft/Boot/bootmgfw.efi
done


Rebooted, and dual boot has been restored! I can dual boot using grub or the UEFI menu now.

Thank you for your help!!

Post Reply