How to Make Bootable Pendrive in Ubuntu using Terminal

In the ever-evolving world of computing, the ability to create bootable USB drives has become an essential skill that I, as both a tech enthusiast and a novice user, find invaluable. Whether I'm installing a new operating system, rescuing a malfunctioning system, or carrying a portable Ubuntu environment with me, a bootable pendrive is my go-to solution.

While graphical tools exist, I realized that mastering the command-line approach not only enhances my understanding of Ubuntu but also empowers me with greater flexibility and control over the process.

In this step-by-step guide, I'll take you on a journey through Ubuntu's Terminal as I unlock the secrets of creating a bootable pendrive from scratch.

By harnessing the power of the command-line interface, I'll walk you through the entire process, ensuring that you can effortlessly craft your own bootable pendrive to embark on diverse computing adventures.

So, whether you're a Linux enthusiast eager to expand your skillset or a newcomer like me, curious to explore the depths of Ubuntu's command line, this tutorial will equip you with the essential knowledge to create bootable USB drives like a seasoned pro.

create-bootable-usb

Let's dive in together and discover the magic of turning a humble pendrive into a potent tool for Ubuntu enthusiasts and make a bootable pendrive in Ubuntu using a terminal, ubuntu create a bootable USB command line, how to make Ubuntu 22.04 bootable USB, how to create bootable pendrive in ubuntu.

 

Step 1: Download the Ubuntu ISO file

Open the Official Ubuntu website through any installed web browser and download the Ubuntu ISO through the following download link:

https://ubuntu.com/download/server

Click on any Ubuntu version you want to install. I’ve been using the “Download Ubuntu Server 22.04 LTS” link under Ubuntu Server. This will open the dialog to save the file. Select the Save file option and then click OK.

The .iso package will be saved in your Downloads folder.

 

Step 2: Open Ubuntu Terminal

Open your Ubuntu command line, the Terminal, either through the Ubuntu Application Launcher search or by using the Ctrl+Alt+T shortcut.

Before writing to your USB stick, ensure that it is not automatically mounted in Ubuntu. Insert the USB into your system, and then execute the following command to retrieve your USB's name.

$ df

Note: The last line in the output of my df command lists the USB that is mounted to my Ubuntu system.

Look for your pendrive in the list of storage devices. It is usually listed as '/dev/sdX' (where 'X' is a letter corresponding to your pendrive, e.g., /dev/sdb, /dev/sdc). Make sure you identify the correct device to avoid accidentally overwriting other drives.

 

Step 3: Unmount the USB if it is mounted

Before proceeding, unmount the pendrive to ensure that no data is being read or written during the process. To unmount, use the following command.

sudo umount /dev/sdX1

For example, I would use the following device name to unmount the USB:

$ sudo umount /dev/sdb1
 
Step 4: Navigate to the Download Directory

By default, the downloaded files are usually saved in the 'Downloads' directory. Change the current directory in the Terminal to the location where the Ubuntu ISO is saved. For example.

cd ~/Downloads

 

Step 5: Create a bootable Ubuntu stick

Now, it's time to make the pendrive bootable using the 'dd' command. Replace 'ubuntu.iso' with the name of the downloaded ISO file, and 'X' with the letter of your pendrive.

$ sudo dd bs=4M if=/path/to/ISOfile of=/dev/sdx status=progress oflag=sync

For example:

$ sudo dd bs=4M if=/home/hp/Downloads/ubuntu-22.04.2-live-server-amd64.iso of=/dev/sdb1 status=progress oflag=sync

Be extremely cautious while running the 'dd' command, as it can overwrite data on your hard drive if the wrong device is specified.

 

Step 6: Wait for the Process to Complete

The creation process may take some time, depending on the size of the ISO file and the speed of your pendrive. Be patient and wait for the Terminal to display a message indicating the completion of the process.

 

Step 7: Eject the Pendrive

Once the process is complete, eject the pendrive safely using the following command.

sudo eject /dev/sdX

Congratulations! Your bootable Ubuntu pendrive is now ready to use. You can now use it to install Ubuntu on other systems or boot into a live Ubuntu environment whenever needed.

 


You might also like:

techsolutionstuff

Techsolutionstuff | The Complete Guide

I'm a software engineer and the founder of techsolutionstuff.com. Hailing from India, I craft articles, tutorials, tricks, and tips to aid developers. Explore Laravel, PHP, MySQL, jQuery, Bootstrap, Node.js, Vue.js, and AngularJS in our tech stack.

RECOMMENDED POSTS

FEATURE POSTS