A Bash Script to Create a Bootable USB from ISO in Linux

Best Affordable Linux and WordPress Services For Your Business
Outsource Your Linux and WordPress Project and Get it Promptly Completed Remotely and Delivered Online.

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Aaron Kili

Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

15 Responses

  1. isnurmi says:

    You never mention numerous dependencies that bootiso in fact requires and which are the pain in the neck to provide. It would be nice to check for them on the user side and point to where they can be obtained ( and installed !)

  2. newdev4ios says:

    Can I make the script format the usb to ntfs while installing the iso?

    I’ve tried:

    bootiso [-f -t ntfs] isofile.iso — still does fat32
    bootiso [-f] [-t] [ntfs] isofile.iso — still does fat32
    bootiso -f [-t ntfs] isofile.iso — fail saying format action doesn’t require any arguments
    bootiso -f -t ntfs — formats to iso but doesn’t install iso
    bootiso isofile.iso — formats fat32 –if you can direct me to where it defaults to the fat32 so i can change the default to ntfs instead of fat32 that would also work for me
    bootiso [-t] [ntfs] isofile.iso — fail: bash: -f: No such file or directory

    Can’t seem to get the script to create an ntfs formatted bootable usb drive.

  3. Jules Samuel Randolph says:

    Version 3 is out [with many improvements :-) https://github.com/jsamr/bootiso/releases/tag/v3.0.0

    Notably, it now inspects ISO file to check if it’s hybrid. When it’s not, it looks for UEFI and SYSLINUX boot capabilities. After which, it chooses the best install mode (dd or mount+rsync) and eventually installs SYSLINUX.

    So you basically don’t need to care anymore about rsync or dd mode, just run `bootiso myfile.iso’ and it will work, even with rescue CDs such as UltimateBootCD.

  4. Pim Dennendal says:

    Surely you should put it in /sbin, /usr/sbin, etc. If it is root only, it should be there.

  5. ivank2139 says:

    Very well done and professional. I used dd before but this will make it a little more bulletproof.

  6. Herald says:

    Why not to use dd?

    # dd if=/dev/sdb of=yourimage.iso bs=1m

    You don’t need install and setting any other app, dd is out of box.

    • Aaron Kili says:


      The main aim of this script is to provide a secure way of creating bootable devices, which you can not achieve by running this dd command only. Using this dd command, you can accidentally provide your root partition or any other important partition output device, which can lead to data loss; in simple terms the dd command only, can not check that your output device is a USB or not.

      Secondly, using dd command, you will not be prompted before formating of the output device, which may also lead to data loss in case you have not backed up data on that device. This script is a much better option because it securely prepares your USB device before moving files on it, and any internal errors are reported.

    • Jules Samuel Randolph says:

      As a side note, dd only works for hybrid ISO’s. bootiso works with any ISO, given the “-b” option to install a syslinux bootloader.

      • Aaron Kili says:


        This actually sheds more light on why bootiso is far much better a option than using dd only for making a bootable USB from the command-line. Thanks for the addition.

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.