How to Install Linux OS on USB Drive and Run it On Any PC

Ever thought of using any computer which is not yours, with all your personal stuff and configuration? It is possible with any Linux distribution. Yes! You can use your own, customized Linux OS on any machine with just an USB drive.

Read Also: How to Install CentOS 7 in a USB Drive

This tutorial is all about installing Latest Linux OS on your pen-drive ( fully reconfigurable personalized OS, NOT just a Live USB ), customize it, and use it on any PC you have an access to. Here I am using Lubuntu 18.04 Bionic beaver for this tutorial (but, you can use any Linux distribution). So let’s gets started..

Requirements:

  1. One Pendrive 4GB or More (Let’s call it as Main USB drive/Pendrive).
  2. One more Pen drive or DVD disk to use as bootable Linux installation media.
  3. Linux OS ISO file, for example Lubuntu 18.04.
  4. One PC (Don’t worry, there will not be any effect on that PC).

TIP: Use 32 bit Linux OS to make it compatible with any available PC.

That’s it! Go, and collect all of these. It’s time to do something new.

Step 1: Create Bootable Linux Installation Media

Use your Linux ISO image file to create a bootable USB installation media. You can use any software like Unetbootin, Gnome Disk Utility, Yumi Multi Boot, xboot, Live USB Creator etc. to create bootable usb with the help of ISO image file.

Alternatively you can use dvd disk by writing that ISO image to it (but that is the old school method).

Step 2: Create Partitions On Main USB Drive

You have to make two partitions on your Main USB drive using Gparted or Gnome Disk Utility, etc.

  • Root partition of format ext4 of size according to your use.
  • Optionally you can use rest of the space as a FAT partition for using it as a normal USB drive.

I am having 16GB USB drive and I have created one root partition of 5GB and using rest 11GB as normal FAT partition. So my 16 GB USB drive is converted to 11GB drive for normal use on any PC. Sounds good!!!

This step you can do while installing Linux also, but it will be very complex while installing Operating System’s like Arch Linux.

Main USB Drive Partitions

Main USB Drive Partitions

Once you have created required partitions on Main USB drive. Now take a deep breath because it’s time to go for Linux installation section.

Step 3: Install Linux on USB Drive

1. First boot Linux OS (Lubuntu 18.04) from your bootable installation media and launch installation application from live session. Live session of Lubuntu 18.04 will look like this.

Lubuntu Live Boot

Lubuntu Live Boot

2. Installer welcome screen will appear, select Language there and hit Continue.

Select Lubuntu Installation Language

Select Lubuntu Installation Language

3. Select Keyboard Layout and continue…

Select Lubuntu Keyboard Layout

Select Lubuntu Keyboard Layout

4. Select Wifi internet if you want to update Lubuntu while installation. I will skip it..

Select Wifi to Update Lubuntu

Select Wifi to Update Lubuntu

5. Select Installation Type and Third party installation as per your choice and go to next..

Select Lubuntu Software Updates

Select Lubuntu Software Updates

6. Here select Something Else Option (It is Mandatory) and go to next…

Select Lubuntu Installation Type

Select Lubuntu Installation Type

7. This is an an Important step, here you need to find out where your Main USB drive is mounted.

Find Main USB Drive

Find Main USB Drive

In my case /dev/sda is internal hard disk of the PC and I am using /dev/sdb is USB Lubuntu Installation media from where this live session is booted.

And /dev/sdc is my Main USB drive where I want to install my Linux system and where I have made two partition in step number 2. If you have skipped step 2, you can also make partitions in this window.

First change mount point of First partition on this Main USB drive to ROOT (i.e. “ / ”). And as shown in second red square select bootloader installation device as the Main USB drive.

In my case it is /dev/sdc. This is the most important step in this tutorial. If it is not done correctly your system will boot only on the current PC you are using, which is exactly opposite of your motivation to follow this tutorial.

Once it is completed, double check it and hit continue. You will get a small window showing devices and drive which will be affected.

8. Make sure that the device and drives shown on this window are of your Main USB drive, which is in my case /dev/sdc. Hit continue

Write Partition Changes to Disk

Write Partition Changes to Disk

9. Now select your Region and hit Continue

Select Lubuntu Region

Select Lubuntu Region

10. Add username, password and hostname etc…

Create Lubuntu User

Create Lubuntu User

11. Let the installation finish..

Lubuntu Installation

Lubuntu Installation

12. After completing installation hit restart and remove your installation media and press Enter.

Lubuntu Installation Completes

Lubuntu Installation Completes

13. Congratulations, you have successfully installed your own Linux OS on your pen drive to use it on any PC. Now you can connect USB drive to any PC and start your system on that PC by simply selecting boot from usb option while booting.

Step 4: Customize Lubuntu System

Now it’s time for fun. Just boot your system on any PC and start customizing. You can install any softwares you want. You can change Themes, Icon themes, install docker.

You can add and store your online accounts on it. Install / modify / customize whatever you want. All the changes will be permanent. They will not change or reset after rebooting or booting on other PCs.

Following figure shows my customized Lubuntu 18.04.

Lubuntu Running on USB Drive

Lubuntu Running on USB Drive

The main advantage of this method is you can use your personal stuff, your online accounts securely on any PC. You can even do secure online transactions as well on any available PC.

I hope it will be helpful for you, if you have questions regarding this article, please feel free to ask in the comment section below.

Best Affordable Linux and WordPress Services For Your Business
Outsource Your Linux and WordPress Project and Get it Promptly Completed Remotely and Delivered Online.

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

103 Responses

  1. Cameron says:

    Hey Amit or anyone else that can please help. I am pretty good with tech, but I have never done this before. I found this tutorial after I already installed Linux to my USB drive. Everything works fine, but as you said I can only use the pen drive on the current computer because grub installed itself on my main windows 10 OS.

    Now I know how to do it right this next time around and my windows still boots up like normal unless put the USB in and select Linux from the boot manager. My main question is where did Grub get installed to on my main NVME drive? I would like to remove it just to keep things clean. I have no idea where it went or how to get it off of my computer.

    • Amit Nandkumar Hambar says:

      Don’t worry, your computer is clean. there is only one entry added in grub. if you remove grub from your hard disk, you cannot use Linux installed on USB.

      If you still want to remove grub and restore windows bootloader. Got one youtube video for that- https://www.youtube.com/watch?v=DOA6hEnOEjs

      • Cameron says:

        Hey Amit! Thanks again for your reply and the assurance that there isn’t anything wrong. I finally achieved what I wanted and got everything on the USB stick including the bootloader. I tested it on 3 different computers and it will now boot on any computer with fast boot disabled. I still would like to remove grub from my windows boot partition since the my USB stick now has it’s own ESP partition on it.

  2. Lester B says:

    Hi,

    I have done this and it’s working well. However, I cannot access the files on the 2nd partition on windows. Any idea how to make it so that I can still use the 2nd partition on other operating systems?

    Thanks.

    • Amit Hambar says:

      Formatting second drive with fat32 it will be accessible in windows. If doesn’t work, try assigning letter to that drive in windows disk management.

  3. Kaushik says:

    Can this USB be formatted to FAT32, after installing Linux?

  4. cdde says:

    Wouldn’t this work better using a Virtual Machine in VirtualBox and then just using the USB passthrough? You only need ONE USB to do this, and you don’t have to worry about files being lost. (If you do use a VM, don’t add a hard disk and it will be WAY easier because then it will just be a normal Linux install since your USB is /dev/sda.)

    There may be a slight speed benefit by doing it this way, but why when it could be much simpler? The main bottleneck will pretty much be the USB speed anyways.

    All you’d need in the VM method is:

    • 1 (and only one) USB Drive
    • VirtualBox, and user in vboxusers group
    • An ISO file
    • A VM with no Hard Disk
    • Amit Nandkumar Hambar says:

      Yes that is also a good option.

    • Bettadapura Sharma says:

      Not all applications can be run on a VM. I am planning to use this method to forward my USB port (over IP) using Virtual Here server. That won’t run on a virtual machine since it virtualizes a real device.

  5. John sedrick says:

    Hi thanks for your instruction..

    I installed two distros (Ubuntu 16.04 32bit & Kali 2019.2) with your method on my 32G flash drive & installed GRUB in the MBR of my USB pen drive (/dev/sdc) & everything worked like a charm but a day later when i inserted my USB it was recognized as /dev/sdd (because my external hard drive was inserted already) & GRUB goes to rescue mode & says:”there is no OS in /dev/sdc” which is true because now my USB flash is in /dev/sdd.

    I replaced my external HDD & flash drive to have my USB flash at sdc again & the problem is solved.

    The question is I need this USB flash to boot on my distros in any computer & there is no guarantee that i always have it at /dev/sdc in every computer so how do you propose to work around this problem & have USB OS that is fully installed(not just live OS) & boots in any computer

    • Amit Nandkumar Hambar says:

      I Think you have installed grub on your local hard disk. check step no 7, second red box.

      • John sedrick says:

        No I did install the GRUB on the MBR of my USB Drive (checked that in other Computers) when I plug my USB to the computer the grub comes up & I can see the OSes installed on the USB but when I hit Enter I face this error (but sometimes it runs completely OK if it is sdc!!!)

        “Missing modules (cat /proc/modules; ls /dev)
        ALERT! /dev/sdc2 does not exist. Dropping to a shel!
        Busybox V1.30.1
        (initramfs)

    • Stefan says:

      I got a similar problem. Even though my USB was /dev/sdc, and I selected that for the bootloader. Grub still got installed to /dev/sda. The USB only works in the computer where I created it. Not possible to boot on another computer.

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.