bootiso: Easy ISO To Bootable USB Drive From The Command Line

If you're looking for a command line tool that is able to create a bootable USB drive from both hybrid and non-hybrid ISO images (it should work with any Linux distribution ISO as well as Microsoft Windows ISO files), with some safety checks in place, you may want to give Bootiso a try.


Bootiso ISO to bootable usb drive


bootiso is a Bash script to "securely create a bootable USB device from one ISO file", useful if you don't want to use dd directly, or for cases in which dd alone is not enough (like creating a bootable Windows USB drive). It performs the following checks to make sure it doesn't do any damage to the system and that the resulting bootable USB drive functions properly:

  • A confirmation prompt is displayed before erasing and partitioning USB devices
  • Inspects the ISO file and choose the best copy mode
  • Checks if the ISO has the correct mime-type and exists if it doesn't
  • Makes sure the device you select is actually connected via USB and exits if it's not, preventing any possible system damages
  • Checks if the selected item is a partition and exits if it is
  • Handles external command failures
  • The script itself is linted and validated with shellcheck and formatted with shfmt to ensure code quality

Related: Create Bootable USB Drives From Windows With Rufus

The tool comes with various feature that try to help the user, like displaying a list of USB devices (if there are more than one) before writing the ISO to the USB drive, set the partition label, and more. bootiso also checks for any missing dependencies required and prompts the user to install them using apt-get, yum, dnf, pacman, zypper, or emerge, depending on the used Linux distribution.

bootiso was updated a couple of days ago with a new automatic mode which makes it even easier to create bootable USB drives from ISO files - just plug in the USB flash drive, run bootiso and wait for the bootable USB drive creation to be ready.

This is the new default mode and using it, bootiso chooses the appropriate copy mode only after inspecting the ISO file, so it should be reliable for most use cases. There's no need to specify an USB drive or anything else because bootiso does everything for you. If there are multiple USB flash drives attached, it will ask you to choose one. The tool continues to offer a multitude of options for advanced uses though.

This release also brings a new inspect (-i, --inspect; used to inspect the ISO file boot capabilities and how bootiso can handle it) and probe (-p, --probe; equivalent to the new --inspect feature, but followed by the --list-usb-drives action) actions, as well as a USB stick quick format option which allows specifying the label and filesystem type (vfat, exfat, ntfs, ext2, ext3, ext4 or f2fs) when formatting it.

How to create a bootable USB drive from ISO with bootiso


For most users, running bootiso with the default values should be enough to create a working bootable USB drive. So just plug in an USB flash drive, and run bootiso pointing to the ISO file from which you want to create a bootable USB drive from:

./bootiso /path/to/some/OperatingSystem.iso

This command assumes the bootiso script is in your home folder. You need to replace /path/to/some/OperatingSystem.iso with the exact path and name of the ISO you want to write on the USB stick. For example, this could be ~/Downloads/ubuntu-16.04.4-desktop-amd64.iso, ~/Stuff/Win10_1803_English_x64.iso or whatever ISO / path you may have. The ISO can be either a Linux distribution or a Microsoft Windows version (Windows 7, Windows 8 / 8.1 and Windows 10 should all work).

The command doesn't specify a USB drive because bootiso will ask you to select one if more than one USB sticks are connected to your computer.

Enter y and then press the Enter key when asked if you want to proceed. Make sure you do not interrupt the bootable USB drive generation / copy process!

There are quite a few options that you can specify when making a bootable USB drive from either Linux or Windows ISO files, but I won't get into that here. See the bootiso page for advanced usage.

How to format an USB drive using bootiso


Once you're done with an USB stick and you no longer need to use it as a bootable USB, you can format it to vfat, exfat, ntfs, ext2, ext3, ext4, or f2fs using bootiso.

To format an USB flash drive, use this command:

./bootiso --format

This will assign a default label and format it to vfat (FAT32).

You can specify the filesystem type and label if you wish:

./bootiso --format --type <TYPE> --label <LABEL>

Where <TYPE> is one of the following: vfat, exfat, ntfs, ext2, ext3, ext4 or f2fs. Replace <LABEL> with the label (name) you want to assign to the USB stick partition.

Download bootiso




4 comments:

  1. How would one create a bootable Windows 10 USB from ISO?

    By default, "bootiso" bash script uses vfat fs, and -f -t ntfs only available for formatting.

    Thanks.

    ReplyDelete
    Replies
    1. # check the USB name

      sudo bash /utl/bootiso -l

      # confirm [install-mount-rsync] feasibility with win 10 iso

      sudo bash /utl/bootiso --inspect /iso/Win10_1809Oct_English_x64.iso

      # create ntfs bootable USB at sdc drive with win 10 from iso

      sudo bash /utl/bootiso --mrsync -d sdc -t ntfs -y /iso/Win10_1809Oct_English_x64.iso

      # success

      Delete
    2. During [Win 10 build 1809] booting attempt with the USB stick created above, received the following error:

      "No device drivers were found. Make sure that the installation media contains the correct drivers, then click OK."

      +++

      Rescan doesn't help
      Attempted to select almost any/every folder from the USB

      BIOS iterations

      Secure boot is off
      Compatibility Support Module (CSM) turned off

      none of the above actions helped

      Delete
    3. Copied the above iso to a standalone Win7 machine.

      Created bootable USB with rufus 3.3.1400

      Booted on the same target machine with the same BIOS settings as described above.

      Win10 setup successfully installed.

      PS Win10 installed only for professional interests to test bootiso. Will be replaced with Debian 9.6 Stretch.

      PPS Bootiso created Qubes 4.0 bootable USB and installed on the same target machine without any issues.

      Delete