============================================
Creating bootable USB disks from ISO images
============================================

Booting from a USB disk is the most common way of provisioning bonders
and bare-metal aggregators. The instructions below explain how to make a
bootable USB disk on Windows, MacOS and Linux.

Etcher
-------

A free, open-source option for creating bootable USB disks on Windows, MacOS and
Linux is balenaEtcher: https://www.balena.io/etcher/

Linux CLI
----------

To write a USB disk on Linux, use the ``dd`` command included in your
distribution.

Plug in your USB disk. Then use either your distribution's method of
showing the filename given to the disk, or use ``dmesg`` to show the
filename:

::

    root@host:~# dmesg
    ...
    [ 1548.784522] usb 1-1: new high-speed USB device number 2 using ehci_hcd
    [ 1548.923255] usb 1-1: New USB device found, idVendor=0930, idProduct=6545
    [ 1548.923270] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [ 1548.923279] usb 1-1: Product: DataTraveler 2.0
    [ 1548.923287] usb 1-1: Manufacturer: Kingston
    [ 1548.923293] usb 1-1: SerialNumber: 1C6F654E5975EDA1E94B0517
    [ 1548.925296] scsi7 : usb-storage 1-1:1.0
    [ 1550.008610] scsi 7:0:0:0: Direct-Access     Kingston DataTraveler 2.0 PMAP PQ: 0 ANSI: 4
    [ 1550.013255] sd 7:0:0:0: Attached scsi generic sg1 type 0
    [ 1551.347689] sd 7:0:0:0: [sdb] 15240576 512-byte logical blocks: (7.80 GB/7.26 GiB)
    [ 1551.348724] sd 7:0:0:0: [sdb] Write Protect is off
    [ 1551.348741] sd 7:0:0:0: [sdb] Mode Sense: 23 00 00 00
    [ 1551.350283] sd 7:0:0:0: [sdb] No Caching mode page found
    [ 1551.350315] sd 7:0:0:0: [sdb] Assuming drive cache: write through
    [ 1551.355687] sd 7:0:0:0: [sdb] No Caching mode page found
    [ 1551.355717] sd 7:0:0:0: [sdb] Assuming drive cache: write through
    [ 1551.377985]  sdb: sdb1
    [ 1551.381814] sd 7:0:0:0: [sdb] No Caching mode page found
    [ 1551.381842] sd 7:0:0:0: [sdb] Assuming drive cache: write through
    [ 1551.381860] sd 7:0:0:0: [sdb] Attached SCSI removable disk


The "sdb: sdb1" in the above listing show that the disk has been given
the filename ``/dev/sdb``.

Then use dd to write the image to the USB device:

::

    dd if=debian-bonding-amd64_custom.iso of=/dev/sdb


Finally, ensure all the data is written to disk completely:

``sync``
