How to Dual Boot Linux and Windows
Dual booting lets you keep Windows for the software that requires it while using Linux as your primary environment. The setup is not complicated, but there is a specific order to follow and several things that trip people up. This guide covers the complete process.
Before you start: things to know
Install Windows first. Windows Setup overwrites bootloaders, so Linux must always be the second OS installed. If you install Linux first, a Windows installation will erase GRUB and you will have to reinstall it.
Disable Fast Startup in Windows. Fast Startup is Windows’ default shutdown mode, which actually hibernates the system rather than fully powering off. If the Windows partition is in a hibernated state when Linux tries to mount it, the filesystem can be corrupted. Turn it off: Control Panel -> Power Options -> Choose what the power buttons do -> Turn off fast startup.
Disable BitLocker if enabled. If your Windows partition is encrypted with BitLocker, resizing it from within Windows or from a Linux installer can fail or require your recovery key. Check in Control Panel -> BitLocker Drive Encryption.
Back up important data. Partitioning operations carry a small but real risk of data loss, especially if power is interrupted during the resize.
Step 1: Shrink the Windows partition
Open Disk Management in Windows: press Win+X and choose “Disk Management” or run diskmgmt.msc.
Right-click your C: drive partition and select “Shrink Volume.” Windows will analyze how much it can safely shrink.
Before:
[EFI 512MB] [Windows C: 476GB]
After shrinking:
[EFI 512MB] [Windows C: 200GB] [Unallocated 276GB]
How much to shrink:
- Minimum for a basic Linux installation: 25GB
- Comfortable desktop with room for data: 60-100GB
- If Linux will be your primary OS: give it most of the disk
If Windows offers less shrink space than expected, it may be because the pagefile or hibernation file sits at the end of the partition. Temporarily disable hibernation in an Administrator Command Prompt:
powercfg /h off
After shrinking, restart Windows to verify it boots correctly, then proceed to install Linux.
Step 2: Disable Fast Startup
In Windows, go to Control Panel -> Power Options -> “Choose what the power buttons do” -> “Turn on fast startup” (uncheck it). This ensures Windows fully releases the NTFS filesystem on shutdown so Linux can safely mount the partition.
:: Alternatively, in an admin Command Prompt:
powercfg /h off
:: This disables hibernation, which also disables Fast Startup
Step 3: Check UEFI settings
Before installing Linux:
- Verify Secure Boot is set appropriately. Ubuntu and Fedora work with Secure Boot enabled. Some other distributions require it disabled.
- Ensure CSM/Legacy boot is disabled. Modern installers work natively with UEFI.
- Note: if your computer shipped with Windows 11, Secure Boot and TPM 2.0 are required for Windows, so leave them enabled and install a distribution with Secure Boot support.
Step 4: Create the Linux installer USB
See the Creating a Bootable USB article for the full process. Write the ISO with dd, Balena Etcher, or Rufus, then boot from it using the firmware boot menu (F11, F12, or Esc at startup).
Step 5: Install Linux
Boot the Linux live USB. Launch the installer. The critical step is the disk setup screen.
In the Ubuntu installer
Choose “Install Ubuntu alongside Windows Boot Manager.” The installer will show a slider to divide the unallocated space. Drag it to your preferred Linux partition size. This handles partitioning automatically.
For manual control, choose “Something else”:
Manual partition layout for dual boot (UEFI):
/dev/sda1 512MB FAT32 EFI System Partition <- use existing, do NOT format
/dev/sda2 200GB NTFS Windows C: <- do NOT touch
/dev/sda3 4GB swap Linux swap
/dev/sda4 ~272GB ext4 / (Linux root)
Set /dev/sda1 mount point to /boot/efi
Set /dev/sda4 mount point to /
Install bootloader to: /dev/sda (the whole disk, not a partition)
Critical: do not format the EFI partition. It already exists (Windows created it) and both OS bootloaders will share it. Only mount it at /boot/efi.
In the Fedora installer (Anaconda)
Choose “Custom” storage configuration and create:
/boot/efimounted on the existing EFI partition (do not reformat)- A btrfs or ext4 partition for
/from the unallocated space - Optionally a swap partition or swapfile
Step 6: Verify GRUB shows both systems
After installation completes and you reboot, GRUB should display a menu:
Ubuntu
Advanced options for Ubuntu
Windows Boot Manager (on /dev/sda1)
...
If Windows does not appear, run from Linux:
# Install os-prober if not present
sudo apt install os-prober # Debian/Ubuntu
sudo dnf install os-prober # Fedora
# On some distributions, os-prober is disabled by default
# Enable it:
echo "GRUB_DISABLE_OS_PROBER=false" | sudo tee -a /etc/default/grub
# Regenerate GRUB config
sudo update-grub # Debian/Ubuntu/Mint
sudo grub2-mkconfig -o /boot/grub2/grub.cfg # Fedora
Step 7: Configure GRUB defaults (optional)
# Edit GRUB defaults
sudo nano /etc/default/grub
# Key settings:
GRUB_DEFAULT=0 # 0 = first entry (usually Linux), or "Windows Boot Manager"
GRUB_TIMEOUT=10 # seconds to show menu before auto-booting default
GRUB_TIMEOUT_STYLE=menu # always show the menu (not hidden)
# After editing, regenerate grub.cfg
sudo update-grub # Debian/Ubuntu
sudo grub2-mkconfig -o /boot/grub2/grub.cfg # Fedora
To make Windows the default, find its exact GRUB menu entry name:
grep -i windows /boot/grub/grub.cfg
# menuentry 'Windows Boot Manager (on /dev/sda1)' ...
# Set it as default by name
sudo nano /etc/default/grub
# GRUB_DEFAULT="Windows Boot Manager (on /dev/sda1)"
sudo update-grub
Fixing GRUB after a Windows update
Windows updates occasionally reset the UEFI boot order, pushing Windows Boot Manager to first position. GRUB still exists but is no longer the first thing loaded.
Quick fix via UEFI settings: at startup, enter the UEFI firmware setup and look for “Boot Priority” or “Boot Order.” Move the Linux/GRUB entry to the top.
Restore GRUB if it is missing entirely:
# Boot from Linux live USB
# Identify your Linux root partition
lsblk -f
# Mount the Linux root partition
sudo mount /dev/sda4 /mnt # your Linux root partition
sudo mount /dev/sda1 /mnt/boot/efi # your EFI partition
# Bind-mount proc/dev/sys for chroot
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo mount --bind /sys/firmware/efi/efivars /mnt/sys/firmware/efi/efivars
# Chroot into the installed system
sudo chroot /mnt
# Reinstall GRUB (adjust --bootloader-id to match your distro)
grub-install --target=x86_64-efi \
--efi-directory=/boot/efi \
--bootloader-id=ubuntu \
--recheck
update-grub
# Exit and reboot
exit
sudo reboot
Accessing Windows files from Linux
# Linux can read/write NTFS natively
# Find the Windows partition
lsblk -f | grep ntfs
# Mount it (manual)
sudo mkdir -p /mnt/windows
sudo mount -t ntfs3 /dev/sda2 /mnt/windows
ls /mnt/windows/Users/
# Mount automatically at boot via /etc/fstab
# First get the UUID
sudo blkid /dev/sda2
# /dev/sda2: UUID="ABC123..." TYPE="ntfs"
# Add to /etc/fstab:
# UUID=ABC123... /mnt/windows ntfs3 defaults,nofail 0 0
# Warning: only mount the Windows partition if Windows was
# fully shut down (not hibernated / Fast Startup)
Common problems
Linux cannot see the unallocated space: the installer may not show unallocated space correctly if the partition table has fragmentation. Use GParted from the live environment to verify the layout.
GRUB shows only Linux: os-prober may be disabled. Enable it as shown above and regenerate grub.cfg.
Windows complains about “bootmgr is missing” after Linux install: the EFI partition may have been reformatted accidentally. Restore Windows Boot Manager with a Windows recovery USB: bootrec /fixboot and bootrec /rebuildbcd.
Clock is wrong after switching OSes: Windows stores hardware clock in local time; Linux stores it in UTC by default. Fix this by making Linux use local time: timedatectl set-local-rtc 1 --adjust-system-clock, or by making Windows use UTC (registry change).
Frequently Asked Questions
Why must Windows be installed before Linux in a dual boot setup?
Windows is notorious for overwriting the bootloader of any other OS on the disk when it installs or updates. If you install Linux first and then install Windows, Windows Setup will overwrite GRUB (the Linux bootloader) with the Windows Boot Manager, and Linux will appear to be gone. The correct order is: install Windows first, then install Linux. The Linux installer detects Windows and configures GRUB to show a boot menu with both operating systems. GRUB then chainloads Windows Boot Manager for the Windows entry, so both work correctly. If Windows updates later overwrite GRUB, you can restore it from the Linux live USB.
How do I shrink my Windows partition to make room for Linux?
Open Disk Management in Windows (Win+X -> Disk Management, or diskmgmt.msc). Right-click your Windows (C:) partition and select “Shrink Volume.” Windows will calculate the maximum shrink amount based on unmovable files. Enter the amount to shrink in MB — allocate at least 25,000MB (25GB) for Linux, more if you plan to store data there. Click Shrink. The freed space will appear as “Unallocated” and the Linux installer will see it. Note: if Windows reports a smaller maximum shrink than expected, it may be because system files like the hibernation file or pagefile are pinned near the end of the partition. Disabling hibernation (powercfg /h off in an admin Command Prompt) and the pagefile temporarily can free more space.
What is GRUB and how does it manage the dual boot menu?
GRUB (GNU GRand Unified Bootloader) is the bootloader installed by Linux. In a dual boot setup, GRUB becomes the first bootloader the UEFI firmware loads. At boot, GRUB displays a menu showing Linux and Windows as options, waits a few seconds (default: 5-10 seconds), then boots the default entry. The Windows entry in GRUB chainloads the Windows Boot Manager, which then loads Windows normally. GRUB is configured by /etc/default/grub (for settings like timeout and default OS) and /boot/grub/grub.cfg (auto-generated, do not edit directly). To regenerate grub.cfg after changes to /etc/default/grub, run sudo update-grub on Debian/Ubuntu or sudo grub2-mkconfig -o /boot/grub2/grub.cfg on Fedora.
What do I do if GRUB is overwritten by a Windows update?
Boot from your Linux live USB, open a terminal, and reinstall GRUB. First, find your Linux root partition with lsblk or fdisk -l. Then: sudo mount /dev/sda2 /mnt (replace sda2 with your Linux root partition), sudo mount /dev/sda1 /mnt/boot/efi (your EFI partition), sudo mount —bind /dev /mnt/dev, sudo mount —bind /proc /mnt/proc, sudo mount —bind /sys /mnt/sys, sudo chroot /mnt, grub-install —target=x86_64-efi —efi-directory=/boot/efi —bootloader-id=ubuntu, update-grub, exit. Reboot and remove the USB. GRUB should reappear with both Linux and Windows in the menu.
Will Windows updates break my Linux installation?
Windows updates occasionally overwrite the UEFI boot entry for GRUB, which makes it look like Linux is gone. The Linux installation itself is unaffected; only the bootloader entry is removed. This is fixable by reinstalling GRUB from the live USB as described above. A more reliable long-term solution is to use efibootmgr to set GRUB as the first boot entry after Windows updates, or to use a UEFI shell entry that always points to GRUB. Windows also sometimes resizes its own partition or enables Fast Startup (a form of hibernation) which can corrupt the NTFS filesystem if you access it from Linux while it is in a hibernated state. Always shut down Windows completely (not just restart) before booting into Linux.
Can I access my Windows files from Linux and vice versa?
Linux can read and write NTFS (the Windows filesystem) natively using the ntfs3 kernel driver or the older ntfs-3g userspace driver, both included in major distributions. You can mount the Windows partition and read all your Windows files. Writing to the Windows partition from Linux is also supported but carry one risk: if Windows was hibernated or shut down with Fast Startup enabled, the NTFS filesystem is in a partially-written state, and writing to it from Linux can corrupt it. Always fully shut down Windows before booting Linux if you plan to write to the Windows partition. Windows cannot read Linux ext4, btrfs, or xfs partitions natively; third-party tools like Ext2Fsd or WSL2 are needed to read Linux partitions from Windows.