Personal computing discussed

Moderators: Flying Fox, Ryu Connor

 
Yan
Silver subscriber
Gerbil Team Leader
Topic Author
Posts: 232
Joined: Fri Dec 21, 2012 9:37 pm
Location: Ottawa

Manually install Windows 7 UEFI boot files

Sun Aug 19, 2018 8:18 pm

I have an MBR hard disk which I want to convert to GPT. Simply changing the format of the partition table is easy enough with sgdisk, but then Windows 7 won't boot. I've concluded that the reason is that I have to somehow install and configure the files for EFI booting.

I've created a partition for the EFI boot files and tried various ways to copy and install them, but without success. Is there a way to do this?

The easy solution seems to be to boot using an installation DVD or Windows system repair disk and have it repair the boot loader. That doesn't work, however, because the disk doesn't recognize my USB 3 keyboard and mouse, so I stay stuck at the first screen. Motherboard manufacturers do provide a tool to install USB 3 drivers on the installation DVD, but the installation DVD still complains that the version of Windows on the computer isn't the same as the one on the DVD: I have Windows 7 64 SP 1 (6.1.7601) on both, but presumably the updates I've installed from time to time lead my computer to think I have a different version from the DVD.

Using USB 2 doesn't help. Does Windows 7 really expect PS/2?

I'd rather avoid reinstalling Windows and all my programs, obviously.

Edit: to be clearer, the hardware has no problem with EFI and GPT. The problem is getting Windows to boot using EFI.
 
TwistedKestrel
Gerbil Elite
Posts: 667
Joined: Mon Jan 06, 2003 4:29 pm

Re: Manually install Windows 7 UEFI boot files

Sun Aug 19, 2018 8:46 pm

I'm gonna say this is probably not possible. I guess you could try installing Windows 7 to a different drive and then image the extra partitions it creates for UEFI. Is there a particular reason you want to switch it to UEFI boot?
 
just brew it!
Gold subscriber
Administrator
Posts: 51540
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Manually install Windows 7 UEFI boot files

Sun Aug 19, 2018 9:02 pm

TwistedKestrel wrote:
I'm gonna say this is probably not possible. I guess you could try installing Windows 7 to a different drive and then image the extra partitions it creates for UEFI.

After reading the first post I was going to recommend something similar. I've essentially had to do this in the past to get proper UEFI boot partitions on both members of a RAID1 array when booting from a software RAID array in Linux.

TwistedKestrel wrote:
Is there a particular reason you want to switch it to UEFI boot?

TBH I can't think of a compelling reason to do this either, unless he's installed to a >2TB disk and wants to get the "missing" capacity back.
Nostalgia isn't what it used to be.
 
Yan
Silver subscriber
Gerbil Team Leader
Topic Author
Posts: 232
Joined: Fri Dec 21, 2012 9:37 pm
Location: Ottawa

Re: Manually install Windows 7 UEFI boot files

Sun Aug 19, 2018 9:16 pm

TwistedKestrel wrote:
Is there a particular reason you want to switch it to UEFI boot?

So I can finally go from CentOS 6 to 7, since I can't find any way to install CentOS 7 withour switching from MBR to GPT.
 
just brew it!
Gold subscriber
Administrator
Posts: 51540
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Manually install Windows 7 UEFI boot files

Sun Aug 19, 2018 10:06 pm

Oh... this is dual boot + UEFI? Good luck with that.

Edit: Maybe try installing CentOS on a non-UEFI system, and transfer the image over (to keep everything MBR)?
Nostalgia isn't what it used to be.
 
DancinJack
Grand Gerbil Poohbah
Posts: 3863
Joined: Sat Nov 25, 2006 3:21 pm
Location: Kansas

Re: Manually install Windows 7 UEFI boot files

Sun Aug 19, 2018 10:28 pm

Hooooo boy. Any chance you could run either in a VM instead of a full install? Obviously depends on your use cases, but that'd be sooooo much easier.
i7 6700K - Z170 - 16GiB DDR4 - GTX 1080 - 512GB SSD - 256GB SSD - 500GB SSD - 3TB HDD- 27" IPS G-sync - Win10 Pro x64 - Ubuntu/Mint x64 :: 2015 13" rMBP Sierra :: Canon EOS 80D/Sony RX100
 
just brew it!
Gold subscriber
Administrator
Posts: 51540
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Manually install Windows 7 UEFI boot files

Sun Aug 19, 2018 10:30 pm

DancinJack wrote:
Hooooo boy. Any chance you could run either in a VM instead of a full install? Obviously depends on your use cases, but that'd be sooooo much easier.

Yup. If either your Windows or Linux use case is amenable to running in a VM, that would likely be the path of least resistance.

This is, of course, dependent on you not running on a legacy CPU that lacks VT-x/SVM support.
Nostalgia isn't what it used to be.
 
Yan
Silver subscriber
Gerbil Team Leader
Topic Author
Posts: 232
Joined: Fri Dec 21, 2012 9:37 pm
Location: Ottawa

Re: Manually install Windows 7 UEFI boot files

Sun Aug 19, 2018 10:32 pm

DancinJack wrote:
Hooooo boy. Any chance you could run either in a VM instead of a full install? Obviously depends on your use cases, but that'd be sooooo much easier.

It's making me seriously think about switching to Debian, even though I've used Red Hat/CentOS for 20 years, since I have no trouble installing Debian.
 
qmacpoint
Gerbil
Posts: 44
Joined: Wed Mar 14, 2018 12:56 pm

Re: Manually install Windows 7 UEFI boot files

Sun Aug 19, 2018 10:47 pm

Did you enable UEFI-only mode in your motherboard to test? Also, as far as I'm aware, UEFI should pick up generic keyboard/mice regardless - do you need to perform a BIOS/UEFI update?

You may want to try this guide to create manually the UEFI boot partition with in your computer - don't think you actually need to "install" anything:
https://social.technet.microsoft.com/wi ... -uefi.aspx

Also, I was a heavy CentOS user way back, and I moved to Debian/Ubuntu with no regrets - while I still use CentOS for server builds, I also use Debian with no problems
 
LostCat
Gerbil Jedi
Posts: 1986
Joined: Thu Aug 26, 2004 6:18 am
Location: Alphanumeric symbols.

Re: Manually install Windows 7 UEFI boot files

Mon Aug 20, 2018 12:16 am

Yan wrote:
Using USB 2 doesn't help. Does Windows 7 really expect PS/2?

Windows 7 doesn't understand USB3 hardware without drivers. It supports USB2 fine, which probably won't help if you've only got USB3 ports.

Sadly I can't help you. Your driver DVD might just be crap though, if you can get the drivers off the internet instead they're better.
Meow.
 
Ryu Connor
Gold subscriber
Global Moderator
Posts: 4320
Joined: Thu Dec 27, 2001 7:00 pm
Location: Marietta, GA
Contact:

Re: Manually install Windows 7 UEFI boot files

Mon Aug 20, 2018 12:52 am

I've created a partition for the EFI boot files and tried various ways to copy and install them, but without success. Is there a way to do this?


Yes, but it's a rabbit hole I'm not sure you want to go down.

Your partition must be GPT. You must have an EFI System Partition (100MB), an MSR partition of at least 128MB (Windows 7), and then finally your primary partition for the OS.

You will need to then boot from a Windows thumb drive or DVD in UEFI mode. If you built the Windows 7 thumb drive or DVD with only MBR mode, you cannot do this.

Once the Windows 7 installer is booted up in UEFI mode. You'll shift shift+F10, which opens a command prompt and type in bcdboot c:\windows. Winload.efi and the corresponding supporting files should not be created on the EFI System Partition.

The easier solution is to just backup your OS partition only, wipe the drive, boot up the WIndows install media in UEFI and install fresh. Then restore your backup of just the OS partition.

Windows built in imaging tools could aid with the latter option.
All of my written content here on TR does not represent or reflect the views of my employer or any reasonable human being. All content and actions are my own.
 
just brew it!
Gold subscriber
Administrator
Posts: 51540
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Manually install Windows 7 UEFI boot files

Mon Aug 20, 2018 6:08 am

Ryu Connor wrote:
Yes, but it's a rabbit hole I'm not sure you want to go down.
...

...and even if he goes down that rabbit hole, he's still got to go down the UEFI dual-boot rabbit hole too. It might "just work", but I would not count on it.
Nostalgia isn't what it used to be.
 
bthylafh
Maximum Gerbil
Posts: 4084
Joined: Mon Dec 29, 2003 11:55 pm
Location: Southwest Missouri, USA

Re: Manually install Windows 7 UEFI boot files

Mon Aug 20, 2018 8:09 am

just brew it! wrote:
Oh... this is dual boot + UEFI? Good luck with that.


Maybe it's gotten easier since the last time you tried it, but I set it up on my computer a couple weeks ago and it Just Worked. I've got Win10 on my NVME SSD and Kubuntu 18.04 on my previous computer's SSD; Grub set itself up on sda and saw the Windows boot loader on the other drive. Couldn't have been easier, really.
Hakkaa päälle!
i7-8700K|Asus Z-370 Pro|32GB DDR4|Asus Radeon RX-580|Samsung 960 EVO 1TB|1988 Model M||Logitech MX 518 & F310|Samsung C24FG70|Dell 2209WA|ATH-M50x
 
Yan
Silver subscriber
Gerbil Team Leader
Topic Author
Posts: 232
Joined: Fri Dec 21, 2012 9:37 pm
Location: Ottawa

Re: Manually install Windows 7 UEFI boot files

Tue Aug 21, 2018 10:26 pm

I'm pretty far down the rabbit hole already; another metre or two won't make a difference. ;-)

Let's try a different approach. Why can't I boot CentOS 7 using "legacy" Grub 0.97? What causes Grub 0.97 to be incompatible? A difference in ext4fs? If so, I should be able to format using mkfs from CentOS 6, install CentOS 7 on that partition, and boot using Grub 0.97, right?

I guess this is no longer in the right forum...
 
Yan
Silver subscriber
Gerbil Team Leader
Topic Author
Posts: 232
Joined: Fri Dec 21, 2012 9:37 pm
Location: Ottawa

(Solved) Manually install Windows 7 UEFI boot files

Fri Aug 31, 2018 7:20 pm

After a lot of trial and error, I finally managed to do it. I think I should explain what I did in case it might help others.

To summarize (and simplify), my problem was as follows. I had Windows 7 installed on a MBR hard drive. I wanted to install Linux (CentOS 7) and have a dual-boot system. To do this, I had to change my hard drive from MBR to GPT.

You’ll need to plan for at least two additional partitions on the hard drive, one for Linux and one for a UFI boot partition. You’ll probably also want a third partition, for swap.

You’ll also need the following:

1. System Recovery media for Windows. This can (and probably should) be the Windows installation DVD, but if you’re using Windows 7, you’ll need to create a USB drive with USB drivers using the utility provided by your motherboard’s manufacturer. (I don’t know about Windows 10.)

2. CD/DVD or USB media to install Linux.

3. A live Linux CD/DVD or USB media with at least gdisk and sgdisk, and preferably gparted (and therefore X Window). This can be the Linux installation media if it has a rescue mode. I used System Rescue CD.

Of course, you’ll also need a motherboard that supports UEFI. ;-)

Here’s the procedure:

1. Boot from the Linux live media. Use gparted if necessary to create the additional partitions you’ll need. The UFI partition can apparently be quite small; even 100 MB is enough.

2. Using the same Linux live media, change the hard drive from MBR to GPT using sgdisk -g /dev/sda (for example). Mark the UFI partition as type EF00. If gdisk complains, tell it to recover the hard drive information as an MBR hard drive and then re-write the partition table.

3. Format the UFI partition as FAT 32 and mark it as type EF00. This should also label it as a boot partition, but check using gparted.

4. If necessary, reboot and change your BIOS options to switch to EFI mode.

5. Reboot using the Windows System Recovery media. You’ll need to install the EFI boot files in the UFI partition you just created. Telling Windows to repair your system should be enough. If not, try the instructions here.

6. Now reboot using the Linux installation media. Install Linux. You’ll have to specify a UFI partition to mount at /boot/ufi, at least with CentOS 7. Use the UFI partition you previously created. Don’t format it; this partition will be the UFI partition for both Windows and Linux.

7. During the installation procedure, Linux should automatically install Grub2 with an option to boot Linux and an option to boot from the “Windows Boot Manager”.

It doesn’t sound hard, but if you can get it right without instructions the first time, or even the third time, you’re smarter than I am. ;-)
 
just brew it!
Gold subscriber
Administrator
Posts: 51540
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Manually install Windows 7 UEFI boot files

Fri Aug 31, 2018 7:40 pm

Glad to hear you got it sorted!
Nostalgia isn't what it used to be.

Who is online

Users browsing this forum: No registered users and 1 guest