Skip to content

Arch Linux Multi Boot Windows

Prerequisite

Assumptions

  • Use a UEFI compatible computer system hardware
  • Operating systems to be installed
    • Windows 10 Pro Build 1909 (production)
    • Arch Linux (production)
    • Arch Linux (testing)
  • Each operating system has a dedicated hard drive
  • Each hard drive is empty (no files, no partitions)
  • ESP (EFI system partition) located on the Windows hard drive
  • Have two USB flash drives
    • Windows
    • Arch Linux

Preparation

  1. Create A Bootable Microsoft Windows USB Flash Drive.
  2. Create a bootable Arch Linux USB Flash Drive.
  3. Physically disconnect all hard drives, except the desired drive for the use of Windows.

Installation of Windows

  1. Plug in the Microsoft Windows USB flash drive.
  2. Power on the computer system.
  3. At boot time select the USB flash drive to boot from. Steps vary depending on BIOS used.
  4. Select Custom Installation.
  5. Delete all partitions on the selected hard drive.
  6. Select "unallocated space".
  7. Left mouse click on the button "New" then the button "Apply". You will be left with 4 partitions.
    • Recovery
    • System (ESP)
    • MSR
    • Primary
  8. Delete each partition by left mouse clicking on the partition then the button "Delete".

    • System
    • MSR (Reserved)
    • Primary

    Warning

    Do not delete the Recovery partition.

  9. Press Shift + F10 to open the command prompt.

  10. Run diskpart.
    C:\>diskpart.exe
    
  11. List disks.
    DISKPART> list disk
    
  12. Select desired disk.

    DISKPART> select disk 0
    

    Warning

    Do not select the USB flash drive.

  13. Create EFI partition.

    DISKPART> create partition efi size=560
    

  14. Select EFI partition.
    DISKPART> select partition 1
    
  15. Format EFI partition.
    DISKPART> format quick fs=fat32 label="WIN EFI"
    
  16. Exit Diskpart.
    DISKPART> exit
    
  17. Exit command prompt.
    C:\>exit
    
  18. Left mouse click on the button "Refresh" to see changes.
    • Recovery
    • WIN EFI
    • unallocated space
  19. Select "unallocated space".
  20. Left mouse click on the button "New" then the button "Apply".
    • Recovery
    • WIN EFI
    • MSR (Reserved)
    • Primary
  21. Left mouse click on the "Primary" partition then left mouse click on the "Next" button.
  22. Follow the on screen instructions to complete the Windows installation.
  23. Follow Windows disable sleep more and hibernation.

    Info

    This is done to avoid harm to the Windows hard drive. Windows must do a complete shutdown in order for this configuration to work.

  24. When installation has completed shut down the system.

  25. Re-connect all the disconnected hard drives.
  26. Unplug the Windows USB flash drive.

Installation of Arch Linux

  1. Plugin the Arch Linux USB flash drive.
  2. Power on the computer system.
  3. Follow Install Arch Linux.

    Warning

    Be careful to pick the correct drive for installation of the operating system.

  4. Follow Post-Install Arch Linux Configuration.

  5. Follow Arch Linux Automate EFI Partition Updates.

Note

Repeat this section again for the second hard drive.

Installation of Systemd-boot

  1. Boot into the primary Linux operating system, Arch Linux (production).
  2. Find the Windows EFI system partition (ESP) UUID.
    $ lsblk -f
    
    NAME   FSTYPE FSVER LABEL          UUID                                 FSAVAIL FSUSE% MOUNTPOINT
    sda                                                                                    
    ├─sda1 ntfs         Recovery       EA5672C356729055                                    
    ├─sda2 vfat   FAT32 WIN EFI        DAB8-549A                             430.3M    21%
    ├─sda3                                                                                 
    └─sda4 ntfs                        081E33AE1E3393A2                                    
    sdb                                                                                    
    ├─sdb1 vfat   FAT32                07ED-7884                                           
    └─sdb2 ext4   1.0   archlinux-test 0f43d7db-ce0c-4d12-a71f-7af646a1305b                
    sdc                                                                                    
    ├─sdc1 vfat   FAT32                5352-AC6C                             376.9M    24% /boot
    └─sdc2 btrfs        ArchLinux      cce03871-dc3b-4418-90f9-87ca427d4223  114.8G    51% /srv
    
  3. Mount the Windows EFI system partition (ESP).
    # mount -U DAB8-549A /boot/WIN
    
  4. Installl systemd-boot.
    # bootctl --path=/boot/WIN/ install
    
  5. Edit loader configuration.
    # nano /boot/WIN/loader/loader.conf
    
    default arch.conf
    timeout 5
    console-mode max
    editor no
    
  6. Create a loader entry for Arch Linux (production).
    # nano /boot/WIN/loader/entries/arch.conf
    
    title   Arch Linux
    linux   /EFI/arch/vmlinuz-linux
    initrd  /EFI/arch/initramfs-linux.img
    options root="UUID=cce03871-dc3b-4418-90f9-87ca427d4223" rootflags=compress=zlib,ssd,space_cache,subvol=ROOT rw
    
  7. Create a loader entry for Arch Linux (testing).
    # nano /boot/WIN/loader/entries/lab.conf
    
    title   Arch Linux (testing)
    linux   /EFI/lab/vmlinuz-linux
    initrd  /EFI/lab/initramfs-linux.img
    options root="UUID=0f43d7db-ce0c-4d12-a71f-7af646a1305b" rw
    
  8. Verify systemd-boot configuration.
    $ bootctl --path=/boot/WIN/ status
    
    System:
        Firmware: UEFI 32.31 (American Megatrends 4.653)
     Secure Boot: disabled
      Setup Mode: user
    
    Current Boot Loader:
         Product: systemd-boot 245.4-2-arch
        Features: ✓ Boot counting
                  ✓ Menu timeout control
                  ✓ One-shot menu timeout control
                  ✓ Default entry control
                  ✓ Default entry control
                  ✓ One-shot entry control
                 ✓ Support for XBOOTLDR partition
                 ✓ Support for passing random seed to OS
                 ✓ Boot loader sets ESP partition information
             ESP: /dev/disk/by-partuuid/d2f721a4-083f-4e05-b77e-9f01563fdfc8
            File: └─/EFI/SYSTEMD/SYSTEMD-BOOTX64.EFI
    
    Random Seed:
    Passed to OS: yes
    System Token: set
          Exists: yes
    
    Available Boot Loaders on ESP:
             ESP: /boot/WIN/ (/dev/disk/by-partuuid/d2f721a4-083f-4e05-b77e-9f01563fdfc8)
            File: └─/EFI/systemd/systemd-bootx64.efi (systemd-boot 245.4-2-arch)
            File: └─/EFI/BOOT/bootx64.efi (systemd-boot 245.4-2-arch)
    
    Boot Loaders Listed in EFI Variables:
           Title: Linux Boot Manager
              ID: 0x0003
          Status: active, boot-order
       Partition: /dev/disk/by-partuuid/d2f721a4-083f-4e05-b77e-9f01563fdfc8
            File: └─/EFI/SYSTEMD/SYSTEMD-BOOTX64.EFI
    
           Title: Arch Linux
              ID: 0x0001
          Status: active, boot-order
       Partition: /dev/disk/by-partuuid/a6b9debe-9f1f-45b3-884d-d16012f20268
            File: └─/vmlinuz-linux
    
           Title: Arch Linx Lab
              ID: 0x0002
          Status: active, boot-order
       Partition: /dev/disk/by-partuuid/cb897b05-6687-4f5d-8ab9-d3fa926cf6cc
            File: └─/vmlinuz-linux
    
           Title: Windows Boot Manager
              ID: 0x0000
          Status: active, boot-order
       Partition: /dev/disk/by-partuuid/d2f721a4-083f-4e05-b77e-9f01563fdfc8
            File: └─/EFI/MICROSOFT/BOOT/BOOTMGFW.EFI
    
    Boot Loader Entries:
           $BOOT: /boot/WIN/ (/dev/disk/by-partuuid/d2f721a4-083f-4e05-b77e-9f01563fdfc8)
    
    Default Boot Loader Entry:
           title: Arch Linux
              id: arch.conf
          source: /boot/WIN/loader/entries/arch.conf
           linux: /EFI/arch/vmlinuz-linux
          initrd: /EFI/arch/initramfs-linux.img
         options: root="UUID=cce03871-dc3b-4418-90f9-87ca427d4223" rootflags=compress=zlib,ssd,space_cache,subvol=ROOT rw
    
  9. Unmount Windows EFI system partition.
    # umount /boot/WIN
    
  10. Automate updating the EFI boot manager (systemd-boot) with a pacman hook.

    # pikaur -Sy systemd-boot-pacman-hook
    

    Info

    When the systemd package is updated the pacman hook (/usr/share/libalpm/hooks/systemd-boot.hook) is ran automatically.

    Tip

    This can be done manually by running # bootctl --path=/boot/WIN/ update without double quotes when the Windows EFI system partition is mounted.


Last update: September 16, 2020