Unofficial: Dualboot with Windows
This guide uses the official installer image. Instead of letting the installer
wipe the disk, you run a similar systemd-repart --copy-from command it uses
yourself, but against a disk that already has Windows on it. Your Windows partitions
and the EFI system partition (ESP) are left as they are, and AstrOS is added next to them.
Prepare windows
Section titled “Prepare windows”-
Your EFI Partition needs to be at least 1G.
For existing installs use: Arch Wiki: Replace the partition with a larger one
For fresh installs use: Arch Wiki: dictate the size of the EFI system partition during installation
-
Disable Secure Boot and verify that Windows still boots up. You can re-enable it later with the
astros+microsoftsecureboot keys. -
Lastly, open Disk Management and shrink your Windows NTFS partition.
Install AstrOS
Section titled “Install AstrOS”-
Download the official installer and write it to a USB stick as described on the installation page.
-
Boot the USB stick. The installer starts on its own. Just leave it on its first screen and don’t answer its prompts.
-
Switch to a second console with Ctrl+Alt+F2 and log in as
rootwith the passwordAstrOS. -
Find your Windows disk. It’s the one with the
EFI System,Microsoft reservedandMicrosoft basic datapartitions:Terminal window lsblk -o NAME,SIZE,PARTTYPENAME,PARTLABEL -
Dry run the installation. Compared to the installer,
--empty=force(wipe the disk) is replaced by--empty=refuse(keep the existing partition table):Terminal window DEFS=$(mktemp -d)systemd-repart \--dry-run=yes \--empty=refuse \--seed=random \--definitions="$DEFS" \--copy-from=/images/AstrOS.raw \"/dev/disk-containing-windows"Check the output:
- The ESP and all Windows partitions must show no changes (no
→in their size column). - Make sure
AstrOS_<version>gets the remaining free space as padding. First boot uses it to grow/usrto 5G and to create the second update slot and your encrypted root partition.
- The ESP and all Windows partitions must show no changes (no
-
If everything looks good, run it again with
--dry-run=no. -
Since the ESP already existed,
systemd-repartkept it as it is and didn’t copy anything into it. Copy the content of the image’s ESP to your system’s ESP:Terminal window LOOP=$(losetup -frP --show /images/AstrOS.raw)mkdir -p /mnt/image-esp /mnt/espmount -o ro "${LOOP}p1" /mnt/image-espmount "/dev/esp-partition" /mnt/espcp -rv /mnt/image-esp/. /mnt/esp/umount /mnt/image-esp /mnt/esplosetup -d "$LOOP" -
Create a boot entry (only required on some hardware).
Terminal window efibootmgr --create --disk /dev/sdX --part Y --loader '\EFI\systemd\systemd-bootx64.efi' --label "AstrOS" --unicode -
Reboot and remove the USB stick:
Terminal window systemctl reboot