Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save testillano/905a72fc2ae090ce7a502d5a49b2b96e to your computer and use it in GitHub Desktop.
Save testillano/905a72fc2ae090ce7a502d5a49b2b96e to your computer and use it in GitHub Desktop.
Make bootable USB from ISO
#!/bin/bash
USB=/dev/sdb # check with lsblk
USBDISK=${USB}1
ISO=~/Downloads/image.iso # ISO file
# Cleanup & format
sudo dd if=/dev/zero of=${USB} bs=1M count=10
sudo parted ${USB} mklabel gpt
sudo parted -a optimal ${USB} mkpart primary fat32 0% 100%
sudo umount ${USBDISK}
sudo mkfs.vfat -F 32 -n "BootableUSB" ${USBDISK}
# Copy ISO file
sudo dd if=${ISO} of=${USB} bs=4M status=progress && sync
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment