blog posts

How To Installing Linux On Flash

Installing Linux On Flash Has Many Applications, But There Are Different Ways To Implement It, And We Will Discuss Some Of Them Below.

You must have seen in some movies that a hacker can access files by connecting a USB flash drive to a computer without having the operating system password and can delete, copy or transfer them, apart from the leading technical methods and the dynamic cinematic approach that may be felt with this depiction.

In general, sometimes people have to start another operating system to access their files and make backups of the files without creating the primary operating system on the computer or laptop, for example, in a situation where even the Safe Mode of the primary operating system is not responsive, and the user needs a clean boot.

Also, someone might want to try out a variety of Linux distributions before doing a full install despite the five reasons to install Linux on a laptop; It also doesn’t want to remove its current operating system before making a final decision. Also, maybe someone else always wants to have a portable operating system and run it on any computer.

In other situations, a person needs applications of a particular operating system.

At the same time, he does not use that operating system, and due to the occupied space in the case of installing two operating systems side by side, he does not agree with this method.

Therefore, one of the proposed solutions will be to install Linux on a flash memory, which is not particularly complicated and seems almost as easy as learning how to install Linux on an Apple MacBook; But the ways to achieve this goal are different, and everyone may be comfortable with a particular method. Stay with Zoomit as always.

Topics you will read in this article:

  • Installing Linux on Flash in Windows
  • Installing Linux on Flash in Linux Ubuntu
  • Installing Linux on Flash with Etcher
  • Installing Linux on Flash with Startup Disk Creator
  • Installing the full version of Linux on Flash
  • Installing Ubuntu on Flash with mkusb
  • common questions

To install Linux on a flash memory, you must first know that, like bootable Flash, all the information inside the flash memory will be deleted for installation. However, the difference between bootable flash memory and installing Linux on Flash is that in the first case, the user can run and install system files on the memory in the desired partition through Flash; Whereas, installing Linux on Flash means installing the operating system on a flash memory, which can be booted on any laptop or computer.

Another important point that should be noted about installing Linux on Flash is its shortcomings and weaknesses, including removing changes made in the operating system on Flash.

In this way, the user can install the desired software on that operating system; But every time it is restarted, it returns to the first state.

In fact, unlike the operating system on DVD Live, which only runs the operating system and the user cannot install software on it, it is also possible to install the program in the case of using Flash. Still, in some installation methods, these changes are not permanent.

The non-permanence of programs and changes in the operating system installed on Flash can be considered an advantage and strength. For example, you want to do your financial process and banking work in an operating system that does not store anything, and by using this method, you create more security for yourself. We will first discuss installing Linux on Flash through the Windows operating system in the following. Then we will check how it is installed in the Linux operating system.

Installing Linux on Flash in Windows

By now, you must have come across portable software in the Windows environment. In this tutorial, we want to create a mobile example of the operating system on Flash. For this purpose, we need the image or ISO file of the desired operating system and install a live and executable version of the operating system on a USB flash drive.

To install Linux on a flash drive, prepare a flash drive with at least 4 GB of memory (8 GB is better); Of course, if you want to install many programs on the operating system, choose a flash with more memory. Connect it to the USB 3.0 port and follow the step-by-step tutorial.

Installing Linux on Flash in Windows and Rufus software

First step: First, download the image or ISO file of the desired Linux operating system, which is available for free, from the official website. After installing Linux on Flash, it is better to choose the 32-bit operating system version to run it on any system.

Installing Ubuntu on a flash drive in Windows

Second step: Rufus software is a practical tool for creating bootable and live Flash, which you must also download and install.

Installing Linux on Flash with Rufus

Step 3: Run Rufus:

After downloading and installing the Rufus program, run the program and press the SELECT button as shown in the image and choose the ISO file from the opened window. Set the Partition Scheme option to GPT mode; Of course, if the BIOS Mode of your system is Legacy, you must select the MBR option in this section.

To ensure BIOS Mode, press the Windows key and R to run the Run program. Type cmd in the box, press Enter to open Command Prompt, type msinfo32, and press Enter. The System Information window opens; look for BIOS Mode to identify its mode, select the appropriate option in the Partition Scheme section, and press the START button.

Installing Linux on Flash with Rufus

Now a message will appear in which there are two options, and the Write in ISO mode option should be selected and confirmed.

Installing Linux on Flash with Rufus

Then, a warning will appear that all data on the flash drive will be lost; So, to continue, confirm and wait for the process to complete. The waiting time depends on the available hardware resources of the system.

Step 4: The flash drive is ready and can be used as Ubuntu 22.04 Live, for example. So, please restart the computer to test its performance.

After rebooting and displaying the motherboard logo, you must enter the boot menu. For this purpose, you can press one of the F10 or F12 keys on systems such as HP, Dell, or Lenovo several times to enter the boot menu, depending on the motherboard. Select the USB flash drive from the suggested options by pressing the Enter key.

Installing Linux on Flash with Rufus

You will be directed to another menu where you should select Try or Install Ubuntu.

Installing Linux on Flash with Rufus

After a few seconds, the computer will be loaded with Ubuntu operating system in USB Live mode, and you can enjoy the operating system on the Flash. Also, by running Install Ubuntu 22.04 LTS, it is possible to install the operating system on the system.

Installing Linux on Flash with Rufus

If you remember, it was mentioned at the beginning of the article that the changes applied to the operating system installed on the Flash would be deleted after rebooting; But to solve this problem, you can use flash memory with a larger volume and go to the Rufus program to set the Persistent Partitions Size option and specify part of the flash capacity exclusively for the operating system.

Installing Linux on a permanent flash with Rufus

For example, using a 120 GB flash memory, you can select 90 GB of it in this section to be considered for the operating system, and thus the changes applied will not be deleted after starting. Another method is installing Linux on Flash in Windows using the open-source program Etcher, which can also be used in Linux and macOS; Therefore, due to its similarity, we will install Linux on Flash in a Linux operating system.

Installing Linux on Flash in Linux Ubuntu

It can be said that installing Linux on a flash is not much different from installing, for example, Ubuntu on a hard disk; Rather, some of the details that should be considered may seem strange to some who do not understand the whole issue. After all, in the open-source world of Linux, there are many ways to reach a destination, So choose whichever method you think is most convenient.

Installing Linux on Flash with Etcher

Rufus is not supported on any Linux distributions, but other tools are available to install Linux on Flash and create a live Linux operating system. One of these tools is called balenaEtcher or Etcher. This free and open-source program is available on Windows, Linux, and macOS platforms and has a similar mechanism on these platforms.

First step: First, download the Etcher software from the official website.

Installing Linux on flash with Etcher

Second step: Connect the flash drive to the system and run the Etcher program. Select the Flash from file button and select, for example, the Elementary OS distribution ISO file. The program window is displayed as follows.

Installing Linux on flash with Etcher

Step 3: Select the Flash with the Select Target button and press the Flash button to start the process. Then it asks the user for a password.

Installing Linux on flash with Etcher

After going through the live flash process, it will be ready to use with Elementary OS.

Installing Linux on Flash with Startup Disk Creator

To install Linux on a flash drive in a Linux environment such as Ubuntu, it is not necessary to install third-party programs such as Rufus or Etcher. For example, the Ubuntu distribution has a pre-installed tool called Startup Disk Creator. Using this program, flash memory and DVD can be bootable and live.

Step 1: Insert the Flash or DVD and look for Startup Disk Creator in the search section.

Installing Linux on Flash with Startup Disk Creator

Second step: As soon as the program is launched, it intelligently detects the “Disk Image” file on the system; if it is only an image file on the system, it will automatically add it to its list to prepare for installation on Flash or DVD. In addition, the Flash or DVD will also be detected automatically. In some cases, this process may not be automatic; Therefore, after running the program, find and add the image file storage location manually. Then, you can click Make Startup Disk.

Installing Linux on Flash with Startup Disk Creator

Installing Linux on Flash in Ubuntu is as simple as that. After about 3 to 4 minutes, the Flash is ready to connect to other computers to start Ubuntu. It can be installed on a laptop or another computer, and by changing the boot settings in BIOS and choosing to boot from the flash memory, a separate operating system can be used. Even if desired, the user can install the working system Flash on the computer in the same environment.

Installing the full version of Linux on Flash

Installing Linux on a flash allows the user to create a portable version of the Linux operating system wherever he is, only needing a laptop or computer to run it. It can be said that this method of converting the operating system on the bootable Flash to a full version of that operating system, unlike the previous process, the changes applied to the operating system are not lost after restarting.

In the first step, the user will need a flash memory with more memory, and 8 or 16 GB flash is not helpful for this; Because the full version of the operating system is supposed to be installed and used permanently. You can get a flash drive or, if you have more budget, an SSD hard drive with a capacity of 128 GB for this purpose.

Another problem that should be considered for installing the operating system on Flash is the compatibility issue with different hardware. In fact, in this method, installing Linux on Flash is executed in such a way that the installer considers the flash drive as a type of fixed memory like the hard drive on the system; Therefore, hardware optimizations are performed according to the current system hardware; But if this Flash is to be used on another system, the hardware issue may cause problems. As a result, open-source drivers can be used instead of proprietary drivers to reduce errors.

Another problem we should mention that is missed in many Linux flash installation tutorials is the Bootloader.

 There are solutions to solve the Bootloader problem on UEFI systems that some users may encounter.

The bA bootloader is a computer program responsible for starting the computer and is stored in the ESP partition. This program often works automatically without the need for user intervention. However, one of the challenges of installing Linux on Flash that some users face and are difficult to discover is the ESP partition.

The user can remove the hard disk to solve the Bootloader problem in the desktop computer. Still, this method is not applicable for laptops, and besides, it doesn’t look professional at all, and it’s not foolproof in terms of safety. The general workaround is not to let the installer know that an ESP partition has already been created.

The easier way is to remove the ESP flag from the ESP partition before installing Linux on the Flash and restore it to the previous state after the installation process is complete. In this way, the Ubuntu installer is tricked into not finding the current ESP partition and automatically creates a new one on the flash memory. Of course, rest assured that the original ESP partition on the hard drive will remain intact and won’t cause any problems.

Essential tips for installing Linux on Flash in this way

  • Two USB flash drives, one as a bootable live flash for installation and the other as a memory for a complete Linux installation on it
  • You can consider 4 GB for the bootable Flash; the different Flash must have at least 32 GB of space.
  • It is recommended that both flash drives are of USB 3.0 type to speed up the installation. Even if you are using USB 3.0, be aware that the installation process is time-consuming, So manage your time and be patient.
  • Remember that booting the operating system on Flash is slower than hard disk and SSD.

First part :

Installing Linux on the Flash thoroughly can be considered the final stage of creating a live bootable flash in which the operating system could not save the changes. Therefore, a bootable Linux flash must be made using the previous methods to fully install Linux on the Flash.

For example, download Ubuntu from the official website and perform operations on Flash with a smaller volume by installing Linux on a moment with Etcher. This bootable Ubuntu flash can be used to install it at another fully-moment.

The second part :

Now we have the Flash, which has been converted into a live Ubuntu operating system with the previous methods. We want to turn it into a permanent operating system that can be portable and used on any computer.

Step 1: Connect both flash drives to the computer and restart the system to boot the operating system installed on the first flash drive. When it’s finished loading, and you’re in its environment, select Try Ubuntu.

Complete installation of Linux on flash

Second step: To disable the flags from the ESP partition, press the Windows key on the keyboard and type Gparted. This will open the Gparted partition manager that usually comes with Ubuntu.

Gparted program in Ubuntu

If Gparted was not in the version you installed, install it by running the following commands in the terminal:

sudo apt update

sudo apt install GParted

In the Gparted program, select system memory on the top right (number one in the image) and look for a partition between 100 and 500 MB with an esp flag. Then right-click on it and select Manage Flags (number 2 in the picture) from the opened menu.

Remove the ESP flag in Ubuntu

In this section, the esp and boot flags should be active, and you remove the tick on esp. If more flags are selected, take a screenshot of the selected options before the changes so that you can return them to the previous state after completing the installation process.

Remove the ESP flag in Ubuntu

Removing the esp flag will usually enable the MSFT data flag, leave it as is and close the window to save the changes.

Remove the ESP flag in Ubuntu

Now the operating system on the bootable Flash will no longer find the esp partition, and you can quickly start the complete installation of Ubuntu on the Flash.

Step 3: Make sure the Flash with a higher volume is inside the USB port. Click on the Install Ubuntu icon on the desktop. The installation process starts, and you can go through the initial stages of choosing the keyboard layout and language.

Install Ubuntu

To reduce the operating system installation time, you can choose Minimal Installation, according to which essential tools and a browser are installed. Other programs such as Office and multimedia players are installed later. Click the Continue button to go to the next page.

Installing Ubuntu on a flash drive

On the next page, select Something Else and continue.

Installing Ubuntu on a flash drive

In the next section, you can see all the disks, both hard disk and Flash, are listed, and according to the change in the settings, there is no news about the esp hard disk partition. Select the desired Flash (larger Flash) in the “Device for bootloader installation” section. For example, a 500 GB external SSD connected to the laptop via Thunderbolt is selected in the image.

Installing Ubuntu on a flash drive

Now, in the upper section, as shown in the image, select the giant arrow and then click on the negative button to delete all the partitions and ultimately free up the memory space.

Installing Ubuntu on a flash drive

When selecting Flash, click the plus button to add a new partition.

Installing Ubuntu on a flash drive

Set the first partition as ESP for Bootloader.

Linux partitioning

Select the remaining free space according to the image below and configure the system files of the root partition with Ext4. Also, you can create root, swap, and home sections separately; But it is recommended to put everything, even exchange, in the root partition.

Linux partitioning

To be more sure, after configuring the partitions, check again that the desired Flash or external memory is selected as the bootloader installation location, and now click the Install button to be redirected to the Timezone settings page and select your time zone. Then you need to define the username and password and click continue to start the installation officially.

Installing Ubuntu on a flash drive

If you’ve ever installed Ubuntu, you’ll notice that this method is much slower than usual. In any case, wait for the operation to complete. Upon completion of the installation, a message will appear in which the option Continue Testing and Restart Now will be seen.

Installing Ubuntu on a flash drive

Do not click Restart Now because we need to reset the ESP partition settings before restarting. So, tap on Continue Testing.

Step 4: You can re-enable the ESP flag in the primary partition. So, run the Fparted program and select the previously enabled ticks. If you accidentally restarted the system before re-enabling these ticks on the primary ESP partition, there is nothing to worry about.

In this case, because there is no ESP partition on the computer, its operating system will not boot without the Flash you created. This method can also make it difficult for other people to access the operating system. However, you can restore the original ESP partition flags after rebooting. Finally, a full version of Ubuntu is installed on the Flash; now, the live OS can be turned off.

Fourth part: Since the flash memory is partitioned in this method, it is not possible to restore it to its previous state and use it for data transfer by formatting it directly by the operating system in most cases.

In addition to Linux, this program has also been published for Windows and macOS platforms. Therefore, using this Gparted software to restore Flash with the live operating system is better. So, with its help, delete all partitions and create a new section with FAT32 or NTFS formats.

Installing Ubuntu on Flash with mkusb

As mentioned, there is a big problem with installing Linux on a flash drive; as soon as the system is rebooted, all changes applied to the operating system will be deleted because all data is processed in the live working system environment on the RAM. Therefore, in addition to the previous method of installing a full version of Ubuntu on Flash, if a user wants the operating system on Flash to be able to save changes, he can also go to the mkusb bootable tool in Ubuntu. This tool is often used to install Ubuntu or Debian on Flash.

By creating a permanent Flash Live, the user can use it like an operating system installed on a computer or laptop. In this case, without worrying about deletion, you can install desired programs, save files, customize the design and access them after restarting, and have a portable operating system. Like the previous method, in this method, a flash memory of at least 64 GB or higher is required.

The mkusb program is not installed by default on Ubuntu, and to install it, you must first add the Universe repository to the system.

Thus, enter the following command in the terminal:

sudo add-apt-repository universe

Then the following command:

sudo add-apt-repository PPA:mkusb/PPA

sudo apt update

Then, press Enter to rerun the command and continue the installation process.

Install mkusb on Ubuntu

mkusb can now be installed from the PPA with the following command:

sudo apt install –install-recommends mkusb mkusb-nox USB-pack-efi

After installing this program, you can start installing Ubuntu on the Flash and creating a permanent live flash. Connect the Flash and follow the steps.

Step 1: Run the mkusb program. An image similar to the photo should appear.

Installing Ubuntu on flash with mkusb

You must click on the Yes option based on the message that appears. After that, a password will be requested to confirm permission to perform the ISO installation process in Flash.

Installing Ubuntu on flash with mkusb

A warning will appear that all current flash data will be lost; click OK to continue.

The second step: here, the tasks that mkusb can do are shown, and the user must choose an option. Select and confirm the Install (make a boot device) option.

Installing Ubuntu on flash with mkusb

Third step: In this section, select and confirm the Persistent Live option to permanently install Linux Live on the Flash.

Installing Ubuntu on flash with mkusb

You will then be prompted for a user password, which you must enter to continue.

Step 4: Now, select and confirm the ISO file of the Linux distribution you want to install.

Installing Ubuntu on flash with mkusb

Fifth step: Now you have to select the Flash on which the operating system is to be installed and bootable.

Installing Ubuntu on flash with mkusb

Step 6: In this step, select the UEFI option and click OK. This option can provide support for UEFI BIOS with Secure Boot mode; however, the BIOS of some systems in secure boot mode may prevent the operating system from booting even in this way, and you need to disable Secure Boot altogether in the BIOS settings.

Installing Ubuntu on flash with mkusb

Seventh step: The percentage of the memory considered as permanent space must be determined. Adjust and confirm the amount of permanent memory based on your needs.

Installing Ubuntu Persistent on flash with mkusb

Step 8: Enter the password in the terminal, and select and confirm the default option in the window.

Installing Ubuntu Persistent on flash with mkusb

Step 9: Finally, the user will be asked if he wants to continue creating the permanent flash live bootable. Click on the Go button to start the process.

Installing Ubuntu Persistent on flash with mkusb

After starting the process, wait until the operation is completed. A message will be displayed when the procedure is finished; click OK.

Installing Ubuntu Persistent on flash with mkusb

Step 10: In the new window in the picture, select the Quit option, click the Quit button at the bottom, and finally, press the Enter key in the terminal to exit the mkusb program.

Installing Ubuntu Persistent on flash with mkusb

Now you have a live bootable flash of your desired Linux operating system that can be used permanently.

Common Questions

Minimum flash memory needed to install Linux on Flash?

Install Linux on a flash drive requires at least a 4 GB flash drive.

Can a password be defined to run the operating system on Flash?

You need to do the Persistent Live installation of Linux on the Flash, then remove the ubuntu account by creating a new tab with sudo permissions.

Conclusion

Various methods can still be introduced to install Linux on Flash, and these methods are not limited to those in the open-source Linux platform. For example, in another way, you can back up your current Linux operating system and boot that backup saved in image mode (ISO file) on a flash using software and create a portable version of the operating system on a computer with all programs.

As mentioned, we need access to the BIOS settings to run the operating system installed on the Flash. To prevent this intrusion, some people encrypt the BIOS, which the user must enter at the beginning of the working system boot.

Passing it will not be difficult for experienced hackers and professional users when they have physical access to the device. For example, they can remove the small battery on the motherboard.

What do you think of users about installing Linux on Flash?