Dual-boot Clear Linux* OS and Windows* 10 OS

This guide shows how to install Clear Linux* OS adjacent to an existing Windows* 10 OS. To add Clear Linux OS to an existing Windows installation, follow a method below.

In this tutorial you’ll Install Clear Linux* OS from the live desktop as an additional partition. Alternatively, you may also Install Clear Linux* OS from the live server.

Method 1: Shrink Windows partition and install Clear Linux OS

For this method, we shrink the Windows 10 OS partition to make space for Clear Linux OS.

  1. Boot up the Windows 10 OS.

  2. Launch the Disk Management utility found under Create and format hard disk partitions.

  3. Right-click the primary Windows partition and select Shrink Volume….

    Disk Management > Shrink Volume

    Figure 1: Disk Management > Shrink Volume.

  4. Shrink the size of the partition by at least the following amount:

    • For Desktop version, allow at least 21GB.

    • For Server version, allow at least 4GB.

  5. We shrink C by about 21GB, as shown in Figure 2.

    Shrink C

    Figure 2: Shrink C.

  6. Shutdown the Windows 10 OS.

  7. Follow one of these guides to install Clear Linux OS:

    1. In the Required options tab, choose Select Installation Media.

    2. Within that menu, select Safe Installation.

    3. Go through remaining steps to complete the installation.

    4. Reboot.

  8. During the BIOS POST stage, press F10, or the proper F-key for your system, to launch the Boot Menu.

    Boot menu

    Figure 3: Boot menu

  9. In the Boot Menu, use the arrow to select the OS bootloader as boot device (highlighted).

    Some BIOSes do not support listing multiple partitions. In this case, it will only show one bootable partition.

    Tip

    If you don’t want to use the BIOS boot menu each time to select an OS, follow Advanced: Use systemd-boot to boot Windows 10 OS and |CL|.

Method 2: Add another hard disk to your system where you installed Windows

  1. Shutdown your system.

  2. Open your system and attach another hard drive.

  3. Power up your system.

  4. Follow one of these guides to install Clear Linux OS:

    1. In the Required options tab, choose Select Installation Media.

    2. Within that menu, select Destructive Installation, and select the new hard drive from the device list.

      Warning

      Make sure you don’t select the drive with your Windows 10 OS.

    1. Go through remaining steps to complete the installation.

    2. Reboot.

  5. During the BIOS POST stage, press F10, or the proper F-key for your system, to launch the Boot Menu.

    Boot menu

    Figure 4: Boot menu

  6. In the Boot Menu, use the arrow to select the Linux bootloader as boot device.

    Some BIOSes do not support listing multiple partitions. In this case, it will only show one bootable partition.

Tip

If you don’t want to use the BIOS boot menu each time to select an OS, follow the next section.

Advanced: Use systemd-boot to boot Windows 10 OS and Clear Linux OS

If you prefer not to use your BIOS to load the Boot Menu and select an OS to boot, you can make systemd-boot the default bootloader and add Windows 10 OS to the boot list. This option is also a workaround for BIOSes that don’t support booting more than one partition.

  1. Boot up a Clear Linux OS live image from a USB thumb drive.

  2. Open a terminal window and enter:

    lsblk -po NAME,SIZE,TYPE,FSTYPE,PARTLABEL
    

    Example output:

    clrlinux@clr-live~ $ lsblk -po NAME,SIZE,TYPE,FSTYPE,PARTLABEL
    NAME          SIZE TYPE FSTYPE   PARTLABEL
    /dev/loop0    2.3G loop squashfs
    /dev/sda    335.4G disk
    ├─/dev/sda1   450M part ntfs     Basic data partition
    ├─/dev/sda2   100M part vfat     EFI system partition
    ├─/dev/sda3    16M part          Microsoft reserved partition
    ├─/dev/sda4   286G part ntfs     Basic data partition
    ├─/dev/sda5   143M part vfat     EFI
    ├─/dev/sda6   244M part swap     linux-swap
    └─/dev/sda7  48.5G part ext4     /
    sdb             7G disk iso9660
    ├─/dev/sdb1   2.7G part iso9660
    └─/dev/sdb2   100M part vfat
    

    The example output shows:

    • /dev/sda2 is the EFI system partition created by Windows 10 OS

    • /dev/sda4 is the primary Windows partition

    • /dev/sda5 is the EFI system partition created by Clear Linux OS

    • /dev/sda7 is the Clear Linux OS root partition

Note

To help narrow down a partition even more, you add the PARTTYPE option to lsblk and cross-reference against the partition type GUIDs wiki.

  1. Create mount points.

    sudo mkdir /mnt/windows-efi
    
    sudo mkdir /mnt/clearlinux
    
  2. Mount the EFI system partition for Windows 10 OS.

    sudo mount /dev/sda2 /mnt/windows-efi
    
  3. Mount the Clear Linux OS root partition and its EFI system partition.

    sudo mount /dev/sda7 /mnt/clearlinux
    
    sudo mount /dev/sda5 /mnt/clearlinux/boot
    
  4. Copy Windows 10 OS bootloader, and other data needed to boot it, to the Clear Linux OS EFI system partition.

    sudo cp -r /mnt/windows-efi/EFI/Microsoft/ /mnt/clearlinux/boot/EFI/
    
  5. Make systemd-boot the default bootloader and add Windows 10 OS Boot Manager.

    sudo bootctl install --esp-path=/mnt/clearlinux/boot
    
  6. Add a timeout value to the systemd-boot. This allows enough time for you to select your preferred OS from the menu.

    sudo clr-boot-manager set-timeout 20 --path=/mnt/clearlinux
    
  7. Umount all partitions.

    sudo umount /mnt/windows-efi /mnt/clearlinux/boot /mnt/clearlinux
    
  8. Reboot

    sudo reboot
    
  9. Remove the Clear Linux OS installer USB thumb drive.

  10. You should be presented with the systemd-boot menu, as shown below.

    systemd-boot menu

    Figure 5: systemd-boot menu

Alternative: Install Windows 10 OS After Clear Linux OS

The following alternative guide shows how to install Windows 10 OS adjacent to an existing Clear Linux OS installation.

Prerequisites

  • Clear Linux OS is already installed.

  • There is unallocated disk space available. If the entire disk has been allocated to Clear Linux OS, then shrink the root partition to make space for Windows 10 OS.

Install Windows 10 OS

  1. Start the Windows installer and follow the prompts.

  2. At the What type of installation do you want? screen, choose Custom: Install Windows only (advanced). See Figure 6.

    Windows - Choose installation type

    Figure 6: Windows - Choose installation type

  3. Select Unallocated Space and create a new partition of the desired size. For this example, we will use the entire unallocated space. See Figure 7.

    Windows - Create new partition

    Figure 7: Windows - Create new partition

    Note

    Normally, Windows creates its own 100MB EFI partition if none exists. In our case, where an EFI partition was created by Clear Linux OS, Windows will use the previously-created partition.

  4. Select the newly-created partition and follow the remaining prompts to complete the Windows installation. See Figure 8.

    Windows - Install on newly-created partition

    Figure 8: Windows - Install on newly-created partition

  5. Finish the Windows out-of-box-experience process.

  6. Restore systemd-boot - the bootloader Clear Linux OS uses - and add Windows to its boot menu.

    At this point, you cannot boot Clear Linux OS because Windows became the default bootloader after it was installed. Follow these steps to restore systemd-boot.

    1. Boot up a Clear Linux OS live image from a USB thumb drive.

    2. Open a terminal window.

    3. Find the location of the EFI partition. In this example, it is /dev/sda1.

      lsblk -po NAME,SIZE,TYPE,FSTYPE,PARTLABEL
      

      Example output:

      clrlinux@clr-live~ $ lsblk -po NAME,SIZE,TYPE,FSTYPE,PARTLABEL
      NAME          SIZE TYPE FSTYPE   PARTLABEL
      /dev/loop0    2.3G loop squashfs
      /dev/sda      100G disk
      ├─/dev/sda1   150M part vfat     CLR_BOOT
      ├─/dev/sda2   250M part swap     CLR_SWAP
      ├─/dev/sda3     8G part ext4     CLR_ROOT
      ├─/dev/sda4    16M part          Microsoft reserved partition
      ├─/dev/sda5  91.6G part ntfs     Basic data partition
      sdb             7G disk iso9660
      ├─/dev/sdb1   2.7G part iso9660
      └─/dev/sdb2   100M part vfat
      

      Note

      To help narrow down a partition even more, you add the PARTTYPE option to lsblk and cross-reference against the partition type GUIDs wiki.

    4. Make a mount point for Clear Linux OS.

      sudo mkdir /mnt/clearlinux
      
    5. Mount the root and EFI partitions.

      sudo mount /dev/sda3 /mnt/clearlinux
      sudo mount /dev/sda1 /mnt/clearlinux/boot
      
    6. Re-install systemd-boot to make it the default bootloader.

      sudo bootctl install --esp-path=/mnt/clearlinux/boot
      
    7. Add a timeout (for example: 25 seconds) to systemd-boot so that it will present the menu of bootable OSes and give you time to select the one you want to boot.

      sudo clr-boot-manager set-timeout 25 --path=/mnt/clearlinux
      sudo clr-boot-manager update --path=/mnt/clearlinux
      
    8. Unmount the root and EFI partitions.

      sudo umount /mnt/clearlinux/boot
      sudo umount /mnt/clearlinux