How To Create A Bootable USB Stick From Linux Command Line

What can be done using graphical tools in Linux can also be accomplished directly using the Terminal / Linux command line if needed. (Here is a primer on using basic Linux commands).

To make a bootable USB disk directly from the command line :

First, get the device listing of USB stick which needs to be made bootable by using lsblk :

list block devices in Linux using lsblk and unmount

The device name (in this example – /dev/sdc) can be figured out using the SIZE column. Next, unmount it using umount :

sudo umount /devicepath

Finally, use the handy dd command. This command is used to convert and copy files and can be used to make bootable drives with ISOs. The format for dd is as follows :

sudo dd bs=4M if=pathofsourceiso of=pathofusbdrivetobemadebootable conv=fdatasync

The if and of parameters are for input files and output files, bs is to specify how many bytes to write at a time (4M will be ok) and conv=fdatasync is to physically write to the output device before the process is complete.

 

using the dd command to write to a usb stick and make it bootable

 

Running this command can take a while depending on the size of input ISO to be written. Once done, the USB stick can be removed and used to boot up or install other distros.

All done.

Leave a Comment