Create a bootable USB drive from the Linux terminal
A bootable USB drive is useful for installing Linux, repairing an unbootable system, testing a live environment, or resetting administrator access. On RHEL, CentOS, Fedora, and related distributions, the terminal provides a dependable method without requiring a graphical imaging utility.
The usual process is straightforward: download an ISO image, verify its checksum, identify the correct USB device, unmount its partitions, and write the image with dd. The final command permanently overwrites the selected drive, so device identification is the most important safety step.
This method works well on a workstation in Sydney, Melbourne, or Brisbane, as well as on a server room bench in Perth or regional Queensland. Australian users should also consider download limits when obtaining a large ISO over a mobile hotspot, particularly with prepaid Telstra or Optus plans; these data-use practices can help avoid an unpleasant bill.
The examples use standard Linux utilities and should be run from an account with sudo access. Replace every example device name with the one shown on your own system, and never assume that /dev/sdb is correct.
Download and verify the ISO image
Download the required distribution image from its official project or mirror. For example, Fedora publishes Workstation and Server ISO files, while Red Hat Enterprise Linux access may require an active subscription. Store the file in a directory with enough free space, such as ~/Downloads.
Verify the image before writing it to removable media. A SHA-256 checksum helps detect an incomplete or altered download:
sha256sum Fedora-Server-dvd-x86_64-*.iso
Compare the output with the checksum published by the distribution. For stronger verification, follow the project’s documented GPG signature process as well. This is especially sensible when preparing installation media for a production server rather than a spare home PC.
Identify the USB device safely
Insert the USB stick, then list block devices before and after insertion:
lsblk -o NAME,SIZE,MODEL,TRAN,MOUNTPOINTS
The TRAN column should show usb, and the size should match the physical drive. A 32 GB stick may appear slightly smaller because manufacturers use decimal capacity, while Linux reports capacity differently. Check the model and mount points carefully; the internal system disk is often /dev/nvme0n1 or /dev/sda.
You can also inspect recent kernel messages:
sudo dmesg --ctime | tail -n 20
If the USB is mounted automatically, note its partitions, such as /dev/sdb1 and /dev/sdb2. The imaging target is the whole disk, /dev/sdb, not an individual partition. Remove other removable drives if the output is unclear.
Unmount partitions and write the image
Unmount every partition belonging to the USB device:
sudo umount /dev/sdb1
sudo umount /dev/sdb2
If a partition does not exist, that message can be ignored. Do not unmount partitions from your internal operating system disk. You may use findmnt or the MOUNTPOINTS output from lsblk to confirm what is currently attached.
Write the ISO to the whole device with dd:
sudo dd if=Fedora-Server-dvd-x86_64.iso of=/dev/sdb \
bs=4M status=progress conv=fsync
The if value is the input ISO, while of is the output device. bs=4M transfers data in larger blocks, status=progress displays activity, and conv=fsync flushes pending writes before the command exits. Check the of path one more time before pressing Enter.
Flush the drive and test the media
When dd finishes, run an explicit flush:
sync
Then remove and reinsert the USB drive, or ask Linux to reread its partition table:
sudo partprobe /dev/sdb
lsblk -f /dev/sdb
A correctly written installer may show several partitions, an ISO9660 filesystem, or an unusual read-only layout. That is normal for many hybrid ISO images. Do not reformat the stick simply because it no longer looks like a conventional storage drive.
Test the media by booting the target computer and opening its firmware boot menu. Common keys include F12, F9, Esc, or Delete, depending on the manufacturer. On a Lenovo in Adelaide or a Dell workstation in Canberra, Secure Boot and the firmware’s USB boot order may affect the result, so select the UEFI entry when one is available.
Resolve common terminal errors
The error “device is busy” usually means a file manager or desktop automounter still has a partition open. Close any file browser windows, run lsblk, and unmount the relevant partitions again. A process working inside the USB can be located with:
sudo fuser -vm /dev/sdb1
A failed download can produce checksum mismatches, while a failing USB can cause I/O errors during writing or booting. Test another port, avoid unpowered hubs, and try a different drive. When network access is unreliable, a traceroute and MTR guide can help distinguish a local connection issue from a remote mirror problem.
Do not treat a successful dd exit message as proof that the computer will boot. Firmware settings, damaged ISO files, unsupported architectures, and faulty memory can all cause later failures. Recheck the checksum and test the USB on another machine where practical.
Use a repeatable preparation checklist
For regular administration work, keep the process consistent rather than relying on memory. These recommendations reduce the chance of destroying the wrong disk:
- Confirm the ISO checksum before writing it.
- Compare the USB model and size with
lsblkoutput. - Unmount USB partitions, but write to the whole device.
- Use
status=progressandconv=fsyncwithdd. - Label or physically separate installer media from backup drives.
Once the image has been written and flushed, boot from the USB and select the required installation or rescue option. After installation, the drive can be returned to normal storage by recreating its partition table, but that also erases the installer. The practical rule is simple: verify the image, verify the device, write carefully, and flush before removing the USB.