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¶
- Create A Bootable Microsoft Windows USB Flash Drive.
- Create a bootable Arch Linux USB Flash Drive.
- Physically disconnect all hard drives, except the desired drive for the use of Windows.
Installation of Windows¶
- Plug in the Microsoft Windows USB flash drive.
- Power on the computer system.
- At boot time select the USB flash drive to boot from. Steps vary depending on BIOS used.
- Select Custom Installation.
- Delete all partitions on the selected hard drive.
- Select "unallocated space".
- Left mouse click on the button "New" then the button "Apply". You will be left with 4 partitions.
- Recovery
- System (ESP)
- MSR
- Primary
-
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.
-
Press Shift + F10 to open the command prompt.
- Run diskpart.
C:\>diskpart.exe
- List disks.
DISKPART> list disk
-
Select desired disk.
DISKPART> select disk 0
Warning
Do not select the USB flash drive.
-
Create EFI partition.
DISKPART> create partition efi size=560
- Select EFI partition.
DISKPART> select partition 1
- Format EFI partition.
DISKPART> format quick fs=fat32 label="WIN EFI"
- Exit Diskpart.
DISKPART> exit
- Exit command prompt.
C:\>exit
- Left mouse click on the button "Refresh" to see changes.
- Recovery
- WIN EFI
- unallocated space
- Select "unallocated space".
- Left mouse click on the button "New" then the button "Apply".
- Recovery
- WIN EFI
- MSR (Reserved)
- Primary
- Left mouse click on the "Primary" partition then left mouse click on the "Next" button.
- Follow the on screen instructions to complete the Windows installation.
-
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.
-
When installation has completed shut down the system.
- Re-connect all the disconnected hard drives.
- Unplug the Windows USB flash drive.
Installation of Arch Linux¶
- Plugin the Arch Linux USB flash drive.
- Power on the computer system.
-
Follow Install Arch Linux.
Warning
Be careful to pick the correct drive for installation of the operating system.
- Follow Arch Linux Automate EFI Partition Updates.
Note
Repeat this section again for the second hard drive.
Installation of Systemd-boot¶
- Boot into the primary Linux operating system, Arch Linux (production).
- 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
- Mount the Windows EFI system partition (ESP).
# mount -U DAB8-549A /boot/WIN
- Installl systemd-boot.
# bootctl --path=/boot/WIN/ install
- Edit loader configuration.
# nano /boot/WIN/loader/loader.conf
default arch.conf timeout 5 console-mode max editor no
- 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
- 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
- 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
- Unmount Windows EFI system partition.
# umount /boot/WIN
-
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.