BootISO: Creating a bootable USB device from the ISO file | Linux China

640?wx_fmt=jpeg Today we will discuss the utility called BootISO of similar tools. It is a simple bash script that allows users to create a bootable USB device from the ISO file. - Prakash Subramanian

In order to install the operating system, most of us (including me) often create a bootable USB device from the ISO file. To achieve this, there are many free applications available in Linux. Even in the past we wrote a few utility introduction of this article.

Everyone uses different applications, each application have their own characteristics and functions. In these applications, some applications are in CLI program, some applications are the GUI.

Today we will discuss the utility called BootISO of similar tools. It is a simple bash script that allows users to create a bootable USB device from the ISO file.

Many Linux administrators  dd command to open create a bootable ISO, it is a well-known native method, but at the same time, it is also a very dangerous command. Therefore, be careful when you use  dd the time to perform some action command.

Suggested Reading:

◈  Etcher: create a bootable USB drive from an ISO image in a simple way the SD card & ◈  to create a bootable USB drive from an ISO mirror dd command on Linux

What is BootISO

BootISO  is a simple bash script that allows users to securely create a bootable USB device from an ISO file, which is written in bash.

It does not provide any graphical user interface but offers a number of options, allowing beginners to Linux smoothly up to create a bootable USB device. Because it is an intelligent tool that can automatically select the USB devices connected to the system.

When the system has multiple USB devices are connected, it will print out the list. When you manually select another hard disk instead of USB, in this case, it will exit safely, and does not write anything on the hard disk.

This script will check the dependencies and prompts the user to install, it works with all package manager, such as apt-get, yum, dnf, pacman and zypper.

BootISO function

◈ check whether it is the right choice of ISO mime type. If not, then quit. ◈ If you select any other disk other than the USB device (local hard disk), BootISO will automatically exit. ◈ When you have multiple drives, BootISO allows users to select the USB drive you want to use. ◈ before erasing the partition and USB devices, BootISO will prompt the user for confirmation. ◈ BootISO will properly handle any errors from a command, and exits. ◈ BootISO quit when they encounter problems will call a cleanup routine.

How to install BootISO in Linux

There are several methods available to install BootISO in Linux, but I recommend that you use the following method to install.

 
  
  1. $ curl -L https://git.io/bootiso -O
  2. $ chmod +x bootiso
  3. $ sudo mv bootiso /usr/local/bin/

Once BootISO has been installed, run the following command to list the available USB devices.

 
  
  1. $ bootiso -l
  2. Listing USB drives available in your system:
  3. NAME HOTPLUG SIZE STATE TYPE
  4. sdd 1 32G running disk

If you only have a USB device, simply run the following command to create a bootable USB device from an ISO file.

 
  
  1. $ bootiso /path/to/iso file
 
  
  1. $ bootiso /opt/iso_images/archlinux-2018.05.01-x86_64.iso
  2. Granting root privileges for bootiso.
  3. Listing USB drives available in your system:
  4. NAME HOTPLUG SIZE STATE TYPE
  5. sdd 1 32G running disk
  6. Autoselecting `sdd' (only USB device candidate)
  7. The selected device `/dev/sdd' is connected through USB.
  8. Created ISO mount point at `/tmp/iso.vXo'
  9. `bootiso' is about to wipe out the content of device `/dev/sdd'.
  10. Are you sure you want to proceed? (y/n)>y
  11. Erasing contents of /dev/sdd...
  12. Creating FAT32 partition on `/dev/sdd1'...
  13. Created USB device mount point at `/tmp/usb.0j5'
  14. Copying files from ISO to USB device with `rsync'
  15. Synchronizing writes on device `/dev/sdd'
  16. `bootiso' took 250 seconds to write ISO to USB device with `rsync' method.
  17. ISO succesfully unmounted.
  18. USB device succesfully unmounted.
  19. USB device succesfully ejected.
  20. You can safely remove it !

When you have multiple USB devices, you can use the  --device option to specify the name of your device.

 
  
  1. $ bootiso -d /dev/sde /opt/iso_images/archlinux-2018.05.01-x86_64.iso

By default, BootISO use the  rsync command to execute all of the action, if you want to use the  dd command replace it, use the following format.

 
  
  1. $ bootiso --dd -d /dev/sde /opt/iso_images/archlinux-2018.05.01-x86_64.iso

If you want to skip the mime type checking, BootISO utility with the following options.

 
  
  1. $ bootiso --no-mime-check -d /dev/sde /opt/iso_images/archlinux-2018.05.01-x86_64.iso

Add the following option to skip the confirmation BootISO in front of the user to erase and partition the USB device.

 
  
  1. $ bootiso -y -d /dev/sde /opt/iso_images/archlinux-2018.05.01-x86_64.iso

Together  -y with the option to enable automatic selection of USB devices.

 
  
  1. $ bootiso -y -a /opt/iso_images/archlinux-2018.05.01-x86_64.iso

To know more BootISO options, run the following command.

 
  
  1. $ bootiso -h
  2. Create a bootable USB from any ISO securely.
  3. Usage: bootiso [...]
  4. Options
  5. -h, --help, help Display this help message and exit.
  6. -v, --version Display version and exit.
  7. -d, --device Select block file as USB device.
  8. If is not connected through USB, `bootiso' will fail and exit.
  9. Device block files are usually situated in /dev/sXX or /dev/hXX.
  10. You will be prompted to select a device if you don't use this option.
  11. -b, --bootloader Install a bootloader with syslinux (safe mode) for non-hybrid ISOs. Does not work with `--dd' option.
  12. -y, --assume-yes `bootiso' won't prompt the user for confirmation before erasing and partitioning USB device.
  13. Use at your own risks.
  14. -a, --autoselect Enable autoselecting USB devices in conjunction with -y option.
  15. Autoselect will automatically select a USB drive device if there is exactly one connected to the system.
  16. Enabled by default when neither -d nor --no-usb-check options are given.
  17. -J, --no-eject Do not eject device after unmounting.
  18. -l, --list-usb-drives List available USB drives.
  19. -M, --no-mime-check `bootiso' won't assert that selected ISO file has the right mime-type.
  20. -s, --strict-mime-check Disallow loose application/octet-stream mime type in ISO file.
  21. -- POSIX end of options.
  22. --dd Use `dd' utility instead of mounting + `rsync'.
  23. Does not allow bootloader installation with syslinux.
  24. --no-usb-check `bootiso' won't assert that selected device is a USB (connected through USB bus).
  25. Use at your own risks.
  26. Readme
  27. Bootiso v2.5.2.
  28. Author: Jules Samuel Randolph
  29. Bugs and new features: https://github.com/jsamr/bootiso/issues
  30. If you like bootiso, please help the community by making it visible:
  31. * star the project at https://github.com/jsamr/bootiso
  32. * upvote those SE post: https://goo.gl/BNRmvm https://goo.gl/YDBvFe

via: https://www.2daygeek.com/bootiso-a-simple-bash-script-to-securely-create-a-bootable-usb-device-in-linux-from-iso-file/

Author: Prakash Subramanian  topics: lujun9972  Translator: robsean  proofread: wxy

This article from the  LCTT  original compiler, Linux China  is proud

640?wx_fmt=jpeg


Guess you like

Origin blog.csdn.net/F8qG7f9YD02Pe/article/details/92457354