How to install a complete Ubuntu on a USB Flash Drive

The advantage of installing a full Ubuntu on a flash drive when compared to a live environment is the ability to have a portable and personalized Ubuntu with your choice of applications, login ID, and fully updatable system.

In this tutorial, we are going to perform a complete installation of Ubuntu on a USB Flash drive. Note that this is not about just creating a bootable Ubuntu Live USB drive. Instead, we are going to help you install a full-fledged Ubuntu on a USB drive. It’s like having a portable Ubuntu system!

Complete Ubuntu on a USB Flash Drive

The advantage of installing a full Ubuntu on a flash drive when compared to a live environment is the ability to have a portable and personalized Ubuntu with your choice of applications, login ID, and updatable system.

Prerequisites

  1. Ubuntu Live USB drive or a CD: If you don’t have one, you can create one using our guide here.
  2. Empty USB flash drive of at least 16GB capacity where we will be installing the full Ubuntu

Installing Ubuntu on a USB flash drive

The entire process can be classified into two broad phases. First, we format and create partitions on the USB flash drive, and in the next phase, we will install Ubuntu in it.

Phase 1 – Partitioning the USB Flash Drive

Step 1. Insert the Ubuntu live USB drive or CD and boot your PC into it.

Step 2. Choose “Try Ubuntu” option.

Boot From CD and Try Ubuntu
Boot From CD or Live USB drive and Try Ubuntu

Step 3. The system will boot into the Ubuntu live desktop environment. From the left dock panel, open applications button, which is located at the bottom. Search for GParted and open it.

Open GParted
Open GParted

The GParted interface should look like the below screenshot.

GParted Interface
GParted Interface

Step 4. Insert your USB Flash Drive.

Step 5. This is the most critical step. Pay attention to the drives and make sure you are selecting the flash drive (sdb) with the correct capacity. Choosing a wrong device could destroy the data on your PC. At the right of the GParted window, select your USB from the drop-down menu.

Choose USB Drive
Choose USB Drive

Step 6. Clear partitions on the USB drive by right-clicking on your USB, choose Format then select the cleared option.

Clear Partitions On USB
Clear Partitions On USB

Step 7. Click the apply button that is the green colored right mark located on the top panel.

Apply Changes
Apply Changes

An alert message will appear warning you about losing data when formatting the USB.  Click Apply on the alert message.

Apply Changes
Apply Changes

Step 8. After the operation completes successfully, click close to continue.

Formatting Operation Completed Successfully
Formatting Operation Completed Successfully

Step 9. The USB should be like the below screenshot.

USB After Formatting
USB After Formatting

Now you can close the GParted application. You have successfully partitioned your USB drive to be able to install Ubuntu. Let’s start the phase 2 installation process.

Phase 2 – Installing Ubuntu

Step 1. From the desktop, click on the install Ubuntu icon.

Install Ubuntu
Install Ubuntu

Step 2. After a moment the installation will begin with the welcome screen. Click the Continue button.

Ubuntu Welcome Screen
Ubuntu Welcome Screen

Step 3. Choose the keyboard layout then click Continue.

Choose Keyboard Layout
Choose Keyboard Layout

Step 4. Select “Normal installation” and then click Continue.

Normal Installation
Normal Installation

Step 5. In the installation type screen choose “something else” option then press Continue.

Installation Type
Installation Type

Step 6. Now choose the USB and next we will start creating partitions.

Select USB
Select USB

Step 7. Choose the new partition table button. Then press the plus sign to add the next 3 partitions.

Add New Partitions
Add New Partitions

  1. FAT32 partition
    • Set the size.
    • Set the mount point to /any_name.
  2. EXT4 partition
    • Set size not less than 4 GB.
    • Set the mount point to /.
  3. Swap partition
    • You can skip this partition if you have enough RAM and you do not need the hibernation feature.

Swap Partition
Swap Partition

Step 8. From the “Device for boot loader installation”, choose the USB Flash Drive.

The partition structure should look something like the below screenshot.

USB After Creating Partitions
USB After Creating Partitions

Step 9. Press Install now to start the installation.

Installation Progress
Installation Progress

Step 10. After the installation completes successfully, click Restart Now.

After Installation Completes On USB
After Installation Completes On USB

Congratulations! You have now installed full Ubuntu on the USB Flash Drive. You can boot from it and enjoy a portable Ubuntu system in your pocket!

Finally, I hope you enjoyed this tutorial. Feel free to comment below if you have any questions or feedback.

Hend Adel
Hi! I'm Hend Adel, a freelancer technical geek with successful experience in Database, Linux and many other IT fields. I help to build solutions to suit business needs and creating streamlined processes. I love Linux and I'm here to share my skills via FOSS Linux! Thanks for reading my article.

24 COMMENTS

  1. Hi

    If Linux is installed on a USB flash drive (attached to Windows 10 laptop) following these instructions, will the Windows 10 bootloader be affected, possibly making it not possible to boot into Windows 10?

    Thanks.

    • Been wondering about that myself.

      I’ve installed Linux on my old laptop this way.

      Seems to work so far. Unplugged the USB and windows still boots!

      Hopefully, this works for my desktop.

    • hi Max,

      Maybe You should do this installation on an vm better,
      and set the vm contain no hdd.

      I have installed an ubuntu on a windows 10 laptop, and it will affect the hdd’s boot loader!
      my steps are:
      1.use usbA as a ubuntu installtion CD
      2.insert usbB as a target where ubuntu to be installed
      3.then click install
      4.finally, usbB was not bootable 🙁

      • Hi Herry,

        You can perform this tutorial on a VM with a HDD attached too, the most important part is to check where the bootloader will reside on the USB or the HDD.

    • Hello Max,
      If you selected the USB to be used in the “Device for boot loader installation” (Step 8), then no it will not affect your Windows 10 boot loader. However, if you left the “Device for boot loader installation” option without changing it, then you will end up messing your harddisk bootloader.

  2. Worked fine on the computer that I used to install to usb . Is it supposed to work on other PC’s too? I have old Dell Latitude with no hard drive that boots up fine with a Rufus bootable of trial Ubuntu but this usb just brings up an Intel matrix storage manager and just blinks. It doesn’t say there is no bootable device but it just hangs. Do I nedd the other the Rufus usb to start it firs?

    • Hello Headley,
      yes you can use it with various machines. From my side, I had used the USB on two different machines that have two different operating systems.

  3. The procedure will likely fail to create a portable installation if the installing PC already has an EFI boot partition (like Win10).
    You need to do some additional steps at the end, to fix the UEFI boot on USB. This is because Ubuntu will install the boot files on your host system, not on USB. Normally this will not break the Win10 boot, however you want to move these files to the USB partition.

    More details: https: //meaningofstuff.blogspot.com/2019/09/linux-ubuntu-1904-full-install-on-usb.html

    • Hi there, I’ve done almost your tutorial except moving p/EFI/Ubuntu to p/OLD and the later steps. When I type “mv p/EFI/ubuntu p/OLD”, it said “mv: cannot stat ‘p/EFI/ubuntu’: No such file or directory”. What should I do? Is it because of “sync; umount p; umount t; sync” commands?

    • Hi Mihvoi,
      It worked fine for me on a Windows 10 machine. Kindly ensure that you install the bootloader files on the USB (Check Step 8).

    • Hi,
      Make sure that you have created a partition schema as mentioned in (Step 7) and select your USB to install the boot loader files on it as mentioned in (Step 8).

  4. In my case if I don t create an EFI partition is not booting…I tried both ways, and without, it is not working.
    Another thing, even when it boots, it works extremely slow and with a strange behaviour..I didn’t saw the desktop yet 🙂 The screen before showing the desktop is infinite… maybe because I used an USB 2.0? I don t know because I have sufficient space, 64 GB.And I tried to install different versions of Ubuntu with the same result.Even if it would work you can rely on this system working and loading so slow(in my case).
    I said I ll try with an USB 3.0 but don t know if it’ll make the difference..

  5. This doesn’t work for me. I get an error message when the laptop tries to boot:
    “error: attempt to read or write ouside of disk ‘hd0’.
    I used an HP Probook with i7 CPU, which doesn’t have a hard drive in it. This laptop cannot access the harddrive, and replacing the harddrive doesn’t help, so I guess it has an interface problem in the laptop itself. That’s why I want to use it with a USB3 memory stick instead.
    BIOS boot mode is Legacy (not UEFI).

    I used a DVD with Ubuntu 19.10 and a Sandisk Ultrafit 256 GByte USB memory.

    If I boot with the DVD and then look at the USB stick with GParted, I can see:
    Partition, File System, Mount Point, Size, Used, Unused, Flags
    /dev/sda, a key, fat32, /media/ubuntu/0789-23C4, 3.90 GiB, 7.82 MiB, 3.90 GiB, boot
    /dev/sda2, a key, extended, , 229.34 GiB, –, –,
    /dev/sda5, a key, ext4, /media/ubuntu-fe4a…, 225.44 GiB, 8.87 GiB, 216.57 GiB
    /dev/sda6,, linux-swap, , 3.90 GiB, 0.00 B, 3.90 GiB
    unallocated,, unallocated 1.00 MiB –

    What could be wrong?

  6. Hi, i followed all the steps and double checked steps 7 and 8. Now if the USB drive is not connected the minimal bash appears. I tried to change the boot options order but nothing changed. It works only if the USB drive is connected. How can i fix this?

  7. Hi there, in step 6 “unzip android-studio-ide-*-linux.zip”
    on the Android Studio page there is only the option to download the .tar.gz (I couldn’t see a .zip file) am I missing something?

  8. Tried this. not working. it complained about missing EFI partition. I did create one.
    But after setup all it did was booting up in grub shell without finding a Linux installation.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

STAY CONNECTED

24,325FansLike
190FollowersFollow

LATEST ARTICLES

RECENT COMMENTS

best linux distros programmers
Linux distros have long been a favorite among programmers since the rise in popularity of the OS in the nineties. Programmers are technical by nature, and Linux distros appeal to that technical nature. Let's discuss why Linux is a great desktop OS for programmers and developers, and find out best distros suitable for them.
manjaro screenshots
Want to take a quick virtual tour Manjaro XFCE edition instead of downloading GBs worth of ISO image and then making a Live USB of it? We will make it easy for you. Here are a series of screenshots of the important aspects of Manjaro Linux in XFCE edition. This is a light-weight edition, and aims to be fast and low on system resources. You will be amazed on how it is still visually appealing and user friendly.
best linux distros for laptops
Whether buying a Linux pre-installed laptop or selecting a Linux distro for your existing laptop, there are many things to consider. Let's take you through some of the best Linux distros that are optimized for Laptops in this 2019 edition of the article. Read on.