Writing an Installation Image to Flash Media

Creating bootable installation media varies by operating system and involves writing the installation image to flash media such as a USB flash drive, sometimes referred to as a “thumb drive”.

Requirements

  • A USB flash drive with a capacity of at least 8 GB.

    Current installation images from Netgate can be larger than 4 GB in size depending on the platform, and this is likely to increase over time.

  • An installation media image file.

    This document assumes that the installation image is already downloaded onto the client computer which will create the installation media. Refer to the platform and/or software documentation for information on how to obtain an installation image file.

  • A client computer from which to write the image (e.g. Windows PC, Mac, Linux).

Using Etcher

The easiest way to create bootable installation media is to use Etcher. Etcher is available on Windows, macOS, and Linux so the procedure to write an image is the same across each supported platform. Etcher is simple to use, supports compressed image files, and has several features which help prevent users from making unintentional mistakes in the process such as selecting the wrong target drive. Additionally, unlike other methods there is no need to perform other steps before writing the image to prepare the image file or disk.

  • Download and install Etcher from https://www.balena.io/etcher/

  • Insert a USB flash drive into the client computer

  • Start Etcher

    Etcher will display its main screen as shown in the following image:

    ../_images/etcher_01_start.png
  • Click Flash from file

  • Locate and select the installation image file

    Tip

    Etcher can use compressed images directly, there is no need to manually decompress the image file first.

  • Click Select target

  • Click the USB flash drive to which Etcher should write the image

    Note

    Etcher attempts to hide and/or visibly mark potentially dangerous selections such as system drives, the drive containing the source image, and large drives. This makes it easier to identify the correct selection.

    ../_images/etcher_02_targetlist.png
  • Click Select (1) to continue

  • Click Flash! to write the image to the target USB flash drive

    At this point there may be an authentication or UAC prompt to continue.

    Note

    Etcher requires elevated privileges to write USB drives. In the majority of cases, Etcher will trigger an operating system prompt for additional privileges as needed. If it does not, re-run Etcher as an administrator explicitly.

  • Wait for the flash process to complete

    If there is an error from Etcher, try another USB flash drive or follow the advice given within Etcher to resolve the problem.

    Warning

    After writing the drive, the installation media will contain partitions which cannot be read by most operating systems. Ignore any operating system warnings about failing to mount the drive or prompts to format the drive.

  • Close Etcher when complete

  • Remove the USB flash drive from the client system

What Next?

The installation media is now ready to use. Proceed to the installation instructions for the operating system.

Alternate Methods

If Etcher is not viable, there are other more involved methods to create installation media.

Decompress the Image

Some software used to create installation media does not support compressed image files. Before proceeding, decompress the image file to ensure compatibility.

The most common indication that a file is compressed is its extension. If the filename ends in .gz, .bz2, .zip, or similar then it is likely compressed. If so, decompress it using an appropriate utility:

Using 7-Zip

  1. Right click the downloaded img.gz file

  2. Click 7-zip

  3. Click Extract Here

    ../_images/imgwriter_01_extract.png

Connect the Flash Drive to the Workstation

Next, connect the flash drive to the client computer containing the downloaded image file.

Locate the device name that the client computer designates for the drive:

The drive name will be a single uppercase letter, e.g. E. Use Windows Explorer or examine the control panel and look at the available disks for one matching the drive.

Cleaning The Target Disk

Cleaning the target disk removes all of the partitions and data on the device. This step is optional, but a best practice as it gives the disk a blank slate with less chance that previous disk contents will cause a conflict. For example, Win32 Disk Imager on Windows has issues when writing disk images to flash drives if they contain multiple partitions.

The process to clean the disk varies by operating system:

Warning

Choosing the wrong destination could erase one of the system hard disks. Check and recheck the disk selection before making changes.

The Disk Management interface in Windows is one way to delete the partitions from a disk but often it has the operation disabled. The simplest and most reliable method is to use diskpart.

  1. Start a command prompt as Administrator

    ../_images/admin_cmd_prompt.png
  2. Run diskpart

  3. Type list disk to show the disks connected to the system

    One of these disks will be the target USB flash drive.

  4. Type select disk n where n is the disk number of the target USB flash drive from the list in the previous command output

  5. Type clean to remove the partitions from the disk.

The full diskpart session can be seen in the following image:

../_images/imgwriter_02_clean_target_disk.png

Write the Image

Now it is time to write the image to the flash drive. The exact procedure varies by operating system.

Warning

The operations in this section will completely overwrite any existing content on the flash drive so be sure that any files previously stored on the drive are backed up elsewhere.

In order to write an image to a drive from a Windows workstation, the best practice is to use a GUI tool such as Etcher as described previously, or an alternate utility such as Win32 Disk Imager.

Using Win32 Disk Imager

Win32 Disk Imager is a Free and easy-to-use program which can write disk images in Windows. It also only lists removable drives in its GUI which prevents accidentally overwriting a permanent disk.

  1. Start Win32 Disk Imager, and ensure it is running as Administrator

  2. Click the folder icon (1)

  3. Navigate to the location of the downloaded image file

  4. Select the image file

  5. Choose the target drive (2)

  6. Click Write (3)

    ../_images/imgwriter_03_select_image.png
  7. Wait for the image to finish writing, and a Write Successful dialog will appear

What Next?

The installation media is now ready to use. Proceed to the installation instructions for the operating system.

For Netgate hardware, consult the product manual for specific guidance on reinstalling the operating system:

For general use reinstallation instructions, consult the appropriate documentation for the software: