Created
May 19, 2025 13:13
-
-
Save testillano/905a72fc2ae090ce7a502d5a49b2b96e to your computer and use it in GitHub Desktop.
Make bootable USB from ISO
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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