Drive Partitioning for Dual Booting Windows And Linux
Contents
The conventional advice when setting up a single drive for dual booting Windows and Linux is to first install Windows (possibly telling Windows to only use a portion of your drive during the installation procedure), and then afterwards installing your Linux distro of choice on the remaining space (potentially requiring shrinking the Windows partition). There are two potential problems with this approach:
- Your EFI partition might end up being too small to actually be able to install a linux distro (or multiple)
- The recovery partition being right after the Windows partition makes it annoying to resize the Windows partition (as you have to move the recovery partition first)
To work around both of these problems, you can tell Windows to use a slightly different partition setup during the installation. Instructions are derived from here and here.
- Get through the first few steps of the Windows installation process, and then click on “custom” for installation until you get to the partition menu.
- Delete all existing partitions.
- Press
Shift + F10
to open the command prompt diskpart.exe
list disk
to figure out which disks you have, and thenselect disk n
to select the right disk. You might have multiple disks show up if you have e.g. a flash drive plugged in for install, so make sure to pick the right one.clean
and thenconvert gpt
- EFI partition:
create partition efi size=1024
format quick fs=fat32 label="System"
- MSR partition:
create partition msr size=16
- Recovery partition:
create partition primary size=2048
format quick fs=ntfs label="Recovery"
set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
gpt attributes=0x8000000000000001
8, 14 0’s, 1
- OS partition:
create partition primary
(this will fill the remainder of the disk) - Sanity check with
list volume
andlist part
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
DISKPART> list volume Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- Volume 0 C Windows NTFS Partition 950 GB Healthy Boot Volume 1 SYSTEM FAT32 Partition 1024 MB Healthy System Volume 2 Recovery NTFS Partition 2048 MB Healthy Hidden DISKPART> list part Partition ### Type Size Offset ------------- ---------------- ------- ------- Partition 1 System 1024 MB 1024 KB Partition 2 Reserved 16 MB 1025 MB Partition 3 Recovery 2048 MB 1041 MB Partition 4 Primary 950 GB 3089 MB
exit
to exitdiskpart.exe
, and then anotherexit
to exit the console and go back to the partition screen.- Click the
Refresh
button to find the new partitions you just created. - Select the large unallocated space you have (multiple hundreds of GB) and hit
Next
, which will install Windows on that drive. - Finish up the rest of the OS install as normal.