How I Dual-booted Linux Mint alongside Windows 10 on a UEFI system
Other than one detail, this post is simply an amalgam of the most useful instructions from every other Linux/Win10 dual-boot tutorial I encountered on the Internet.
My sole contribution is this: once you are finished with the Linux install, you will need to instruct a bootloader within UEFI to use GRUB.
I didn't see this detail anywhere else, and it's the primary reason for this post's existence. When I logged into Windows for the first time after installing Linux Mint 17.2, the computer never booted into GRUB again, and just continued to load Windows as if GRUB and Linux didn't exist. The solution to that problem is described in step 7.
Here are basic the steps I took, in case you want a tl;dr. More information is included further down.
1. Shrink the Windows 10 partition using Windows Disk Manager, which will create a large chunk of unallocated space on your hard disk.
2. Boot up Linux with a live USB and begin installation.
3. Choose “Something else,” when asked how you would like to install Linux. None of the distros I played with recognized the existence of Windows 10.
4. In the “Installation type” part, use the majority of the newly unallocated space to mount the file system.
5. Assign the remaining unallocated space for swap.
6. Continue with the install normally.
7. Instruct UEFI to use GRUB as the default bootloader instead of a Windows bootloader.
There are many tutorials online about dual-booting a Linux distro onto a Windows 10 machine, but none of them got me from start to end. Some were simply updated versions (and often just updated titles) of articles about dual-booting Linux alongside Windows 7, and provided no new information pertaining to a UEFI secure-boot system.
The new UEFI system has thrown a hefty wrench into the otherwise smooth process that was installing Linux, so there's not yet a flawless, widely accepted method. It's likely the authors of the mostly-adequate articles simply didn't encounter the same problems I did, and thus didn't address them. For the same reason, you may find that this post doesn't address an issue you encounter.
This is not intended to be a tutorial, though some people may find it useful. I created it primarily to document my actions for the next time I install a Linux distro on a machine with UEFI. I'm going to try to keep this as concise as possible, so if you desire more information about UEFI, Linux, Windows 10, or anything else mentioned but not illuminated to your liking, you'll have to rely on your Google-Fu. I'll try to keep the explanations succinct. This is probably not an appropriate guide for beginners. It's written with the assumption that the reader has installed a Linux distro before. If you choose to replicate anything I describe here, you're on your own. As always, back up your data.
Background: I installed Linux Mint 17.2 on a machine with Windows 10 pre-installed on this HP laptop (for those who don't want to click the link, it has an i5-5200U processor, a 1TB hard drive, and 6GB ram [4+2]). I paid $350+tax+fees.
(1.) With your new machine, set up Windows 10. Use the disk manager to shrink the Windows partition; I prefer to do this in Windows because doing it outside Windows (in a Live USB session with Gparted, for example), tends to rile up Windows and force a disk check I don't want to have to wait through later.
For some reason, Windows 10 comes with a strangely high number of partitions. When you shrink the Windows partition, note the position of the newly unallocated space on the disk. When you install Linux, you'll notice there are multiple unallocated partitions. I don't know what the others do, but make sure you install Linux to the space you freed up (should be obvious – it will be much larger than the others).
When I took the screenshot of Disk Manager in Windows, I'd already completed this process, so the partitions shown reflect a finished job. It'll look different for you. Adjust your brain accordingly.
Open File Explorer > right-click on This PC > click Manager > Select Disk Management, and commence the shrinking.
Likely unrelated problem I encountered: When I attempted to shrink the partition, it would only shrink to about 500GB from 900GB (on a 1TB HD), despite the fact that only 45GB was used. I wanted to shrink it to 100GB. I think this problem was specific to the machine I purchased; most likely, a file or two had been written in the middle of the partition instead of at the beginning. So, I had to do it in a Linux Live session and use Gparted to get it down to 100GB.
Then, before installing Linux, I booted back into Windows 10 to see how it would react. It booted normally, but didn't reflect any of the changes I'd made. I then went to initiate a disk check but couldn't figure out how to do so in the new OS, or even how to boot into safe mode (this might just be me though – I haven't used Windows regularly since XP). After some googling, I learned that if you hold the shift key when you click “restart,” Windows 8 & 10 machines will initiate a trouble shooting process which allows the user to perform a number of maintenance tasks. I instructed it to perform a disk check, and after a reboot, Windows 10 recognized the changes. Later, I realized this occurred because I learned that Windows 10 doesn't actually shut down when you tell it to shut down... that separate issue is detailed at the end of this post.
(2.) Boot Linux with a Live USB, and begin the install procedure (I tend to stick to Ubuntu or Ubuntu-based distros, just because that's what I'm accustomed to, which in this case is Linux Mint – your choice distro's install process may be different). Move through the first few steps of the process.
(3.) Linux will not recognize the existence Windows 10, so there will be no option to “Install alongside Windows 10.” It will offer to wipe the disk and install fresh, or “Something else.” Choose “Something else.”
(4.) Designate a partition for Linux. Here's what my drive looked like entering this step.
For the most part, I followed the steps delineated on this page. They instruct the user to create a separate /home partition as well, which I ignored (it would be handy, I guess, if you're a super enthusiast who changes distros constantly, or are planning to have more than one distro on your machine, but I am not one of those people).
When mounting the file system, you'll use the vast majority of the unallocated space you created when you shrunk the Windows 10 partition, minus a small segment to be used for the swap area (which should be 1.5-2 times the amount of RAM in your machine – I made mine 16GB because I plan to upgrade to 8GB of RAM soon).
In short, just click the + button and fill out the form that pops up to look similar to this.
The result should look something like this.
(5.) Designate the remaining space as swap (NOT one of the random unallocated partitions that were present before; I don't know what those do or why they're there, but it's probably not wise to mess with them).
(6.) Continue the install normally.
(7.) When you first boot the machine, it will enter GRUB as expected, and you'll be proud of yourself because you'll think you did a very good job. But at some point you'll boot into Windows, and then you'll encounter a problem. From that point forward, the machine will boot straight into Windows, and it will be as if GRUB and Linux never existed. I discovered that there's a second bootloader (or something?) in UEFI, and like GRUB, it has a boot order. Changing the order is exactly the same as it was with BIOS. The trick, I guess, is just knowing it exists (if you know how to do this, you can probably leave now. I suppose this post could have simply consisted of a single sentence, “CHANGE THE BOOT ORDER IN BIOS/UEFI TOO,” but this is a blog, so I feel obligated to post details even in spite of my earlier arrogant mini-rant about Google-Fu).
The first time it happened to me I used one of those GRUB repair tools which are primarily made for inadvertent deletions of GRUB. This worked temporarily, but didn't ultimately solve the problem. The next time I booted into Windows 10, I was met with the exact same issue again.
With my machine, mashing F9 during boot will bring up the boot menu, which is normally where I go if I want the machine to boot from a live USB (as do you, through the button you mash may be different). In this case, I noticed there was a “ubuntu” option and a “Windows Boot Manager” option along with the expected options for HDD, SSD, USB, optical drive, etc. And so, just as you can change the boot order to assign priority to USB or CD drive, you'll change the order to give the “ubuntu” option priority over the “Windows Boot Manager” option.
Here's what the boot menu looked like. Notice the Windows option is at the top, and thus has priority. Apologies for the cell phone pics of my screen.
Enter BIOS, or UEFI, or whatever it's called now. Under the System Configuration tab, select Boot Options.
In the new menu, scroll down to OS Boot Manager under the UEFI Boot Order submenu. A small window will appear and display the two options. In my case, the Windows Boot Loader option was above the “ubuntu” option, so I pressed F5 (or F6) to change the order.
Once the order is changed, save and exit. From now on, the computer should always boot into GRUB, which will then give you the option to boot into either Linux or Windows.
One last, mostly unrelated thing – I've always created a partition to be shared between Windows and Linux, but with this new Windows 10 machine, I'd been unable to mount this partition in Linux. This is because Windows 8/8.1/10 doesn't actually shut down when you tell it to. It does a “hybrid shut down,” which is basically a log-off and a hibernate, which is intended to increase boot-up time. In the image I posted of Windows Disk Manager, you may have noticed that I created a partition called “Middle Partition,” which is an NTFS formatted partition I use to transfer files between the to OSs. (I don't use it much anymore, but back when HD videos ran much better in Windows [they still do, but the gap has narrowed significantly in the last five years or so] I would download them with Linux and then play them in Windows). Linux will now refuse to mount this HDD DMZ because it is still mounted in Windows, all because Windows wasn't really shut down. The solution is to bypass this process and do a full shut down of Windows by pressing the shift key when you click “shut down.” There may be an option to make that the default, but I haven't looked into it yet. The issue I mentioned earlier (about how I had to figure out how to run a disk check because Windows 10 didn't recognize that I'd shrunk its partition with Gparted) probably would have been solved if I'd just executed this process for a full shut down, and then the disk check would have occurred automatically.
Hope this helps.