top of page

Dual Booting in Ubuntu and Windows 10

This weekend I decided to add Ubuntu to my laptop, mainly because I wanted to get experience using Linux (of which Ubuntu is one kind of flavor) and to learn how to use the command line (called the Terminal in Ubuntu). The process was pretty well documented but I encountered a couple of problems because I was adding Ubuntu to a laptop that I have already used for several years (as opposed to installing Ubuntu on a brand new machine). I wanted to write a post so that I remembered what I did and to help out anyone else who is adding Ubuntu on an older machine. I've also listed my sources at the bottom - my thanks to all my sources for providing me with the information presented in this post.

My Setup:

I have a Lenovo Thinkpad T530. Several years ago I replaced the hard drive with a SSD drive with 250GB of storage. I also had a 4GB USB drive for the Ubuntu installation and a 1TB external hard drive to back up my files before I started.

Process [1],[2]:

  1. Backup computer.

  2. I used the default software that came with my external hard drive but you can use anything you want. Just make sure you back everything up!

  3. Put Ubuntu on a USB drive.

  4. The USB drive will hold the Ubuntu OS at first and you will boot your computer to this drive and run the installation process from this location (the installation process will then load the Ubuntu OS onto your actual computer's hard drive).

  5. You will first need to format the USB so that it can be treated as "bootable media" (i.e. so that your laptop can boot from that drive) and then load the Ubuntu OS onto it. These instructions recommended using some free software called Universal USB Installer (which worked fine); I have also used Rufus in the past and my colleagues in IT like to use it [3].

  6. Finish following the instructions above [3] to put Ubuntu onto the USB drive.

  7. Prepare your hard drive for a new Ubuntu partition.

  8. The Ubuntu OS is going to go on a new partition on your hard drive. This means that you may need to shrink the size of your existing main partition (where the Windows 10 OS is located) so that there is free memory that can be allocated to a new partition.

  9. This turned out to be the most difficult step for me because after Step 1 above, I went through my computer files and deleted programs, bloatware and files that I didn't need (or had already backed up). Although this freed up a lot of memory, it left that memory fragmented. In other words, I had freed up a lot of memory but I still had random blocks of memory in non-contiguous locations on my hard drive [4]. This meant that that free space was essentially unusable - I could not shrink the size of my Windows partition because then I would lose access to these chunks of memory.

  10. So what could I do? I tried a lot of different things, mainly at the recommendation of this article [5]. First, I was able to check whether or not I could shrink the volume of my main partition by using the Create Disk Partition wizard in Windows 10 (right click on the partition that you want to shrink and select "Shrink Volume"). I tried using the built-in disk defragmentation wizard in Windows (just search for it in the search bar) to clean up the partition. That did not work - I still could not shrink the volume. So I downloaded Defraggler (free) and ran the 3+ hour defragmentation process with that software. It still made no difference to my ability to shrink the volume, although it did clean up my hard drive considerably.

  11. So I proceeded with the Ubuntu installation and decided to use the Ubuntu GParted Partition Editor to shrink the volume on the main partition. I booted to the USB drive with Ubuntu on it (for Lenovo Thinkpads, hold down the "Enter" key while you turn on the laptop - this allows you to choose F12 - Select boot drive and then to pick the USB drive as the boot media). Then I selected the "Try Ubuntu" option, which allows you to run Ubuntu from the USB drive without installing it on your main drive. Once on the Ubuntu home screen, I installed GParted Partition Editor and ran it. I used the Editor to shrink the volume of my Windows partition following these instructions [2]. Note that I did not shrink the partition down to its current size - I gave the Windows partition extra room, otherwise I could not shrink that volume. This ran successfully and I now had plenty of free space to create my root and swap partitions. NOTE: I wouldn't recommend doing this unless you had already defragmented your hard drive and were confident that by shrinking volumes you were not going to lose memory fragments!

  12. Take a deep breath, and install Ubuntu!

  13. This was the easiest part of the process because the Ubuntu installation was straightforward. The only tricky part here is that you need to create 2 partitions for Ubuntu - the root and swap partitions. The root partition needs to be about 20GB and the swap partition needs to be about 4GB [2]. I had trouble when I wanted to create my swap partition because Lenovo only allows a maximum of 4 partitions on a hard drive. So I went in and deleted one (not the home partition and not the Windows partition, but I had another one created, not sure why?) and then I was able to create both root and swap partitions.

  14. From there it was smooth sailing!

  15. Other notes

  16. The instructions I provide here include instructions for disabling secure boot which is built into the UEFI Firmware on most laptops today. My laptop happens to be old enough that I still run legacy BIOS firmware, so I was confused when I tried to follow this step and I couldn't. If you, like me, have an older computer and you don't see an option to modify your UEFI firmware settings, it's probably because you don't have UEFI firmware. You can check by checking your computer settings in Windows.

Sources:

[1] https://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/

[2] https://www.wikihow.com/Dual-Boot-Windows-10-and-Ubuntu-16.04

[3] https://itsfoss.com/create-live-usb-of-ubuntu-in-windows/

[4] https://stackoverflow.com/questions/3770457/what-is-memory-fragmentation

[5] https://www.howtogeek.com/howto/windows-vista/working-around-windows-vistas-shrink-volume-inadequacy-problems/


bottom of page