How To Use dd command In Linux/Unix To Make USB Bootable?

How To Use dd command In Linux/Unix To Make USB Bootable?


This post was last updated on May 2nd, 2020 at 10:08 am

DD command is used to create a bootable disk from an existing image as it clones data from one disk or partition (or a disk image) to other at the byte or block level. When I said clone, I mean dd command copies the whole partitioning information, file system data, and every bit of information as well, which is not possible to copy using file system copy.

To make a USB bootable generally, we use GUI applications such as Linux Live USB creator and other applications that are available for Linux, FreeBSD, Windows, and other operating systems. A bootable USB is required whenever there is a need for the installation of a new operating system or if we want to run an operating system live. In Unix and Unix-like operating system, dd is a command-line utility that is used to convert and copy files. It is a powerful tool that can be used for various purposes like backing up and restoring a disk, converting data formats, converting the case of a file, etc. The best thing is that it comes preinstalled with many Linux distributions. In this article, we will discuss how we can create a bootable USB drive using this tool.

List The Disks

There are various tools like fdisk, parted, sfdisk, cfdisk, df, etc are available for listing and partitioning of a disk in Linux. You can use any one of them to list and identify your USB drive. We are going to use the parted command as given below-

sudo parted -l

From the above list, /dev/sdb is the USB drive that we are going to make bootable.

parted is another command used to create, delete, and modify partition information. You may have to install the parted command if it is not installed in your system.

Format The USB Drive

Linux system does not allow to format a disk that is already mounted. So before formatting the USB, we will have to unmount it. Use the command that is given below to unmount it-

sudo umount /dev/sdb

Now format the drive with FAT file system by using the given command –

sudo mkfs.vfat /dev/sdb

Similarly to format a drive with NTFS file system you can use the given command –

sudo mkfs.ntfs /dev/sdb

How to Create a Bootable USB using dd command?

Now use the following command to make the USB drive bootable

sudo dd if=~/Desktop/kali-linux-2019.3-amd64.iso of=/dev/sdb

Where, if stand forInput file” which specifies the path of ISO file of an operating system that we are going to install. And of stands for “Output file” which specifies the location where ISO file is to be written.

In our case, the ISO file of the operating system image (Kali Linux) is located on the desktop and it will be written on /dev/sdb which is our pen drive.

Now once you type the above command and press the enter. The process of writing will be started. It does not show the progress of copying the file you should wait until the process is not completed it can take a few minutes to complete it. But we can monitor the progress by using the following method.

How To Monitor Progress?

You can monitor the progress of the copying file by adding the status=progress option to the command that is given above. Use it as given below-

sudo dd if=~/Desktop/kali-linux-2019.3-amd64.iso of=/dev/sdb status=progress

Please note that while creating the USB bootable, the dd tool makes several partitions in it. So it will be best to format it before using it to make another ISO bootable. For other usages of dd tool, you can check its manual page by using the command that is given below-

man dd

Now I hope this article is useful to you. If you have a query or suggestion regarding the topic you can put it in the comments below.

Previous How To Use Telnet In Linux/Unix?
Next How To Use Firewall For Enhancing Network Security In Linux/Unix?

About author

You might also like

Linux Topics 0 Comments

Learn Linux on FREE Online Linux Terminal

This post was last updated on June 3rd, 2020 at 05:20 pmWindows is quite everywhere in consumer applications. But Linux is the way to get many jobs because it is

Linux Topics 0 Comments

How To Use Telnet In Linux/Unix?

Telnet basically stands for “teletype network”. It is an old network protocol that works on the application layer of the OSI model. It connects to a remote system using the

Linux Topics 0 Comments

How to Find Exact Name of A Package by Using apt-cache in Linux?

In a debian based package management system the apt-cache is a low-level tool to manipulate and obtain information about packages from apt’s internal database. It creates a repository of information


No Comments Yet!

You can be first to comment this post!

Leave a Reply