Installing alongside Windows (dual boot)

I bought a used ThinkPad (X1 Carbon 5th gen) on ebay. It came with Windows 10, and although I plan to replace Windows entirely, I’d like to first try to install NixOS alongside the existing Windows installation, with dual booting. I’ve installed NixOS a few times before, but never dual booting.

I don’t have a way to re-install Windows (at least not that I’m aware of).

A few preparatory steps I’ve taken are:

  • disable the “fast startup” Windows feature
  • disable hibernate in Windows
  • disable Secure Boot in BIOS

What I’m less clear about is how to navigate legacy boot vs. UEFI, and partitioning.

The Arch wiki mentions:

Windows 8/8.1 and 10 x86_64 versions support booting in x86_64 UEFI mode from GPT disk only, OR in BIOS mode from MBR disk only.

This machine came configured for legacy boot with an MBR disk.

The disk already has three primary partitions, and I understand MBR allows at most four primary partitions. I used the Disk Management util in Windows to reduce the size of the “(C:)” partition, making space for NixOS.

It sounds like I could create the fourth partition from the NixOS installer, and maybe even use logical partitions to create some swap space, but I think I could use some guidance.

I found some articles that discuss installing NixOS to dual boot, but they all seem to deal with UEFI and GPT. If anyone has guidance or can point me toward a good tutorial, please share.

1 Like

If your machine has Windows 10 installed you can reinstall it and keep your license. Install it with GPT and use UEFI, MBR and BIOS is legacy. Both systemd-boot and grub supports UEFI.

Once that’s done, both Nix and Windows will tell UEFI about installed bootloaders, two boot entries will appear and all will be fine and dandy.

Note you can get your license key from a running windows system really easily: https://www.howtogeek.com/660517/how-to-find-your-windows-10-product-key-using-the-command-prompt/

There’s also a device somewhere you can read it from in a booted Linux system, so even if you completely wipe Windows you can always get that key back - at least on most laptops, more difficult for non-OEM systems of course :wink:

Are you sure about that? “fast startup” and Secure Boot are impossible with legacy boot, and I don’t think devices post Windows 8 have shipped with legacy boot, let alone a flagship ThinkPad. I’m not even convinced Windows 10 can be installed on MBR.

I’m pretty sure that the “fast startup” is possible without.

Depending on what exactly this term means actually, which in my understanding may have changed with different versions of windows.

Back when I still had windows, it had a fast boot feature that was implemented by using a certain hybernation schema. Because of that its NTFS partitions haven’t been marked as “inactive” and therefore Linux was not able to mount them.

Took me several reboot cycles to get that actually properly deactivated. And on legacy, the impact was not only measurable in the lab, but recognizable by a human like person (me). Lucky me that Windows then did bitrot anyway, and I booted it only once a month to install updates :smiley:

2 Likes

And apparently you can just install windows on an mbr disk still: Windows Setup: Installing using the MBR or GPT partition style | Microsoft Learn

Well, color me corrected, sorry about the noise.

Note you can get your license key from a running windows system really easily: https://www.howtogeek.com/660517/how-to-find-your-windows-10-product-key-using-the-command-prompt/

Well that changes everything. I might take the easy way out and just install NixOS the way I’ve done in the past with UEFI and GPT, replacing the existing Windows installation.

1 Like

I used a method like this one in the past to convert a W10 system from MBR/BIOS to GPT/UEFI without reinstalling. It worked well for me at the time.