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.
Boot up the Windows 10 OS.
Launch the
Disk Management
utility found under Create and format hard disk partitions.Right-click the primary Windows partition and select Shrink Volume….
Figure 1: Disk Management > Shrink Volume.¶
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.
We shrink C by about 21GB, as shown in Figure 2.
Figure 2: Shrink C.¶
Shutdown the Windows 10 OS.
Follow one of these guides to install Clear Linux OS:
Desktop version: Install Clear Linux* OS from the live desktop
Server version: Install Clear Linux* OS from the live server
In the Required options tab, choose Select Installation Media.
Within that menu, select Safe Installation.
Go through remaining steps to complete the installation.
Reboot.
During the BIOS POST stage, press F10, or the proper F-key for your system, to launch the Boot Menu.
Figure 3: Boot menu¶
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¶
Shutdown your system.
Open your system and attach another hard drive.
Power up your system.
Follow one of these guides to install Clear Linux OS:
Desktop version: Install Clear Linux* OS from the live desktop
Server version: Install Clear Linux* OS from the live server
In the Required options tab, choose Select Installation Media.
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.
Go through remaining steps to complete the installation.
Reboot.
During the BIOS POST stage, press F10, or the proper F-key for your system, to launch the Boot Menu.
Figure 4: Boot menu¶
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.
Boot up a Clear Linux OS live image from a USB thumb drive.
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.
Create mount points.
sudo mkdir /mnt/windows-efi sudo mkdir /mnt/clearlinux
Mount the EFI system partition for Windows 10 OS.
sudo mount /dev/sda2 /mnt/windows-efi
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
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/
Make systemd-boot the default bootloader and add Windows 10 OS Boot Manager.
sudo bootctl install --esp-path=/mnt/clearlinux/boot
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
Umount all partitions.
sudo umount /mnt/windows-efi /mnt/clearlinux/boot /mnt/clearlinux
Reboot
sudo reboot
Remove the Clear Linux OS installer USB thumb drive.
You should be presented with the systemd-boot menu, as shown below.
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¶
Start the Windows installer and follow the prompts.
At the What type of installation do you want? screen, choose Custom: Install Windows only (advanced). See Figure 6.
Figure 6: Windows - Choose installation type¶
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.
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.
Select the newly-created partition and follow the remaining prompts to complete the Windows installation. See Figure 8.
Figure 8: Windows - Install on newly-created partition¶
Finish the Windows out-of-box-experience process.
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.
Boot up a Clear Linux OS live image from a USB thumb drive.
Open a terminal window.
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.Make a mount point for Clear Linux OS.
sudo mkdir /mnt/clearlinux
Mount the root and EFI partitions.
sudo mount /dev/sda3 /mnt/clearlinux sudo mount /dev/sda1 /mnt/clearlinux/boot
Re-install systemd-boot to make it the default bootloader.
sudo bootctl install --esp-path=/mnt/clearlinux/boot
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
Unmount the root and EFI partitions.
sudo umount /mnt/clearlinux/boot sudo umount /mnt/clearlinux