How to Write an ISO File to a USB Drive using DD Command

dd iso to usb

If you’ve ever needed to create a bootable USB drive for a new operating system or to install software on a computer without an optical drive, you may have heard of the dd command. This is a powerful command-line tool that allows you to write an ISO file to a USB drive. In this article, we’ll take a closer look at how to use the dd command to write an ISO file to a USB drive on Linux.

Prerequisites

Before you can start writing an ISO file to a USB drive, you’ll need to make sure you have the following:

  • A USB drive with enough space to hold the contents of the ISO file.
  • An ISO file containing the operating system or software you want to install.
  • A Linux machine with the dd command installed.

Writing an ISO File to a USB Drive

To write an ISO file to a USB drive using the dd command, follow these steps:

  1. Insert the USB drive into your Linux machine.
  2. Open a terminal window and type the following command to find the device name of the USB drive:
$ sudo fdisk -l

This will display a list of all the storage devices connected to your Linux machine. Look for the entry that corresponds to your USB drive. It will be something like /dev/sdb or /dev/sdc.

  1. Unmount the USB drive by typing the following command:
$ sudo umount /dev/sdb1

Make sure to replace /dev/sdb1 with the device name of your USB drive.

  1. Write the ISO file to the USB drive by typing the following command:
$ sudo dd bs=4M if=/path/to/iso/file of=/dev/sdb status=progress && sync

Make sure to replace /path/to/iso/file with the path to your ISO file and /dev/sdb with the device name of your USB drive.

The dd command will start writing the ISO file to the USB drive. This may take some time depending on the size of the ISO file and the speed of your USB drive.

  1. Once the dd command has finished writing the ISO file to the USB drive, you can eject the USB drive by typing the following command:
$ sudo eject /dev/sdb

Understanding the DD Command

The dd command is a powerful tool that can be used for a variety of disk-related tasks. It stands for “data duplicator” and is often used for copying and converting data between disks, partitions, and files.

Here’s a breakdown of the different parts of the dd command we used to write an ISO file to a USB drive:

  • bs=4M: This sets the block size to 4 megabytes. This can help improve the speed of the write operation.
  • if=/path/to/iso/file: This specifies the input file, which in this case is the ISO file we want to write to the USB drive.
  • of=/dev/sdb: This specifies the output file, which in this case is the USB drive we want to write the ISO file to.
  • status=progress: This displays the progress of the write operation in real-time.
  • sync: This ensures that all data has been written to the USB drive before the command completes.

Conclusion

In this article, we’ve covered how to use the dd command to write an ISO file to a USB drive on Linux. This can be a useful skill to have if you need to create a bootable USB drive for a new operating system or install software on a computer without an optical drive. Remember to always double-check the device names and paths before running the dd command to avoid data loss.