Universal Disk Image Procedure

How to turn virtually any disk image file into a bootable drive.

Verifying your download

Always verify the integrity of your downloaded disk image file before using it. Look for a SHA256 hash or checksum file provided by the publisher.

Terminal method (Linux/Mac)

Terminal method (Linux/Mac)

Given a SHA256 checksum file, simply pass that file to sha256sum:

$ sha256sum -c <check_file>
<disk_image.iso>: OK

If you only have the hash itself, pipe it and the path to the disk image to sha256sum:

$ echo '<hash>' '<disk_image.iso>' | sha256sum -c
<disk_image.iso>: OK

Note that it may take some time to calculate the hash for larger files.

GUI method (Linux/Windows)

GUI method (Linux/Windows)

Install and run GtkHash for Linux (Flatpak) or Windows.

If you have a checksum file, open it with File > Open Digest File….

If not, click in the File: field and open the disk image. Paste the expected hash in the Check: field.

Click Hash to compute the hashes of the selected file. Look for a checkmark or similar symbol (theme-dependent):

GtkHash screenshot

Flashing the image

Faster flash drives, especially USB 3.0+, are recommended. External hard drives and SSDs also work in most cases (and tend to be faster).

Some BIOSes have compatibility issues booting from certain drives — if you experience this, double-check your BIOS settings and try other (distinct) flash drive models. As a last resort, USB 2.0 flash drives (or any drive connected through a USB 2.0 hub) tend to be just about universally compatible.

Terminal method (Linux)

Terminal method (Linux)

Connect the drive and check its assigned device name (e.g. sda). Make sure to use the correct device name in future steps!

$ lsblk -S
NAME HCTL       TYPE VENDOR   MODEL          REV SERIAL           TRAN
sda  0:0:0:0    disk SanDisk  SanDisk Ultra PMAP 0000000000000000 usb

Next, unmount all partitions on the target drive. Errors about partitions not mounted can be safely ignored.

$ sudo umount /dev/<device>?

Finally, write the disk image to the target drive with dd:

$ sudo dd if=<disk_image.iso> of=/dev/<device> bs=1M oflag=direct conv=fsync status=progress
2736783360 bytes (2.7 GB, 2.5 GiB) copied, 54 s, 50.7 MB/s
2634+1 records in
2634+1 records out
2762833920 bytes (2.8 GB, 2.6 GiB) copied, 54.5202 s, 50.7 MB/s

Using the arguments shown here, the drive will be ready for use and can be safely disconnected as soon as dd completes.

Explanation of arguments
if
Input file (disk image)
of
Output file (target block device)
bs=1M
Use a block size of 1 MiB (default 512 B)
Tells dd to read and write 1 MiB of data at a time. 1 MiB is a good minimum for most modern storage devices, but larger block sizes can further improve transfer speeds on higher capacity drives (which usually have more cache).
oflag=direct
Use direct I/O for writing (bypassing the kernel cache)
The kernel cache makes file operations seem faster than they are in reality, but this is counterproductive when proper operation relies on the data being fully written to disk. Without this flag, the kernel will continue writing data to the drive long after dd has exited, and other devices may feel sluggish from kernel cache saturation.
conv=fsync
Flush all data from the drive cache into non-volatile storage before completion
status=progress
Display a live progress indicator

See also: dd man page

GUI method (Linux)

GUI method (Linux)

This method uses GNOME Disks (available in most distribution repositories). You can also use Mintstick (Linux Mint) or Etcher.

  1. Connect the drive and select it in the left pane of GNOME Disks.
  2. From the top-right overflow menu, select Restore Disk Image….
  3. Select your disk image file.
  4. Click Start Restoring….

GNOME Disks screenshot

  1. You will see a warning popup — confirm once again that you selected the correct drive and continue.
  2. Enter your password to authenticate, then the flashing process will begin.
Other platforms

Other platforms

  • Etcher is a cross-platform (Linux/Windows/Mac) Electron-based flashing tool focused on extreme simplicity.
  • Rufus is a flashing utility for Windows that is both extremely powerful and relatively easy to use.
    • Note: Rufus supports flashing some disk images in ‘ISOHybrid’ mode. While often faster than DD mode, ISOHybrid flashing causes problems with some disk images. I recommend simply using DD mode unless you intend to edit files on the target drive.

Afterword

  • If you are using a known-good flash drive, there is little need to verify the integrity of the flashed image. However, if you wish to, you can use this Linux command:
    $ sudo head -c `du -b <disk_image.iso> | awk '{print $1}'` /dev/<device> | sha256sum
    22bbee097ed82711df692654fc56332df2133de369de139792005c0ec52cbe68  -
    Etcher will perform this step automatically.
  • Many people swear by Ventoy. Unless you are frequently working with bootable disk images, do not even consider Ventoy, because it will offer absolutely no benefit while simultaneously introducing potential problems. Ventoy does not work with all disk images and in some rare cases can even cause issues past the initial boot.