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 a 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 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:
- One Pendrive 4GB or More (Let’s call it as Main USB drive/Pendrive).
- One more Pen drive or DVD disk to use as bootable Linux installation media.
- Linux OS ISO file, for example Lubuntu 18.04.
- One PC (Warning: Disconnect internal hard drives to prevent boot record alteration).
Important: While this procedure will not cause loss of data, some users have experienced changes to their internal drive’s bootup behavior depending on Linux distributions selected. To prevent any possibility of this occurrence, you may wish to disconnect your hard drive before continuing with the USB install portion of the tutorial.”
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.
- The root partition of format ext4 of size according to your use.
- Optionally you can use the 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 Systems like Arch Linux.
Once you have created required partitions on the 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 a live session. Live session of Lubuntu 18.04 will look like this.
2. Installer welcome screen will appear, select Language there and hit Continue.
3. Select Keyboard Layout and continue…
4. Select Wifi internet if you want to update Lubuntu while installation. I will skip it.
5. Select Installation Type and Third-party installation as per your choice and go to next..
6. Here select Something Else Option (It is Mandatory) and go to next…
7. This is an Important step, here you need to find out where your Main USB drive is mounted.
In my case /dev/sda
are an 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 partitions in step number 2. If you have skipped step 2, you can also make partitions in this window.
First, change the mount point of the first partition on this Main USB drive to ROOT (i.e. “ / ”
). And as shown in the 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…
9. Now select your Region and hit Continue…
10. Add username, password, and hostname, etc…
11. Let the installation finish.
12. After completing installation hit restart and remove your installation media and press Enter.
13. Congratulations, you have successfully installed your own Linux OS on your pen drive to use it on any PC. Now you can connect a USB drive to any PC and start your system on that PC by simply selecting boot from USB option while booting.
Step 4: Customize the Lubuntu System
Now it’s time for 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 the changes will be permanent. They will not change or reset after rebooting or booting on other PCs.
The following figure shows my customized Lubuntu 18.04.
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.
Linux is so freaking hard and takes a long time but I love it.
Finally installed Ubuntu 20.04 on my usb and got all the graphic and sound drivers to work. Took like 7 hours but was worth it
Where can I get a 32GB flash drive with a minimal Linux OS already installed to operate on any computer? I am 76 years old and not capable of creating one myself?
I can make you one…
This did not work for me. At the end of the installation, it said “unable to install Grub……“. I think you have missed something in Step 6. I’ll search for other newsletters and see if I can find one that works
Can you install Linux to its install USB?
Thank you so much it is so useful that I have fully installed Ubuntu on my Pendrive and SD card using this method. ❤️Thank you❤️
Please, Double Check the USB Boot Program you recommend!
RUFUS IS THE ONLY ONE THAT WORKS (WITHOUT SOFTWARE ERRORS).
Also, the method of Formating the Main USB. We wanted to install MINT LINUX. Apparently MINT LINUX preferable is EXT2. Needs a minimum of 6GB to install.
Hi there,
When I tried proceeding with step 6 by formatting my usb to “cleared”, it is shown as “unknown” instead of “allocated”.
My usb is under exFAT format, is it not possible and I’ll need a fat32 usb?
Hope someone could help give me some pointers on this soon so I can order a fat32 usb right away to get Linux running for my project!
Thanks in advance.
You can format it to Fat32 again.
Item #7 needs another description/alternative.
I tried many method and I totally forgot the swap partition.
Now the installation is a success.
So far your article can save a day. Thank you…
(1)will it boot Linux Lite 5.0 from an old PC motherboard like ‘Gigabyte GA-G31M-S2L 3GB ram?
(2)Advice on youtube installation need USB Flash Drive USB 3.0 instead of USB 2.0 but not sure?
Thank you for your help.
I’ve done this 3 times and it still installs the boot field to my windows hard drives (internal SSD on a laptop) is there a method to move them to the USB to fix this issue? Otherwise, this won’t work for laptop users.
“Important: While this procedure will not cause loss of data, some users have experienced changes to their internal drive’s bootup behavior depending on Linux distributions selected. To prevent any possibility of this occurrence, you may wish to disconnect your hard drive before continuing with the USB install portion of the tutorial.”
This is very troubling – I am using my PC to launch the steps in your tutorial so how can I disconnect internal disks one of which is Windows OS and it is an SSD.
It sounds something is missing in your steps particularly the initial ones. Somewhere there is a claim no need to reboot which means Windows OS is running during the entire process??
I have downloaded LILI and Ubuntu 20.4 LTS
Thank you.
I have installed Linux lite on a 32 GB flash drive. After running for a few days it develops Kernel panic error with exit code 0x000000b and sometimes 0x0000004 and freezes. In the advanced options during boot, I get options for 3 kernels and their recovery modes, but sometimes none of them will boot, and sometimes the oldest one boots up.
I have already reformatted and reinstalled it thrice in two months. I wanted to ask that how long can I expect a good quality pen drive (HP/Sandisk) to successfully run full installations without being corrupted? In this case, do you think I should replace my flash drive? Thanks