$linuxjunkies
>

How to Dual-Boot Linux and Windows

Shrink the Windows partition, install Linux without breaking the bootloader, configure GRUB, and handle Secure Boot — all in the correct order.

IntermediateUbuntuDebianFedoraArch9 min readUpdated June 7, 2026

Before you start

  • A USB drive of at least 8 GB for the Linux installer
  • A full backup of Windows data before resizing partitions
  • At least 40 GB of free space available to shrink from the Windows partition
  • UEFI firmware access (F2/Del/F12 at POST) to adjust boot order if needed

Dual-booting Linux alongside Windows gives you the best of both worlds without committing to virtualisation overhead. The process is straightforward if you respect the order of operations: Windows first, then Linux, then bootloader cleanup. Rush through partition work or ignore Secure Boot and you will spend an afternoon recovering a system. Follow these steps carefully and you will have a working dual-boot in under two hours.

Before You Touch a Partition

Back up everything on the Windows side. Partition operations are non-destructive in theory; in practice, power cuts and firmware bugs exist. Use Windows Backup, Macrium Reflect Free, or at minimum copy your irreplaceable files to an external drive.

Also confirm your firmware mode. Open a PowerShell prompt on Windows and run:

Confirm-SecureBootUEFI

If it returns True, you are on UEFI with Secure Boot enabled. If it throws an error about not being supported, you are likely on legacy BIOS/MBR. The steps below assume UEFI, which is standard on any machine shipped after 2012. Legacy BIOS users should use an MBR partition table and skip the Secure Boot section.

Step 1: Shrink the Windows Partition

Do this from inside Windows, not from the Linux installer. Windows tracks its own metadata on NTFS volumes; letting Linux tools resize them risks corruption.

Open Disk Management (Win+X → Disk Management), right-click your C: volume, and choose Shrink Volume. Windows will calculate the maximum shrinkable amount. Give Linux at least 40 GB; 80–120 GB is comfortable for a daily-driver install.

If Windows refuses to shrink past a certain point, unmovable system files (hibernation file, page file, VSS snapshots) are in the way. Disable them temporarily:

# Run each in an elevated PowerShell
Powercfg /h off
# Then in Settings → System → About → Advanced System Settings
# set the page file to 'No paging file', reboot, shrink, then re-enable both

After shrinking you will see unallocated space on the drive. Leave it unallocated — the Linux installer will claim it.

Step 2: Handle Secure Boot

Modern Linux distributions — Ubuntu 22.04+, Fedora 37+, and recent Arch ISOs with signed kernels — support Secure Boot out of the box via Microsoft-signed shim loaders. You do not need to disable Secure Boot for these distros.

If your chosen distro does not ship a signed shim (some minimal or rolling-edge images), you have two options:

  • Disable Secure Boot in your UEFI firmware settings (look under Security or Boot tabs). This is safe but means the firmware will not validate bootloaders at startup.
  • Enroll your own Machine Owner Key (MOK) after install using mokutil — covered in Step 5.

Step 3: Boot the Linux Installer

Write your ISO to a USB drive. On Linux use dd or a tool like Ventoy. On Windows, Rufus works well — choose GPT partition scheme and UEFI (non-CSM) mode.

# On an existing Linux system:
sudo dd if=ubuntu-24.04-desktop-amd64.iso of=/dev/sdX bs=4M status=progress oflag=sync

Replace /dev/sdX with your actual USB device — confirm with lsblk first. Reboot, enter your firmware boot menu (usually F12, F8, or Del at POST), and select the USB.

Step 4: Partition and Install Linux

When the installer reaches the partitioning screen, choose the manual/custom option rather than "Install alongside Windows" — the automatic option works most of the time but gives you no control over partition sizes.

In the unallocated space, create:

  • An EFI System Partition (ESP) only if one does not already exist. On a dual-boot system Windows has already created a 100–260 MB FAT32 ESP. Mount that existing partition at /boot/efi — do not format it. Formatting the ESP deletes the Windows bootloader.
  • A root partition: ext4, mounted at /, use most of the remaining space.
  • Optionally a swap partition (1–2× RAM) or a swap file post-install.

Proceed through the installer. When it finishes and reboots, GRUB should appear with entries for both Linux and Windows.

Step 5: Enroll a MOK (If Needed)

If you disabled Secure Boot in Step 2 and want to re-enable it, or if your distro uses a self-signed kernel module (common with NVIDIA proprietary drivers or custom kernels), you need to enroll a Machine Owner Key.

# Debian/Ubuntu
sudo mokutil --import /var/lib/shim-signed/mok/MOK.der

# Fedora (after installing a signed kernel; usually automatic)
sudo mokutil --list-enrolled

On next reboot the MOK Manager (a blue UEFI screen) will prompt you to confirm enrollment. Enter the one-time password you set with mokutil and confirm. The key is then trusted by the firmware.

Step 6: Fix or Reinstall GRUB

GRUB is usually installed correctly by the distro installer. If you boot into Windows by default with no GRUB menu, Windows has overwritten the EFI boot order. Fix it from a live USB or from Linux if you can reach it.

Debian/Ubuntu

sudo apt install --reinstall grub-efi-amd64
sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ubuntu
sudo update-grub

Fedora / RHEL / Rocky

sudo dnf reinstall grub2-efi grub2-efi-modules shim
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
sudo efibootmgr -c -d /dev/sda -p 1 -L "Fedora" -l '\EFI\fedora\shimx64.efi'

Arch Linux

sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB
sudo grub-mkconfig -o /boot/grub/grub.cfg

After any of the above, run efibootmgr to confirm the boot order puts Linux first:

sudo efibootmgr -v

If the Windows Boot Manager is listed first, move GRUB to position 0:

sudo efibootmgr --bootorder XXXX,YYYY
# XXXX = your GRUB entry number from efibootmgr -v output

Step 7: Verify Both OSes Boot

Reboot. You should see the GRUB menu with entries for your Linux distribution and "Windows Boot Manager". Select Windows and confirm it reaches the desktop without chkdsk complaints. Reboot again and confirm Linux boots cleanly.

If the Windows entry is missing from GRUB, run:

# Debian/Ubuntu
sudo apt install os-prober
sudo os-prober
sudo update-grub

# Fedora/Arch — os-prober may be disabled by default in grub config
# Edit /etc/default/grub and add:
# GRUB_DISABLE_OS_PROBER=false
# Then regenerate the config

Troubleshooting

Windows complains about fast startup / dirty NTFS

Windows Fast Startup (a hybrid sleep/shutdown) leaves the NTFS filesystem in a hibernated state. Linux will refuse to mount it read-write. Disable Fast Startup in Windows: Control Panel → Power Options → Choose what the power buttons do → Turn on fast startup → uncheck it. Always shut Windows down fully rather than using restart-from-Linux workarounds.

Clock skew between Windows and Linux

Linux stores the hardware clock in UTC; Windows defaults to local time. Fix this on the Windows side (recommended) or on Linux:

# Make Linux use local time to match Windows default (not recommended for servers)
timedatectl set-local-rtc 1 --adjust-system-clock

The cleaner fix: set Windows to use UTC via a registry entry (HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\RealTimeIsUniversal = 1 DWORD).

GRUB boots to command line instead of a menu

This usually means grub.cfg was not generated. Boot into your live USB, chroot into the install, and run the appropriate update-grub or grub-mkconfig command from Step 6.

tested on:Ubuntu 24.04Fedora 40Arch 2024.05Debian 12

Frequently asked questions

Does it matter which OS I install first?
Always install Windows first. Windows overwrites the EFI boot order and assumes it owns the drive; installing it after Linux destroys GRUB. Installing Linux second means you only need to ensure GRUB detects Windows, which os-prober handles automatically.
Can I share files between Windows and Linux?
Yes. Linux can read and write NTFS volumes reliably using the ntfs3 kernel driver (Linux 5.15+) or ntfs-3g. Disable Windows Fast Startup first to prevent NTFS journal conflicts.
Will Windows Updates break my GRUB bootloader?
Major Windows feature updates occasionally reset the EFI boot order so Windows Boot Manager loads first, bypassing GRUB. Run efibootmgr after major Windows updates to restore GRUB's position, or reinstall GRUB from Linux.
How do I remove Linux and go back to Windows only?
Boot a Windows recovery drive, open a command prompt, and run 'bcdedit /set {bootmgr} path \EFI\Microsoft\Boot\bootmgfw.efi' to restore the Windows bootloader. Then delete the Linux partitions from Windows Disk Management and extend C: back into the freed space.
My laptop uses BitLocker — is dual-booting safe?
Proceed carefully. Installing Linux or changing the EFI boot order can trigger BitLocker's TPM measurement checks and lock you out of Windows. Suspend BitLocker from Windows before partitioning or changing boot settings, then resume it after everything is working.

Related guides