Dual-booting Linux and Windows safely: backups, partitions and Secure Boot

TUREFF• •0
Dual-booting lets you keep Windows for the things that need it while running Linux on the same computer, choosing between them each time you start up. It is a common way to move to Linux gradually. Done carefully, it is reliable. Done in a hurry, it is one of the easier ways to lose data. This guide focuses on the preparation that makes the difference.

Consider the alternatives first

  • A live USB lets you try a distribution without installing anything.
  • A virtual machine runs Linux inside Windows, safely isolated, at some cost in performance.
  • A second drive in a desktop PC is the cleanest form of dual-booting, because each system has its own disk.
If you decide to share one drive, read on.

Back up everything first

Resizing partitions and installing a bootloader carry a real risk of mistakes.
  • Back up your personal files to an external drive or cloud storage, and check the backup opens.
  • Create Windows recovery media with Windows' own recovery drive tool, so you can repair Windows if its boot entry is damaged.
  • Note your Windows product details and the sign-in details for your Microsoft account.

Deal with BitLocker before you start

Many Windows laptops ship with device encryption or BitLocker turned on.
  • Find and save your BitLocker recovery key somewhere you can reach from another device. For many people it is stored in their Microsoft account online.
  • Expect that Windows may ask for it. Changes to the boot setup can make Windows think something has been tampered with, and it will stop at a recovery screen asking for the long numeric key.
  • Some installers cannot resize an encrypted Windows partition. Guides differ on whether to suspend or turn off BitLocker temporarily, so follow your distribution's current documentation, and never turn encryption off without having the key saved.

Prepare Windows

  • Turn off Fast Startup in Windows' power options. With it on, Windows does not fully shut down and can leave its partition locked, which risks corruption if Linux writes to it.
  • Shrink the Windows partition from inside Windows using Disk Management, leaving unallocated space for Linux. Windows understands its own file system best.
  • Leave Windows enough free space for updates and your files.

Partitions explained

On a modern PC using UEFI, the drive has an EFI System Partition, a small partition holding the boot files for every installed system. Linux and Windows share it.
  • Do not format the EFI partition during installation. The installer should reuse it.
  • Choose the install alongside option if your installer offers it, such as 'Install alongside Windows' in Ubuntu's installer. It handles the partitioning for you.
  • Manual partitioning gives more control but is where most accidents happen. Check device names and sizes carefully before confirming anything.

Secure Boot

Secure Boot is a firmware feature that only starts boot software signed by a trusted key.
  • Major distributions, including Ubuntu and Fedora, support Secure Boot through a small signed first-stage loader called shim, so you usually do not need to turn it off.
  • Third-party drivers, such as some graphics drivers, may need to be signed with a Machine Owner Key. On Ubuntu, the installer can set this up, and on the next boot a blue MOK management screen asks you to enrol the key with a password you chose. Read that screen carefully rather than skipping it.
  • If you must disable Secure Boot for a particular distribution, understand that Windows features relying on it may complain, and BitLocker may ask for its recovery key.

After installation

  • A boot menu, usually GRUB, lets you choose the system at start-up. If Windows does not appear, the distribution's documentation explains how to detect it again.
  • Windows updates occasionally change the boot order. If the computer goes straight to Windows, use the firmware's boot menu or settings to put Linux's entry first again.
  • Keep the system clock consistent. Windows and Linux treat the hardware clock differently by default, so the time can appear wrong in one system. Your distribution's documentation explains the usual fix.
  • Access shared files carefully. A separate data partition both systems can read is often simpler than reaching into each other's system partitions.

Removing one later

Removing Linux means deleting its partitions and its boot entry, and repairing the Windows boot loader if needed. Research the steps before you start rather than deleting partitions and hoping. Have you set up a dual-boot machine? Share what went smoothly and what caught you out in the comments.

Comments (0)