Contents

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:

  1. Your EFI partition might end up being too small to actually be able to install a linux distro (or multiple)
  2. 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.

  1. 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.
  2. Delete all existing partitions.
  3. Press Shift + F10 to open the command prompt
  4. diskpart.exe
  5. list disk to figure out which disks you have, and then select 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.
  6. clean and then convert gpt
  7. EFI partition:
    1. create partition efi size=1024
    2. format quick fs=fat32 label="System"
  8. MSR partition: create partition msr size=16
  9. Recovery partition:
    1. create partition primary size=2048
    2. format quick fs=ntfs label="Recovery"
    3. set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
    4. gpt attributes=0x8000000000000001 8, 14 0’s, 1
  10. OS partition: create partition primary (this will fill the remainder of the disk)
  11. Sanity check with list volume and list 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
    
  12. exit to exit diskpart.exe, and then another exit to exit the console and go back to the partition screen.
  13. Click the Refresh button to find the new partitions you just created.
  14. Select the large unallocated space you have (multiple hundreds of GB) and hit Next, which will install Windows on that drive.
  15. Finish up the rest of the OS install as normal.

References