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 August 2nd, 2020 at 02:08 pm

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 others at the byte or block level. When I said clone, I mean dd command copies the whole partitioning information, filesystem 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, and Windows. 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 a 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 to create a bootable USB drive using this tool in Linux or Unix.

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

What Is apt-fast And Why Should You Use It?

This post was last updated on August 2nd, 2020 at 01:35 pmThe apt-fast is a shell script wrapper for apt-get and aptitude that can drastically improve the downloading speed of

Linux Topics 0 Comments

How to Learn Linux Without Having a Linux Machine?

This post was last updated on November 3rd, 2020 at 05:36 pmWondering how to learn Linux without having a Linux PC with you?? Is it really possible or you’re just

Linux Topics 0 Comments

How to Copy Directory in Linux / Unix

This post was last updated on July 21st, 2020 at 01:10 pmIf you are looking to copy a directory in Linux using a command line, then here I have explained


No Comments Yet!

You can be first to comment this post!

Leave a Reply