Dual boot Linux and Windows safely
Dual booting lets you keep Windows and run Linux on the same computer, choosing one each time you start. It is safe if you prepare properly; most problems come from skipping the first two steps.
Before you start
Consider whether you need dual boot at all. Windows 11 can run Linux programs through WSL (Windows Subsystem for Linux), and any computer can run Linux in a virtual machine. Dual boot is best when you want Linux to have the whole machine's speed and hardware, for example for gaming, graphics work or learning to administer a real system.
1. Back up
Resizing partitions is reliable, but a power cut or a wrong click at the wrong moment can lose data. Copy your documents to an external disk or cloud storage before you continue.
2. Get your BitLocker recovery key
Many Windows 11 computers encrypt the system disk with BitLocker (called "Device encryption" on Home editions). Changes to the boot setup can make Windows ask for the 48-digit recovery key at the next start. Without it you cannot get into Windows.
- Find the key at account.microsoft.com/devices/recoverykey if you sign in with a Microsoft account, or run
manage-bde -protectors -get C:in an administrator command prompt. - Write it down or print it. Do not store it only on the computer you are changing.
- Optionally suspend BitLocker for one restart:
manage-bde -protectors -disable C: -RebootCount 1.
3. Turn off Fast Startup
Windows Fast Startup does not shut down completely, it hibernates. Linux then refuses to write to the Windows partition, and the shared disk can be damaged. Turn it off in Control Panel › Power Options › Choose what the power buttons do › Change settings that are currently unavailable, untick Turn on fast startup.
4. Make room for Linux
Shrink the Windows partition from inside Windows: right-click Start › Disk Management, right-click the C: partition, Shrink Volume. Leave the freed space unallocated. 60 GB is a comfortable minimum for Linux; 100 GB or more if you will keep files there.
If Windows will not shrink as far as you want, it is usually because of unmovable files (page file, hibernation file, restore points). Disabling them temporarily, or shrinking from the Linux installer instead, usually helps. A second internal disk is even easier: install Linux on that disk and leave the Windows disk alone.
5. Install Linux
- Boot your Linux USB stick in UEFI mode (see booting Linux from USB). Windows 11 always uses UEFI; Linux must too, or the two cannot share a boot menu.
- Start the installer. Ubuntu and Mint offer Install alongside Windows; Fedora and Debian let you choose the free space under custom or manual partitioning.
- If you partition manually, use the unallocated space for a root partition (
/, ext4 or btrfs), and reuse the existing EFI System Partition (about 100-300 MB, FAT32) mounted at/boot/efi, without formatting it. - Choose disk encryption if you want it; the installer creates LUKS for you.
Leave Secure Boot on. Ubuntu, Fedora, Debian, RHEL, SUSE and Mint all boot with it. You only need to change it for unsigned kernels or some third-party drivers, and NVIDIA's drivers can be signed with a key the installer offers to create (MOK).
6. Choosing the system at boot
After installation the GRUB menu appears at start-up and lists both Linux and Windows Boot Manager. To change which one starts by default and how long the menu waits, edit /etc/default/grub:
GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true # remember the last choice
GRUB_TIMEOUT=5
GRUB_DISABLE_OS_PROBER=false
Then update the menu with sudo update-grub (Debian, Ubuntu, Mint) or sudo grub2-mkconfig -o /boot/grub2/grub.cfg (Fedora, RHEL, SUSE). The last line makes GRUB search for Windows, which some distributions switched off by default.
Clocks out of step
Windows keeps the hardware clock in local time, Linux in UTC, so after switching systems the time can be wrong by your time zone offset. The simplest fix is to tell Linux to use local time:
sudo timedatectl set-local-rtc 1 --adjust-system-clock
Common problems
- The computer boots straight into Windows
- The firmware boot order puts Windows first, or a Windows update reset it. In Linux, check and fix the order with
efibootmgr; in the firmware setup, move the Linux entry (often called ubuntu, fedora or debian) to the top. - Windows asks for the BitLocker recovery key
- Enter the key you saved in step 2. Windows continues normally afterwards.
- The GRUB menu does not list Windows
- Install
os-prober, setGRUB_DISABLE_OS_PROBER=falseand update GRUB as shown above. - "grub rescue>" or no boot menu at all
- Boot the live USB, mount the Linux root and EFI partitions,
chrootinto the installed system and reinstall GRUB. The steps are in the rescue section of booting Linux from USB.
efibootmgr -v # list boot entries and the current order
sudo efibootmgr -o 0003,0000 # put entry 0003 (Linux) before 0000 (Windows)
Removing Linux later
Do not just delete the Linux partitions: the computer may then stop at a GRUB error. First make Windows Boot Manager the first entry in the firmware boot order (or with efibootmgr), then delete the Linux partitions in Windows Disk Management and extend C:. Finally remove the Linux folder from the EFI partition (diskpart, assign a letter to the EFI partition, delete \EFI\ubuntu or similar).