Dual Boot UEFI Window 10 Centos 7.4 - helpful hints

General support questions
jimbux
Posts: 59
Joined: 2011/11/28 18:23:13
Contact:

Dual Boot UEFI Window 10 Centos 7.4 - helpful hints

Post by jimbux » 2017/10/12 17:26:31

Even with all the help available online, I think I almost broke the record for number of successive installs of BOTH win 10 & CentOS in trying to get dual booting to work for me. Trial and error (rinse repeat) plus reexamining various forum posts sprinkled to and fro I FINALLY was able to dual boot my new windows 10 and CentOS 7.4 from fresh installs! Yay.

I made a bunch of mistakes mostly fueled by ignorance, anyway as a possible help to others out there stumbling around in the dark, perhaps my notes here will help flip on the light-switch and make this process easier for someone else.

So here's my setup, nothing particularly special:

ASUSTeK SABERTOOTH X79 with an Intel i7-3930K PC, installing both OS's onto a 1Tb sata drive from DVD install media (in both cases).

Before embarking on this task I upgraded the BIOS to pretty much the latest available (v4701 on the Asus site - via a USB stick - simple process).

Since Centos7.4 can handle UEFI without problem I did NOT turn off "Secure Mode", in other words, UEFI mode is active through the BIOS. Furthermore, there is something available called CSM (Compatibility Support Module) where I flipped all treatment of various media to prefer UEFI over "Legacy oprom".

I followed the advice of folks online to FIRST install Windows 10, THEN CentOS. Here's a CRITICAL bit of information: You NEED make sure Windows 10 is installed in UEFI mode, and how you do (or how I did) that was to insert the disk at boot time, then jump into the BIOS and then there's a way to select the Boot Media explicitly. I was given two choices to boot from the SATA DVD drive, i) regular looking mode where it just lists the SATA port ("P4: ATAPI ..." in my case), and choice ii) the SATA DVD-drive label is prefixed with UEFI <- USE THAT ONE, otherwise windows won't install in UEFI mode.

Prior to this I had used my CentOS install disk's recovery mode to give me a shell where I could use "gdisk" to make the 1Tb disk use a gpt partition table (as opposed to DOS). It's possible if you start with a DOS partition table that the Windows 10 installer will flip it for you, but I had already (in my many failed trials) apparently tried to install non-UEFI Windows 10 onto a gpt partition tabled disk and it simply refused to deal with it (I think... I did so many variations that it's hard to recall all the road blocks).

So, proceed with the Windows install - it will take over the whole disk. Once it's all installed free up some space with "Shrink" via the disk management tools (lots of help to do this online). I freed up 220 Gb leaving ~740 Gb for Windows.

Once this is done, reboot, and with the same proceedure, launch your CentOS 7.4 DVD installer via the BIOS, explicitly making sure to launch the UEFI choice for the DVD-SATA-drive.

The following link is really useful especially IF you do the above steps because then the instructions on the web-page will mirror what you see on your screen - otherwise, it's going to be different, and different is BAD. (I'm fuzzy on the whole Good-Bad thing, ... OK, Imagine every molecule in your body simultaneously exploding at the speed of light... Total protonic reversal - OK that's "Bad" THX Egon!)

https://www.tecmint.com/install-centos- ... -firmware/

If all went well, you should simply see CentOS AND Windows boot loader as options on your boot screen. Nothing else should need to be done! I hope that helps - It will probably help me again in a year when I completely forget this entire process.

Cheers,
James.
Last edited by jimbux on 2017/10/18 14:57:10, edited 2 times in total.

jimbux
Posts: 59
Joined: 2011/11/28 18:23:13
Contact:

Re: Dual Boot UEFI Window 10 Centos 7.4 - helpful hints

Post by jimbux » 2017/10/12 17:37:19

I think I'm going to cry. No sooner had I finished writing my post (above) up and rebooted my machine that I was no longer presented with my Grub boot loader choices -> it goes straight into windows. I have no idea what broke it - I had successfully booted into both CentOS and Win 10 several times. I did an update to Windows last night that perhaps stomped on something important (this was first time booting since successful installs followed by win-update last night)? I don't know. *sigh* back to the drawing board. Wow - this process is so difficult.
Last edited by jimbux on 2017/10/12 18:14:17, edited 2 times in total.

jimbux
Posts: 59
Joined: 2011/11/28 18:23:13
Contact:

Re: Dual Boot UEFI Window 10 Centos 7.4 - helpful hints

Post by jimbux » 2017/10/12 17:50:32

Live debugging going on here. I found something that seems to be on the right track, from Ubuntu forums.

In Win10, as administrator run cmd, and execute this command:

Code: Select all

bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi
Does anyone know the CentoOS equivalent to this? ...and is this actually the answer I'm looking for?

Thx folks,
J

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

Re: Dual Boot UEFI Window 10 Centos 7.4 - helpful hints

Post by owl102 » 2017/10/12 18:45:17

jimbux wrote:I did an update to Windows last night that perhaps stomped on something important (this was first time booting since successful installs followed by win-update last night)? I don't know. *sigh* back to the drawing board. Wow - this process is so difficult.
I had the same issue twice: The Windows 10 update altered the UEFI boot order which in my opinion is something between impudence and act of sabotage - Thank you Microsoft :evil:

You should be able to alter the UEFI boot order again using either your BIOS/UEFI setup menu, or by booting a Linux live image in UEFI mode (e.g. Fedora) and using "efibootmgr".
Does anyone know the CentoOS equivalent to this? ...and is this actually the answer I'm looking for?
Unfortunately I currently don't have access to my CentOS laptop, but since the ESP (EFI System Partition) is a regular FAT32 partition on your hard drive you should be able to take a look, e.g. from a booted Linux live image (or from within Windows 10?). The path should be something like \EFI\centos\shim.efi. However, I assume that the boot path to CentOS is still intact inside the UEFI, so setting it again seems like a bad idea to me. Instead the boot order should be altered (with "bcdedit /displayorder ?).
German speaking forum for Fedora and CentOS: https://www.fedoraforum.de/

jimbux
Posts: 59
Joined: 2011/11/28 18:23:13
Contact:

Re: Dual Boot UEFI Window 10 Centos 7.4 - helpful hints

Post by jimbux » 2017/10/12 20:12:17

Thanks Owl! - the following worked right out of the gate (hallelujah!)

Code: Select all

bcdedit /set {bootmgr} path \EFI\centos\shim.efi
Now... the question as to whether or not it sticks after the next window update. Any predictions anyone?

PS - Confirmed that the machine boots up properly into both Windows 10 and Centos 7.4 after running that windows command.

PPS - I'll update this with more as I discover it, eg. effects of new Win-update etc...

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Dual Boot UEFI Window 10 Centos 7.4 - helpful hints

Post by hunter86_bg » 2017/10/13 02:24:00

Maybe a disk dump of the efi partition with 'dd' could do the trick.
Then just upload it to windows and grab the windows disk imager /the same is recommended for making CentOS USB media/.
So the next time windows wipes the efi - you can easily restore.

desertcat
Posts: 843
Joined: 2014/08/07 02:17:29
Location: Tucson, AZ

Re: Dual Boot UEFI Window 10 Centos 7.4 - helpful hints

Post by desertcat » 2017/10/13 09:05:49

jimbux wrote:I think I'm going to cry. No sooner had I finished writing my post (above) up and rebooted my machine that I was no longer presented with my Grub boot loader choices -> it goes straight into windows. I have no idea what broke it - I had successfully booted into both CentOS and Win 10 several times. I did an update to Windows last night that perhaps stomped on something important (this was first time booting since successful installs followed by win-update last night)? I don't know. *sigh* back to the drawing board. Wow - this process is so difficult.
You have now provided reason 1,000,001 for "Why I HATE Windows". My sister LOVES Windows 7; She HATES Windows 10. There is something buggy with Windows update. It takes forever to update at times and it is a HUGE beast.

If I MUST run some flavour of Windows I run it as a Virtual Machine under CentOS 7.4, and if you have enough memory, run Windows as a VM in its own Virtual Desktop. You are now running both OS's at the same time. If for some reason Windows blows up (and how many times doesn't that happen), then simply nuke the Windows VM and reinstall it. No having to worry about duel booting or any of that stuff. Boot in CentOS, then start the Windows VM .

That said THANK YOU for your tips as we all learns the mistakes of others.

BTW do you *HAVE* to use UEFI in Windows?!? I have a ASUS M5A97 R2.0 mobo with an AMD FX-6300 hexacore CPU. I too came across the UEFI and NON-UEFI options in BIOS. I tried to install C 7 , the default is UEFI and caused it to hurl all over my shoes, the second I installed it in NON-UEFI mode, I had no problem. Depending on if you are primarily a creature of the Light (one who uses Linux or UNIX as their OS) or a creature of the Dark (one who still uses Windows), the smart way around this whole Duel boot jazz is to simply install either Linux or Windows, and run the other as a VM, and save yourself some grief. If you can install Win 10 (?) in NON-UEFI try doing it that way... but truthfully I thunk there is something in the Win 10 updater that is playing havoc with your configured system, I suspect that it has something to do with Win 10's Phone Home to the M$ Mothership. The updater is run under secure parameters, so you have finally get the two OS's to play nice, and then M$ decides to update your machine, goes in and senses that there is some nasty "malware" (CentOS Linux), and promptly "fixes" or disables what it considers a security risk. Just a guess. I highly recommend that you play around with a VM. You can download VMWare's VMWare Player 12.5.7 for both Linux and Windows for FREE.

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

Re: Dual Boot UEFI Window 10 Centos 7.4 - helpful hints

Post by owl102 » 2017/10/13 12:05:45

hunter86_bg wrote:So the next time windows wipes the efi - you can easily restore.
The problem here was the altered boot sequence, and this is stored in the UEFI itself and not on the EFI System Partition (ESP).
German speaking forum for Fedora and CentOS: https://www.fedoraforum.de/

jimbux
Posts: 59
Joined: 2011/11/28 18:23:13
Contact:

Re: Dual Boot UEFI Window 10 Centos 7.4 - helpful hints

Post by jimbux » 2017/10/18 14:32:19

Quick followup.

i) After one round of Windows updates that succeeded, but partially failed (why failure? unclear... could be because the update happened yesterday, Oct 17th, and it was the first day for the release of the so called "Fall Creators Update") at least the updates that did succeed didn't alter my boot screen. I was still able to dual boot both win10 and CentOS 7.4

ii) In reply to desertcat's suggestions about using VM, and why UEFI etc.

Thx for the suggestions, but I don't think VM is for me. I use some memory intensive applications and want to minimize the footprint of the OS. Also, my gut tells me that running one OS inside another may have it's own set of issues that I'd prefer to not layer on top of the usual host of difficulties when faced with debugging something that isn't working right. Perhaps I'm wrong and using a VM is smooth as silk and no different than what I'm doing, but I doubt it.

So why UEFI? Good question.

Along the way, when I was inadvertently trying to install Windows & CentOS, but mistakenly failing to do it in UEFI mode, the win10 installer prevented me from using anything other than a DOS formatted disk. I believe that was limiting how many partitions could be made on the disk, so when I installed CentOS it ended up stomping on some Windows partitions and consequently win10 became unrecoverable and couldn't be repaired (thus my repeated adnauseum number of reinstalls - I had my windows key memorized that's how many times I did it).

When I reformatted the disk to be gpt - (using gdisk or fdisk) the Windows installer would NOT let me install win10 - and apparently it's because I was still trying to install it in non-UEFI mode. As soon as I made the discovery above about how to actually get win10 to install in UEFI mode, everything clicked, including the CentOS install.

Maybe other people have been able to dual boot both win10 and centOS 7 from one disk, but I was unable to do it w/o UEFI mode being active.

Thanks again to everyone who pitched in ideas to help me out!

etuckram
Posts: 2
Joined: 2017/10/19 12:20:00

Re: Dual Boot UEFI Window 10 Centos 7.4 - helpful hints

Post by etuckram » 2017/10/19 12:36:56

I got a new Acer laptop and I am trying to install Centos 7. I downloaded the everything version 1611 I guess and I created a bootable usb using rufus.
First I created it using "MBR partition scheme for BIOS or UEFI". It won't boot unless I choose "legacy" boot options from BIOS. So I went through the process and it is even asking me to create 1 MB of partition for biosboot and I did. So it went through the install and as I enter the root password, the installation froze. I reset the laptop and now, it won't boot my windows 10.

So I attempted to reinstall it and used rufus again but this time, I select "GPT partition scheme for UEFI" it would boot from UEFI and I've noticed that the font is a bit smaller. I tried to install it but it would just give me an underscore "_" and then it will reboot, same thing happens if I test the usb first.

First, how to properly install centos on a laptop? Is rufus a recommended tool to use?

Optional, if you can tell me how to fix windows boot record that would be awesome.
Thank you in advance

Post Reply