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

Have you ever thought about using a computer that isn’t your own, with all your personal stuff and settings? It is possible with any Linux distribution. Yes! You can use your own custom Linux operating system on any machine with just a USB drive.

Also read: How to install CentOS 7 on a drive

USB

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

Requirements

: A Pendrive of

  1. 4GB or more (let’s call it as main USB drive/Pendrive
  2. ). One

  3. more Pen drive or DVD disc to use as Linux bootable installation media
  4. .

  5. ISO file of the Linux operating system, for example Lubuntu 18.04.
  6. A PC (Warning: Disconnect internal hard drives to avoid tampering with the boot record).

Important: Although this procedure will not cause data loss, some users have experienced changes in the boot behavior of their internal drive depending on the selected Linux distributions. To avoid any possibility of this occurring, you may want to disconnect your hard drive before proceeding to the USB installation portion of the tutorial.

TIP: Use the 32-bit Linux operating system to make it compatible with any available PC.

That’s all! Go and collect all this. It’s time to do something new.

Step 1: Create

bootable Linux installation media

Use the Linux ISO image file to create 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 a DVD disc by writing that ISO image to it (but that’s the old-school method).

Step 2: Create

partitions on the primary USB drive

You need to make two partitions on your primary USB drive using Gparted or Gnome Disk Utility, etc

.

  • The root partition format ext4 size according to its usage
  • .

  • Optionally, you can use the rest of the space as a FAT partition to use it as a regular USB drive.

I have a

16GB USB drive and have created a 5GB root partition and use the rest of 11GB as a normal FAT partition. So my 16GB USB drive becomes an 11GB drive for normal use on any PC. Sounds good!!!

This step can also be done while installing Linux, but it will be very complex when installing operating systems such as Arch Linux.

<img src="https://www.tecmint.com/wp-content/uploads/2018/06/Main-USB-Drive-Partitions.png" alt="Primary USB Drive Partitions

” />Primary USB Drive
Partitions

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

Step 3: Install Linux on USB drive

1. First, boot the Linux operating system (Lubuntu 18.04) from your bootable installation media and launch the installation application from a live session. The live session of Lubuntu 18.04 will look like this.

Lubuntu Live Boot

2. The installer welcome screen will appear, select Language there and press Continue.

<img src="https://www.tecmint.com/wp-content/uploads/2018/06/Lubuntu-Live-Boot.png" alt="Select Lubuntu Installation Language

” />
Select Lubuntu Installation Language

3. Select Keyboard layout and continue…

<img src="https://www.tecmint.com/wp-content/uploads/2018/06/Select-Lubuntu-Installation-Language.png" alt="Select Lubuntu Keyboard Layout

” />
Select Lubuntu Keyboard Layout

4. Select Wifi Internet if you want to update Lubuntu during installation. I’ll skip it.

<img src="https://www.tecmint.com/wp-content/uploads/2018/06/Select-Lubuntu-Keyboard-Layout.png" alt="Select Wifi to update Lubuntu

” />
Select Wifi to update Lubuntu

5. Select Installation Type and Third-Party Installation according to your choice and go to next.

<img src="https://www.tecmint.com/wp-content/uploads/2018/06/Select-Wifi-to-Update-Lubuntu.png" alt="Select Lubuntu Software Updates

” />
Select Lubuntu Software Updates

6. Here select Option Something else (it is mandatory) and go to next…

<img src="https://www.tecmint.com/wp-content/uploads/2018/06/Select-Lubuntu-Software-Updates.png" alt="Select Lubuntu Installation Type

” />
Select Lubuntu Installation Type

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

Find primary USB driveFind primary USB drive In my case /dev/

sda is an internal hard drive of the PC and I am using /dev/sdb is a Lubuntu USB installation media from where this live session is started. And /dev/sdc is

my

main USB drive

where I

want to install my Linux system and where I have made two partitions in Step number 2. If you skipped step 2, you can also create partitions in this window.

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

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

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

8. Make sure that the device and drives shown in this window are from your primary USB drive, which is in my case /dev/sdc. Click continue

<img src="https://www.tecmint.com/wp-content/uploads/2018/06/Find-Main-USB-Drive.png" alt="Write partition changes to disk

” />
Write partition changes to disk

9. Now select your region and press Continue

<img src="https://www.tecmint.com/wp-content/uploads/2018/06/Write-Partition-Changes.png" alt="Select Lubuntu Region

” />
Select Lubuntu Region

10. Add username, password and hostname, etc.

<img src="https://www.tecmint.com/wp-content/uploads/2018/06/Select-Lubuntu-Region.png" alt="Create Lubuntu user

” />
Create a Lubuntu

11 user. Let the installation finish.

<img src="https://www.tecmint.com/wp-content/uploads/2018/06/Create-Lubuntu-User.png" alt="Lubuntu Installation

” />
Lubuntu Installation

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

<img src="https://www.tecmint.com/wp-content/uploads/2018/06/Lubuntu-Installation.png" alt="Lubuntu Installation Completes

” />
Lubuntu Installation Completes

13. Congratulations, you have successfully installed your own Linux operating system on your pen drive for use on any PC. You can now connect a USB drive to any PC and boot your system on that PC by simply selecting the boot from USB option during boot.

Step 4: Customize the Lubuntu system

Now it’s time to have fun. Just boot your system on any PC and start customizing. You can install any software 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 changes will be permanent. They will not change or reset after rebooting or booting on other PCs.

The figure below shows my custom Lubuntu 18.04.

<img src="https://www.tecmint.com/wp-content/uploads/2018/06/Lubuntu-Installation-Completes.png" alt="Lubuntu running on a USB drive

” />
Lubuntu running on a USB drive

The main advantage of this method is that you can use your personal things, your online accounts safely on any PC. You can even make secure online transactions as well on any available PC.

I hope it is useful for you, if you have questions about this article, feel free to ask in the comments section below.