How to Install Linux as a Dual-Boot System Alongside Windows

Ahmed RazaAhmed Raza
5 min read

Installing Linux as a dual-boot system alongside Windows allows users to experience the flexibility and power of Linux while maintaining access to Windows applications. A dual-boot setup provides an efficient way to explore Linux, conduct development work, or test software without compromising access to a Windows environment. This guide outlines the steps for safely setting up a Linux dual-boot system with Windows, including necessary preparation, installation, and post-installation configurations.


Prerequisites for a Dual-Boot Installation

Before beginning, there are several requirements and recommendations to ensure a smooth installation process:

  1. Backup Data: Installing a new operating system can risk data loss, so it’s essential to back up all important files on an external drive or cloud storage service.

  2. Create Available Disk Space: Dual-booting requires an unallocated partition on your disk for Linux installation. Generally, allocating at least 20–30 GB for Linux provides adequate space for the operating system and additional software.

  3. Download Linux Distribution: Choose a Linux distribution suitable for dual-boot, such as Ubuntu, Linux Mint, or Fedora. Download the .iso file of the selected distribution from its official website.

  4. Create a Bootable USB: A bootable USB is required to install Linux. This can be done using tools like Rufus (for Windows) or Etcher.


Step 1: Preparing the Windows System

  1. Disable Fast Startup:

    • Fast Startup in Windows can interfere with dual-boot installation. To disable it, go to:

      • Control Panel > Power Options > Choose what the power buttons do > Change settings that are currently unavailable.
    • Uncheck the Turn on fast startup option, and click Save changes.

  2. Shrink the Windows Partition:

    • To create unallocated space for Linux, open the Disk Management tool:

      • Right-click on the Start menu and select Disk Management.
    • Locate the main partition (usually C:) and right-click on it, then choose Shrink Volume.

    • Enter the amount of space to shrink (typically 20–30 GB) and click Shrink. This space will be used for the Linux installation.

  3. Disable Secure Boot (if applicable):

    • Some Linux distributions require Secure Boot to be disabled. To do this:

      • Restart the computer and enter the BIOS/UEFI settings (often by pressing F2, F10, Delete, or Esc during boot).

      • Find the Secure Boot option (usually under the Security or Boot menu) and disable it.

      • Save changes and exit.


Step 2: Creating a Bootable USB for Linux

  1. Insert a USB Drive: Insert a USB drive with at least 4 GB of space.

  2. Download and Run Rufus (or a similar tool):

    • Open Rufus and select the USB drive.

    • Click Select and browse for the downloaded Linux .iso file.

    • Set Partition scheme to GPT if you’re using UEFI, or MBR for older BIOS systems.

    • Click Start to create the bootable USB.

  3. Restart the Computer and Boot from USB:

    • After the bootable USB is created, restart the computer.

    • Enter the Boot Menu (often accessible by pressing F12, Esc, or another key specific to your computer) and select the USB drive.


Step 3: Installing Linux

Once booted into the Linux installation environment, follow these steps to install Linux alongside Windows.

  1. Select “Install Linux”:

    • After booting from the USB, you’ll see an option to try Linux or install it. Select Install Linux.
  2. Choose Installation Type:

    • During the installation process, Linux will detect the existing Windows installation. Choose the option to Install alongside Windows.

    • If this option does not appear, select Something else to manually partition the unallocated space.

  3. Partitioning the Disk (if manual partitioning is required):

    • Select the unallocated space and create the following partitions:

      • Root Partition (/): At least 15 GB, formatted as ext4. This is where the main Linux files will reside.

      • Swap Partition: Recommended size is 1.5–2 times the available RAM. This acts as virtual memory.

      • Home Partition (/home): Optional but recommended. This is where personal files and configurations are stored. Allocate any remaining space to this partition.

  4. Select Installation Location for GRUB Bootloader:

    • Ensure that the GRUB bootloader (Linux’s boot manager) is installed on the main drive (usually /dev/sda or equivalent). GRUB will manage the boot process for both Linux and Windows.
  5. Complete the Installation:

    • Proceed with the installation. You’ll be prompted to select your time zone, keyboard layout, and create a user account.

    • After installation, the system will prompt you to remove the USB drive and restart.


Step 4: Booting into Linux and Windows

  1. GRUB Bootloader:

    • Upon restarting, the GRUB menu will appear, allowing you to choose between Linux and Windows. Use the arrow keys to select the operating system you wish to boot into.
  2. Verify Installation:

    • Boot into Linux to confirm the installation. You can then reboot and select Windows to ensure both systems function properly.

Step 5: Post-Installation Setup

  1. Updating Linux:

    • Open a terminal in Linux and update the system by running:

        sudo apt update && sudo apt upgrade   # For Ubuntu-based systems
        sudo dnf update                       # For Fedora systems
      
  2. Installing Essential Applications:

    • Install necessary software and drivers, especially if you plan to use Linux for development or other specific tasks.
  3. Accessing Windows Files from Linux:

    • Most Linux distributions can access NTFS partitions, allowing you to read and write files on the Windows partition directly from Linux.
  4. Backing Up the GRUB Configuration:

    • If you make any changes to your partition structure in the future, run the following command to update GRUB:

        sudo update-grub
      

Troubleshooting Common Issues

  • GRUB Does Not Appear: If you boot directly into Windows after installation, it may be necessary to change the boot order in the BIOS/UEFI settings to prioritize the Linux boot partition.

  • Windows Fast Startup Interference: If Windows doesn’t shut down properly due to Fast Startup, re-enable this setting and disable it again to clear any cache issues.

  • Disk Space: Ensure Linux has adequate space on the partition. Low disk space can cause errors or prevent Linux from booting.


Conclusion

Installing Linux alongside Windows as a dual-boot system provides a seamless way to explore Linux while retaining access to Windows. This configuration is ideal for developers, students, and users looking to maximize their computer’s versatility. By following the steps above, you’ll be able to install Linux, set up GRUB for dual-boot, and customize your environment with minimal risks.

0
Subscribe to my newsletter

Read articles from Ahmed Raza directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Ahmed Raza
Ahmed Raza

Ahmed Raza is a versatile full-stack developer with extensive experience in building APIs through both REST and GraphQL. Skilled in Golang, he uses gqlgen to create optimized GraphQL APIs, alongside Redis for effective caching and data management. Ahmed is proficient in a wide range of technologies, including YAML, SQL, and MongoDB for data handling, as well as JavaScript, HTML, and CSS for front-end development. His technical toolkit also includes Node.js, React, Java, C, and C++, enabling him to develop comprehensive, scalable applications. Ahmed's well-rounded expertise allows him to craft high-performance solutions that address diverse and complex application needs.