How to Create a Bootable USB from ISO in Ubuntu Terminal

How to Create a Bootable USB from ISO in Ubuntu Terminal

Preparing to install Ubuntu starts with putting its installer on a USB drive. Creating a bootable USB from Ubuntu Terminal writes the ISO image’s boot data and filesystem layout to the drive.

This article walks through verifying the ISO checksum and identifying the USB device before writing the image with dd.

TL;DR

Prepare a verified Ubuntu ISO, identify the USB by its model and capacity, unmount its mounted partitions, then write it with dd.

  • Confirm the ISO checksum against Ubuntu’s published value.
  • Identify the USB by its model and capacity, then check its partition paths.
  • Back up the USB first because the write replaces its existing contents.

What Is a Bootable USB Image?

A bootable USB starts an installer or live system from an operating-system image. An Ubuntu ISO carries the boot data and filesystem layout, so this method writes the image to USB instead of copying the ISO as a regular file.

Choose the terminal method for a headless machine because it runs without a desktop session. Ubuntu’s USB guide also documents Startup Disk Creator for a graphical workflow.

TermMeaningExample
ISOFile containing the Ubuntu image data/path/to/ubuntu.iso
DiskWhole removable drive/dev/sdb
PartitionOne section of a disk/dev/sdb1

How to Create a Bootable USB from Ubuntu Terminal

Prepare the ISO and USB first, validate both identities, and then run the write.

  • An Ubuntu ISO downloaded from Ubuntu’s download page.
  • A USB drive with enough capacity for the ISO.
  • A terminal account able to run administrative commands with sudo. If you lack permission, ask an administrator to prepare the media.

Keep the downloaded ISO in a known directory so the command can use its full path. Have its filename available when checking the checksum list.

Step 1: Download and verify the Ubuntu ISO

Choose the Ubuntu Desktop or Server ISO and architecture for the intended installation, then note its location. Consult the computer’s system specifications if its architecture is unclear.

The example uses ~/Downloads as a common folder. Replace it with the directory where the ISO is saved. Put quotation marks around a path that contains spaces so the shell treats it as one filename.

sha256sum ~/Downloads/ubuntu.iso

Run sha256sum on the ISO path and compare its digest and filename with SHA256SUMS for the same release and architecture. If the digest differs, download the ISO again. Ubuntu’s verification instructions explain how to check the list’s signature.

The LinuxForDevices wget guide explains how to download files from a terminal when you prefer that over a browser.

Step 2: Identify the whole USB device

Connect the USB, then run lsblk to display device names, sizes, models, transport, type and mount points.

lsblk -o NAME,SIZE,MODEL,TRAN,TYPE,MOUNTPOINTS
ColumnWhat to check
NAMEDevice name to use when forming a path under /dev
SIZECompare listed capacity with the USB drive
MODELHardware model, when the device reports it
TRANConnection-type hint that some adapters omit
TYPEWhether the row represents a disk or partition
MOUNTPOINTSDirectories where filesystems from the device are mounted. A blank value means none is listed.

Match the listed model and capacity to the physical USB, using remaining fields when MODEL or TRAN is blank. If several rows could match, disconnect other removable drives and run lsblk again.

The TRAN field can be blank when an adapter does not report its connection type. The LinuxForDevices dd command guide explains its arguments.

Step 3: Unmount the USB partitions

Check MOUNTPOINTS for mounted partitions under the selected USB.

sudo umount /dev/sdX1

Use the device path shown under NAME for each mounted partition. MOUNTPOINTS shows the directory where each one is mounted. Run umount once for each listed partition and skip it when none appear.

If umount reports that the USB is busy, close file browsers, terminals, or copy operations using its files and retry. If it remains busy, stop and recheck the selected device and mount points instead of targeting another path.

Step 4: Write the ISO to the USB

dd overwrites the selected USB’s existing contents. Back up any files you need, then check both paths against your notes before running the command.

sudo dd if=/path/to/ubuntu.iso of=/dev/sdX bs=4M status=progress conv=fsync

Replace the placeholders with the downloaded ISO and confirmed USB paths from your notes.

If a file path contains spaces, quote the complete path so the shell treats it as one argument. Keep the placeholder names out of the final command.

The command needs administrative permission because it writes directly to a block device. sudo may prompt for your account password, and the terminal does not echo it while you type. Check each option against its purpose before running it:

OptionPurpose
if=Input file path that dd reads, the Ubuntu ISO
of=Output path where dd writes to the selected USB disk
bs=4MSpecifies a 4 MiB block for each read and write
status=progressShow transfer activity while dd runs
conv=fsyncSynchronize output data before dd exits

Read the ISO and USB paths back from your notes before pressing Enter. dd does not ask you to confirm the destination.

Keep the ISO at its current path until the command completes. If the source file is moved during the copy, dd can no longer read it.

Step 5: Flush writes and remove the drive

After dd returns successfully, run sync to flush pending writes before removing the drive.

sync

With no device argument, sync requests pending writes across mounted filesystems. Wait for the shell prompt before using the desktop’s safe-eject action.

If dd returns an error, sync does not repair a partial image. Resolve the source or device problem, then recheck both paths before another attempt.

A hybrid image can present partitions differently from the USB’s previous filesystems, so cancel any desktop prompt to format the drive.

Common Ubuntu USB Boot Problems

The checks below cover source and device errors, plus boot selection.

The firmware menu starts the USB only after you select its entry. A completed copy does not change the computer’s boot order.

Confirm dd returned without an error and sync finished before restarting. Select the USB entry from the one-time boot menu for the computer’s configured UEFI or legacy mode. The menu key varies by computer, so consult its manual.

SymptomCheckNext action
ISO file is not foundCheck the download folder and filenameCorrect the source path and repeat the checksum step
Checksum values differConfirm the SHA256SUMS entry matches the exact ISODownload the image again before writing
USB does not appear in lsblkReconnect it and inspect the port or adapterRun the listing again before choosing a path
USB capacity is too smallCompare drive capacity with the ISO sizeUse a suitable drive before starting the write
Unmount reports busyClose programs using files on the USBRetry only for the confirmed mounted partition
Permission is deniedConfirm the command uses sudo as shownCheck administrative access before writing
Write reports no space or I/O errorCheck the device identity, capacity, and connectionStop and investigate before another attempt
Old operating system startsCheck whether the one-time boot menu was usedSelect the USB entry for this startup
USB is absent from the boot menuCheck detection and the selected USB portTry another port and consult the computer manual
Desktop asks to format the driveConsider whether the ISO write completedCancel if you want to keep the boot media

If an I/O error appears, stop and re-identify the device before trying again. Check whether the error came from the USB, its connection or the source file.

Conclusion: Start from the USB Boot Menu

Once the firmware starts the USB, follow the Ubuntu installer for the installation you intend. The computer’s manual explains how to open its boot menu and change firmware settings.

Read Ubuntu’s ISO verification guide, its bootable USB instructions, the GNU dd manual and the lsblk manual for the documented command behavior.

FAQ

These answers cover the device and command choices that affect a terminal-based Ubuntu USB write.

Should dd target /dev/sdX or /dev/sdX1?

Use the USB disk path, such as /dev/sdX, after confirming its identity. A path ending in a partition number such as /dev/sdX1 names one partition.

Will creating the bootable USB erase its files?

Yes. Writing an ISO directly to the USB overwrites its existing data and layout. Back up needed files before running dd.

Why should I verify the Ubuntu ISO checksum?

A matching SHA-256 digest confirms the downloaded file matches the expected checksum for that release. The signature check separately confirms the checksum list’s source.

Will dd ask before writing to the USB?

No. dd writes to the selected output path without a confirmation prompt, so check the device first and keep a backup of any files you need.

Does the ISO need to be mounted first?

No. Keep the ISO as a file and use its path as the dd input. This workflow writes the disk image directly to the USB.

Should I format or partition the USB first?

No. The Ubuntu image provides its own boot layout. Back up any files you need before writing it to the device.

Does this process install Ubuntu on the computer?

No. It creates the bootable USB. You must restart and boot from it to start the Ubuntu live session or installer. Installation choices begin after the computer boots from the drive.

Can I use dd for other Linux ISO files?

Only when the image’s publisher documents raw writing as a supported method. Check the distribution’s instructions because media-creation steps can differ.

When can I safely unplug the USB?

Wait for dd to return to the shell, run sync and wait for its prompt, then use the desktop’s safe-eject option. Leave the drive connected while either command is running.