Linux users have traditionally burned ISO files to DVD or CD, but many computers have run out of drives. Creating a bootable USB drive is a better solution – it works on most computers and will boot, run, and install faster.
This is how Linux bootable USB drives work
Like a live CD or DVD, a bootable USB drive lets you run virtually any Linux distribution without affecting your computer. You can also install a Linux distribution on your PC from there – no CD or DVD drive required. However, you cannot just copy or extract the ISO file to the USB drive and expect it to work. While you are not technically “burning” the ISO file to a USB drive, a special process is required to take a Linux ISO file and use it to create a bootable USB drive.
There are two ways to do this: Some Linux distributions include a graphical tool for creating USB startup volumes that does this for you. You can also use the
dd Command to do this from a terminal on any Linux distribution. Whichever method you choose, you will need the Linux distribution’s ISO file.
To the example, Ubuntu Linux has two built-in methods for creating a bootable USB drive. A bootable USB drive gives the user the same experience as an Ubuntu Live DVD. It allows you to try out the popular Unix-like operating system without making any changes to your computer. When you’re ready to install Ubuntu, you can use the USB drive as the installation media.
You will need an Ubuntu installation ISO image to create the bootable USB drive. So make sure you do downloaded the version from Ubuntu You want to use.
To be clear, this bootable USB drive boots into a working copy of Ubuntu Linux, but doesn’t save any changes you made. Every time you boot into Ubuntu from that USB drive, it will be a new instance of Ubuntu. If you want to save changes and data, you need to create a bootable USB drive with persistent storage. It’s a more complicated process.
Simply insert the resulting USB drive into any computer and boot from the USB device. (On some PCs, depending on the Linux distribution you choose, you may also need to disable Secure Boot.)
While we use Ubuntu as a example here it will work similarly with other Linux distributions.
How to graphically create a bootable USB drive
The default installation of Ubuntu includes an application called Startup Disk Creator that we will use to create our bootable USB drive. If you’re using a different Linux distribution, it might contain a similar utility. For more information, see the documentation for your Linux distribution – you can search for it online.
For Windows users, we recommend Rufus for an easy way to create a live USB drive.
warning: This will erase the contents of the destination USB drive. To ensure that you don’t accidentally write to the wrong USB drive, we recommend removing any other attached USB drives before proceeding.
For Ubuntu, any USB drive with a capacity of 4GB or more should be fine. If the Linux ISO of your choice is larger – most are not – you may need a larger USB drive.
Once you are sure that only the correct USB drive is connected to your computer, launch Startup Disk Creator. To do this, press the Superkey (this is the Windows key on most keyboards) and enter “Startup Disk”. The Boot Disk Creator icon appears. Click the icon or press Enter.
The Startup Disk Creator main window appears. The USB device is highlighted in the lower area.
Click the “Other” button. A standard dialog for opening files is displayed. Navigate to the location of your Ubuntu ISO file, highlight it and click the “Open” button.
The main Startup Disk Creator window should now look like the following screenshot. An ISO image should be selected in the upper area and a USB drive in the lower area.
Confirm for yourself that the ISO image and USB drive are correct. Click the “Create a startup disk” button if you are ready to continue.
A warning will appear to remind you that the USB drive will be completely erased. This is your last chance to back up without making any changes to the USB drive. Click the Yes button to create the bootable USB drive.
A progress bar shows you how close The creation process is complete.
A confirmation message will appear informing you when the bootable USB drive creation is complete. On the computer we used for this article, the process took about five minutes.
Click the “Finish” button. You can now either restart your computer and boot from the USB drive or disconnect the USB drive, move it to another computer and boot from there.
How to create a bootable USB drive with dd
The tool we use to create the bootable drive from the command line is this
warning: This command must be used very carefully.
dd will do exactly what you tell him once you say it. There are no “are you sure” questions or retreats.
dd just go ahead and do the instructions you gave him. So we have to be very careful that what we tell him is definitely what we want him to do.
We need to know what device your USB drive is connected to. This way you know exactly which device identity you need to pass on
dd on the command line.
Enter the following command in a terminal window. the
lsblk command lists the block devices on your computer. A block device is assigned to each drive.
The output of
lsblk shows the drives currently connected to your computer. There is an internal hard drive on this computer called the
sda and there is a partition called
Connect your USB drive and use the
lsblk Command again. The output of
lsblk will have changed. The USB drive will now be listed in the output.
There is a new entry in the list with the name
sdb and it has two partitions on it. A partition is called
sdb1 and is 1 KB in size. The other partition is called
sdb5 and is 14.6 GB in size.
This is our USB stick. The identifier we need to use is the one that represents the drive, not one of the partitions. In our example This is
sdb. Regardless of what it’s named on your computer, the device that wasn’t in the previous one
lsblk The listing must be the USB drive.
The order we’re going to give
dd is as follows:
sudo dd bs=4M if=Downloads/ubuntu-19.04-desktop-amd64.iso of=/dev/sdb conv=fdatasync
Let’s break that down.
- sudo: You must be a superuser to issue
ddCommands. You will be asked for your password.
- dd: the name of the command we are using.
- bs = 4M: The
-bsThe (blocksize) option defines the size of each chunk that is read from the input file and written to the output device. 4MB is a good choice because it offers decent throughput and is an exact multiple of 4KB, which is the block size of the ext4 filesystem. This gives an efficient read and write rate.
- if = Downloads / ubuntu-19.04-desktop-amd64.iso: The
-if(Input file) requires the path and name of the Linux ISO image you are using as the input file.
- of = / dev / sdb: The
-of(Output file) is the critical parameter. This must be provided with the device that represents your USB drive. This is the value we are using the
lsblkCommand before. in our example it is
sdbso we use
/dev/sdb. Your USB drive may have a different identifier. Make sure you provide the correct ID.
- conv = fdatasync: The
convParameter determines how
ddconverts the input file as it is being written to the output device.
dduses kernel disk caching when writing to the USB drive. the
fdatasync-Modifiers ensure that the write buffers are correctly and completely emptied before the creation process is marked as finished.
There is no visual feedback from
dd at all, while the progress of creation is taking place. It goes to work and doesn’t report anything until it’s done.
To update: In newer versions
dd now has one
status=progress Option that provides updates to the process once a second. To the example, you can run this command instead to see the status:
sudo dd bs=4M if=Downloads/ubuntu-19.04-desktop-amd64.iso of=/dev/sdb conv=fdatasync status=progress
When the bootable USB drive is created
dd reports the amount of data written to the USB drive, the elapsed time in seconds, and the average data transfer rate.
You can verify that the bootable USB drive is working by restarting your computer and booting from the USB drive, or you can try booting from another computer.
You now have a portable working copy of Ubuntu or another Linux distribution of your choice. It will be pristine every time you boot it, and you can boot it on virtually any PC you like.