How to Make Bootable USB from ISO using Linux Terminal

Last updated: July 26, 2022

There are many USB creator software available to create a bootable Linux USB Drive. Here I will show you how to create a bootable USB flash from ISO file using the Linux terminal.

Before we start make sure you have downloaded the .ISO file and have a USB flash drive with not less than 4GB capacity.

Make Bootable USB from ISO using Linux Terminal

Follow the steps to make a bootable USB from iso file using the terminal.

Step1: Check USB Drive

Connect the USB flash drive to your machine and check if it's connected successfully. Use lsblk command to list all information about the attached block devices.

$ lsblk

Sample Output:

$ lsblk
 NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
 sdb 8:16 0 10G 0 disk
 └─sdb1 8:17 0 10G 0 part
 sr0 11:0 1 1024M 0 rom
 sdc 8:32 1 14.9G 0 disk
 ├─sdc2 8:34 1 2.3M 0 part
 └─sdc1 8:33 1 1.7G 0 part /media/linoxide/SANDISK
 sda 8:0 0 20G 0 disk
 ├─sda2 8:2 0 1K 0 part
 ├─sda5 8:5 0 1022M 0 part [SWAP]
 ├─sda3 8:3 0 7.9G 0 part
 └─sda1 8:1 0 9G 0 part /

From the list find your USB drive's mounted partition. In our case it's /dev/sdc1. It is mounted by default.

Next, we must unmount the USB flash drive by the following command:

$ umount /dev/sdc1

Make sure to change according to your USB drive and check if it has been unmounted again with lsblk command.

You must see the output without mount point in front of sdc1:

Sample Output:

$ lsblk
 NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
 sdb 8:16 0 10G 0 disk
 └─sdb1 8:17 0 10G 0 part
 sr0 11:0 1 1024M 0 rom
 sdc 8:32 1 14.9G 0 disk
 ├─sdc2 8:34 1 2.3M 0 part
 └─sdc1 8:33 1 1.7G 0 part
 sda 8:0 0 20G 0 disk
 ├─sda2 8:2 0 1K 0 part
 ├─sda5 8:5 0 1022M 0 part [SWAP]
 ├─sda3 8:3 0 7.9G 0 part
 └─sda1 8:1 0 9G 0 part /

Step 2: Download Linux ISO File

Here we will create a Ubuntu bootable flash drive, first go to ubuntu website and download the iso file to your Linux computer. Or you can download iso file from the command line using wget or curl command.

This will download iso file to the current directory.

$ wget http://cdimage.ubuntu.com/focal/daily-live/current/focal-desktop-amd64.iso

or

$ curl -O http://cdimage.ubuntu.com/focal/daily-live/current/focal-desktop-amd64.iso

Step 3: Create Bootable Drive from Terminal

We are going to use dd command to create a bootable USB flash drive.

Be cautious using the dd command of overwriting or deleting your data. Make sure you have backup

Syntax:

$ dd bs=4M if=/path/to/input.iso of=/dev/sd<?> conv=fdatasync

Where /path/to/input.iso is the path where .iso image downloaded. Make sure to change <?> with your USB disk letter accordingly. The point here is to write the disk name itself (e.g. /dev/sdc) and not the partition (e.g. /dev/sdc1 ).

For example:

$ dd bs=4M if=/tmp/ubuntu-20.04.1-desktop-amd64.iso of=/dev/sdc conv=fdatasync

Where bs is read and write BYTES bytes at a time, if is the input file, of is the output file. The conv=fdatasync bit is important as dd can return before the write operation finishes.

By default the progress of the command will not be displayed, to view the progress you can use pv command:

$ dd if=/tmp/ubuntu-18.04-desktop-amd64.iso | pv | sudo dd of=/dev/sdc bs=4M conv=fdatasync

Note: From 8.24 version of GNU Coreutils, dd command has the option to show the progress.

After the process is finished you can use USB as a bootable drive for ubuntu installation or repair.

Conclusion

Using the terminal to create a bootable USB drive is much easier and way faster than with GUI tools. Also, it is very useful to know how to do it in a terminal, because there isn't always a GUI available. The main disadvantage, in this case, is that there is no double-check option for dd. GUI tools help you to identify and select the target drive, and provide a final checkpoint, where you can double-check, that you will be writing to the correct drive.

About The Author

Bobbin Zachariah

Bobbin Zachariah

Bobbin started his career in IT in the year 2000 as a computer science instructor and worked as a Linux system engineer and senior analyst roles. Currently working in DevOps environments to increase efficiency and improve delivery time in AWS Cloud infrastructure. He is certified in RHEL, CCNA, and MCP and holds a Masters's in computer science. When in his free time love playing cricket, blogging, and listening to music.

SHARE

Comments

Please add comments below to provide the author your ideas, appreciation and feedback.

Leave a Reply

Leave a Comment