Copy bootable ISO-images to a USB drive using dd
There is a variety of
tools to create bootable USB drives. Many
of them come with a graphical user interface, a rich feature set and are convenient to use. You are probably familiar
with UNetbootin or the
Ubuntu Startup Disk Creator. While those programs do a fine job,
not all people are aware that the versatile linux core util dd
is also capable to perform this task.
And sometimes dd
is all you have (and need).
Here is what I usually do when I want to create a bootable USB flash drive:
I use lsblk
to figure out under which device the USB flash drive is known to the system. You can also consult
the kernel output using dmesg
if it’s not that obvious. In any case you should be sure of picking the right target
device, otherwise you might destroy the contents of your system hard drive. For the example we can be pretty sure
that it’s /dev/sdb
.
Execute the dd
command with the necessary parameters. My standard scenario is creating a bootable USB drive of
GParted, a very powerful tool I use to copy, shrink or extend partitions.
When your ISO image is big or the copy process is just slow you might be interested in its progress. You can easily
achieve this by sending the dd
process the USR1
signal. In a separate shell you can find out the pid of your
running dd
process and send it the USR1
signal.
Sending dd
the USR1
signal will make it print the current copy progress on the original shell, e.g.:
After dd
has finished you might want to call sync
, just to make sure that the filesystem cache is flushed to
the USB drive.
That’s it. Your bootable USB drive is ready for being used. By the way, the same procedure is applicable to SD memory cards.