Need to write an ISO file to an USB drive? Making a bootable USB drive of your favorite operating system is very easy. The command line ‘dd’ tool can do that for you, writing a image ISO file to an USB drive with minimal effort.
Usually, we create bootable USB drives and install Linux and other operating systems. Of course there are many GUI applications to make bootable ISO are available such as Unetbootin, balenaEtcher, etc.
But there is an easy command line way too. There is no need for the above applications. We can make bootable ISO, for any operating system, by using dd tool in Linux. Most Linux distributions has preinstalled dd tool.
dd is very powerful tool. dd stands for Data Duplicator which is make copy using block by block from one device into another device. So we can also use dd tool for data backup and restore from one device into another device.
Create bootable USB drive using dd command
This assumes you already have an ISO file that you want to move to an external “thumb drive” type of USB storage volume.
First connect the USB drive and unmount it, assuming you know its designation, with something like the following:
$ umount /dev/sdb*
This assumes that your USB drive is showing up as /dev/sdb. If you have multiple hard drives already connected to your machine, the drive that you’d like to target might be something like /dev/sdc or /dev/sdd or /dev/sde… you get the picture.
We can have a look at the partitions and file systems on the system with this command:
$ sudo lsblk
After then confirming which is your target drive, and unmounting it, we need to format the unmounted drive. Let’s do this formatting with:
$ sudo mkfs.vfat /dev/sdb
Now we’re all ready to copy the ISO file to the USB drive using the dd command.
I’d recommend navigating to the directory where you downloaded the ISO. For this example, let’s say you put the ISO in your user’s /home/Downloads directory.
$ cd ~/Downloads
Since, we’re already in the right directory, we can use:
$ sudo dd if=name-of-iso.iso of=/dev/sdb status=progress
Where “name-of-iso.iso” is of course replaced by the actual name of your ISO file.
- If stands for input file. It is used to specify the location of the ISO file.
- Of stands for output file. It specifies where to write the ISO file. In our case, it’s /dev/sdb
This may take several minutes to execute. You should see something like these results returned:
1123148+0 records in 1123148+0 records out 586947776 bytes (587 MB, 559 MiB) copied, 121.304 s, 5.2 MB/s
That’s all. You can use the same procedure to make any OS to make bootable USB drive.