Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
How to create a Bootable USB from ISO in Linux?
To create a bootable USB drive from an ISO file in Linux, we find it useful when installing a new operating system or running a live environment without affecting the existing system. It's also an excellent option when the computer lacks a CD/DVD drive, as USB drives are more common and easier to use.
The process involves identifying the USB device, obtaining the ISO file, and using command-line tools like dd to write the ISO directly to the USB drive. This creates a bit-for-bit copy that makes the USB drive bootable.
Step-by-Step Process
Step 1 Insert Your USB Drive
Insert the USB drive into the computer's USB port, ensuring it's pushed in until it clicks into place. Important: Back up any data on the drive, as this process will erase all existing content. The USB drive should be at least as large as the ISO file size.
Step 2 Find the Device Name
After inserting the USB drive, you need to identify its device name. In Linux, all devices are represented as files in the /dev directory. Open a terminal and use the lsblk command to list all connected block devices.
lsblk
The output will show all storage devices
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 232.9G 0 disk ??sda1 8:1 0 487M 0 part /boot ??sda2 8:2 0 46.6G 0 part / ??sda3 8:3 0 185.7G 0 part /home sdb 8:16 1 7.4G 0 disk ??sdb1 8:17 1 7.4G 0 part /media/usb0
The USB drive typically appears as sdb, sdc, or similar. Note the device name (e.g., /dev/sdb) for later use.
Step 3 Download the ISO File
Download the ISO file for your desired Linux distribution from the official website. After downloading, verify the file's integrity using a checksum utility like md5sum or sha256sum to ensure it wasn't corrupted during the download process.
Step 4 Unmount the USB Drive (if mounted)
If the USB drive is automatically mounted, unmount it first to prevent conflicts during the writing process
sudo umount /dev/sdb1
Step 5 Write ISO to USB Drive
Use the dd command to write the ISO file directly to the USB drive. This creates a bootable USB by copying the ISO bit-for-bit
sudo dd if=/path/to/iso/file.iso of=/dev/sdb bs=4M status=progress && sync
Replace /path/to/iso/file.iso with your actual ISO path and /dev/sdb with your USB device name.
1096476672 bytes (1.1 GB, 1.0 GiB) copied, 47 s, 23.3 MB/s 261+1 records in 261+1 records out 1099512672 bytes (1.1 GB, 1.0 GiB) copied, 48.7658 s, 22.5 MB/s
The status=progress option shows transfer progress, and sync ensures all data is written before the command completes.
Step 6 Safely Remove the USB Drive
Once copying is complete, safely eject the USB drive to ensure all data has been written properly
sudo eject /dev/sdb
eject: /dev/sdb ejected
Alternative Methods
For users preferring graphical tools, applications like Balena Etcher, UNetbootin, or the built-in Startup Disk Creator (Ubuntu) provide user-friendly interfaces for creating bootable USB drives.
Important Safety Tips
Double-check device names Using the wrong device can overwrite your hard drive
Backup important data The USB drive will be completely erased
Use appropriate permissions The
ddcommand requires root privilegesVerify ISO integrity Always check checksums before writing
Conclusion
Creating a bootable USB drive from an ISO file in Linux is a straightforward process using the dd command. The key steps are identifying the correct USB device, downloading and verifying the ISO file, and carefully writing the ISO to the USB drive. This method creates a reliable bootable drive for installing operating systems or running live environments.
