A simple Bash script for writing Linux ISO files to a USB drive using dd.
- Automatically detects connected USB drives
- If multiple drives are found, prompts the user to select one
- Checks that the USB drive is large enough to fit the ISO
- Automatically unmounts any mounted partitions on the target drive
- Displays write progress in real time
- Linux
bash,dd,lsblk(included in most distributions)- Root privileges
git clone https://github.com/yourusername/iso2usb.git
cd iso2usb
chmod +x iso2usbOptionally, install it system-wide:
sudo cp iso2usb /usr/local/bin/sudo ./iso2usb <iso-file>Example:
sudo ./iso2usb ubuntu-24.04-desktop-amd64.iso- Linux ISO files only. Windows ISOs are not supported – use Ventoy or WoeUSB for those.
- All data on the selected USB drive will be permanently erased.
- You must type
YES(uppercase) to confirm before anything is written.
MIT