How to Dual Boot Ubuntu and Fedora

The multitude of different Linux distributions available is simultaneously the operating system’s greatest strength and its greatest weakness. It is a strength because it offers users choice, diversity and freedom. It is a weakness as there is no standard distribution, which means that the same software needs to be compiled and packaged multiple times, once for each of the major distributions. Plus it leads to fragmentation which is probably the main reason Linux has not dominated on the desktop.

If you are a keen Linux user, you may find yourself wanting to install multiple Linux distributions on your PC and boot into which ever distro meets your current needs. If you can’t decide between one flavor or another, just install both and do a dual boot.

It is quite easy to install Linux in a dual-boot configuration. The key to a successful dual-boot system is to get the partitioning right. All hard disks can be divided up into multiple slices known as partitions. A partition can be used for an OS, like Linux and Windows, or it can be used for data.

ubuntu-fedora-thepartitions

Many PCs have just one hard drive that holds just a single partition, drive C: in Windows-speak or “/dev/sda1” in Linux’s nomenclature. To install multiple operating systems in a dual-boot configuration, the hard disk needs to have multiple partitions. For a Linux distro like Ubuntu, the practical minimum number of partitions is 2. One for the OS and one for swap. For distributions like Fedora it can be more complex.

Fortunately, partitioning a hard drive is part of the Linux installation process and the installer makes the job quite easy. Here is an example of how to install both Ubuntu and Fedora on a single hard drive PC. This process will delete everything on the PC, so proceed with caution.

The first step is to install Ubuntu. Theoretically it doesn’t matter which Linux distribution is installed first, but experience has taught me that things just go easier if Fedora is the last OS installed. Boot your PC from the Ubuntu installation media and follow the installer steps until you get to the hard disk partitioning.

ubuntu and fedora - something else

Select the “Something else” option so you can create a custom partition table. Click “New Partition Table…” to remove all current partitions. Read the warning message, and if you are sure you don’t have any valuable data on the hard disk, then click “Continue”.

Highlight the “free space” in the partition list and click “+” to add a new partition. Set the size (probably around half the size of the disk), select “Primary” as the partition type and set the mount point to “/” (meaning root). Then click “OK”.

ubuntu and fedora - create partition

Repeat the process to create some swap space. The size only needs to be a few gigabytes (even less if you have a small hard drive), and the partition type can be set to “Logical”. Select “swap area” from the “Use as:” drop down list.

You will now have a hard disk that is partitioned something like this:

ubuntu and fedora - ubuntu partitions

It is important that there is sufficient free space left to hold the Fedora installation. Click on “Install Now” and follow the rest of the installation steps. Once the installation has finished, you can reboot into Ubuntu and check that the installation is working as expected.

To install Fedora, boot from the installation media and proceed through the installation until you get to the “INSTALLATION SUMMARY”. The “INSTALLATION DESTINATION” will likely be marked for automatic partitioning. Click on the “INSTALLATION DESTINATION” and choose the “I want to review/modify my disk partitions before continuing” option.

ubuntu and fedora - i want to review

On the “MANUAL PARTITIONING” page, use the “Click here to create them automatically” link to get the installer to add the necessary partitions. Your disk should now look something like this:

ubuntu and fedora - fedora partitions

The Fedora installation has three partitions: One for “/boot”, one for “/” (root), and the swap space. The other Linux installation section shows the two partitions that were created above. Click “Done”, accept the changes and wait for the “INSTALLATION SUMMARY” to process the changes. Click on “Begin Installation” and follow the rest of the installation steps.

Once Fedora is installed, reboot the PC and you will find a boot menu:

ubuntu and fedora - boot menu

Select which OS you want to boot using the arrow keys and ENTER. Fedora will boot by default after a short timeout.

If you have any questions about dual-booting two Linux installations please feel free to ask questions in the comments below, and we will see if we can help.

14 comments

  1. Dual Boot with different Linux distributions.
    How can I use single Swap partition for both OS? Because at a time only one OS will run.

    • Basically during the installation of the second Linux OS you need to delete the swap partition during the partitioning phase. Then change /etc/fstab to use the swap space from the first Linux install.

      • When multi-booting Linux distros I have not found the need to edit /etc/fstab. During the install I just assign the swap partition to each distro.

        • If I use the same swap partition then, i have to edit /etc/fstab.
          But what is “Partitioning Phase”.

          • “If I use the same swap partition then, i have to edit /etc/fstab.”
            No, you do not. Rach distro has its own, independent /etc/fstab file. They will not interfere with each other. They do not know about each other.

            “But what is “Partitioning Phase”.”
            I don’t understand your question. Please explain further.

          • If during the installation you configure the installer to use the existing swap space, or it detects the second swap space automatically, then you don’t need to do anything else.

            If you don’t create a second swap space but the installer doesn’t want to use the existing swap space then edit /etc/fstab on the second OS you installed.

            By “Partitioning Phase” I mean the part of the installation process where you create and configure the disk partitions.

          • dragonmouth Says “Each distro has its own, independent /etc/fstab file. They will not interfere with each other. They do not know about each other”
            And
            Gary Sims Says “If during the installation you configure the installer to use the existing swap space, or it detects the second swap space automatically, then you don’t need to do anything else.
            If you don’t create a second swap space but the installer doesn’t want to use the existing swap space then edit /etc/fstab on the second OS you installed”

            Which of you are correct?

          • Both are correct and they aren’t contradictory. Ubuntu and Fedora have separate /etc/fstab files, just as Dragonmouth says. If during the installation process you don’t manage to get the installer to use the first swap space then you will need to edit the /etc/fstab on the second OS (in the article that is Fedora) to use the swap space created for Ubuntu.

  2. When dual-booting O/Ss the assumption is that you want to share data (/home) between O/Ss.

    If I were dual-booting Ubuntu and Fedora, I would have the following primary partitions:
    /dev/sda1/ – Ubuntu
    /dev/sda2/ – Fedora
    /dev/sda3/ – /home assigned to Ubuntu and Fedora
    /dev/sda4/ – swap used by Ubuntu and Fedora
    or
    /dev/sda5/ – extended partition
    /dev/sda3/ – /home used by both distros
    /dev/sda4/ – swap used by both distros

Comments are closed.

Sponsored Stories