Create a Bootable USB from an ISO on macOS
Writing an ISO to a USB drive from macOS Terminal can be a useful way to prepare installation or recovery media, but it is also an easy way to erase the wrong disk. The command-line utility dd copies raw blocks rather than files. That makes it suitable for certain bootable disk images, while also making it indifferent to the documents, partitions and file systems already stored on the destination.
There is a second trap: not every ISO can become a bootable USB just because its bytes were copied successfully. Some Linux distributions publish hybrid ISO images specifically designed to boot when written directly to removable storage. Other images expect optical-media boot behavior, a specialized USB preparation process or a different installer format. An official macOS installer, for example, ordinarily uses Apple’s createinstallmedia procedure rather than raw-copying an arbitrary ISO. The safest workflow therefore starts with validating the image—not with typing sudo dd.
Download the installer or recovery image from its actual publisher, then read that publisher’s USB-writing instructions. Confirm that the ISO supports your target machine’s firmware and processor architecture. A bootable image for an x86-64 Linux PC is not automatically suitable for an Apple silicon Mac, and a vendor’s Windows installation ISO may require a Windows-specific media creation process rather than a raw USB image write. A file ending in .iso describes the distribution format, not universal boot compatibility.
Where the publisher provides a SHA-256 checksum, validate the downloaded file before writing it. In Terminal, a command such as shasum -a 256 ~/Downloads/example.iso prints a digest for comparison with the publisher’s independently obtained value. Matching hashes reduce the risk of a damaged or unexpectedly altered download. They do not establish trust if both the image and the published checksum came from an untrusted mirror; obtain official checksums or signatures where available.
Check whether the project recommends a dedicated flashing tool. That may be a better choice for unfamiliar users because an application can show the selected drive and some tools perform additional image validation. Terminal is valuable when the image’s documentation explicitly supports raw writing and an operator can inspect the target disk carefully. Neither tool choice excuses skipping backups.
Connect a USB drive whose existing contents can be erased completely. The process will replace its current partition table and data, not merely add the ISO file. To list devices, run diskutil list; on supported macOS versions, diskutil list external physical narrows the view to external physical devices. Look at capacity, removable status, media name and the partitions listed underneath each whole-disk identifier. A USB device might appear as /dev/disk4 in one session and another number after reconnection. Never reuse a disk number from an earlier example or tutorial.
Use diskutil info /dev/diskN as a second confirmation, substituting the actual verified whole-disk identifier you observed. Check that it identifies the intended external drive. The placeholder N is not a literal number to copy, and the system disk must never be selected. If the output is ambiguous, stop rather than guess. Disconnecting other external drives temporarily can reduce the chance of targeting the wrong device.
Do not confuse the whole disk, such as /dev/diskN, with an individual partition such as /dev/diskNs1. For hybrid images intended to define the layout themselves, the destination is normally the whole USB device. Writing to a partition while leaving the original partition map intact is not equivalent. Writing to the wrong whole disk is capable of damaging an operating system installation or backups; these are not recoverable from a command undo button.
macOS often mounts a newly connected USB volume automatically. A raw write should not race against Finder or another application using its filesystem. Close open files and run diskutil unmountDisk /dev/diskN for the verified whole device. This unmounts the drive’s volumes but does not physically disconnect the device. If macOS refuses because a volume is busy, find and close the application holding it; avoid casually forcing an unmount while a file transfer is active.
The target’s identity should be rechecked immediately before any destructive operation. At this point you should know which ISO you will read, whether that image explicitly supports direct USB writing, which physical disk corresponds to the expendable USB stick and whether every important file on it has been backed up elsewhere. If any of those answers is uncertain, use a graphical image-writing tool with confirmation screens or pause the operation.
For a verified hybrid image and an expendable, positively identified external drive, the general command structure is sudo dd if="/absolute/path/to/example.iso" of=/dev/rdiskN bs=1m. The if argument is the input image; of is the output device; and bs is the block size used for the copy. The r device path is a raw-device interface commonly used on macOS; the unprefixed /dev/diskN designates the corresponding block device. Replace both placeholders only after checking the current disk list. The command shown is an illustrative pattern, not a ready-to-paste instruction for your machine.
The sudo elevation is necessary for raw-device access in ordinary circumstances, but it also removes ordinary file-permission protections from this operation. dd will not ask if the USB contains family photographs, a second OS installation or a mounted backup. Some versions accept a progress-status option; on macOS systems where it is not available, the running process may report progress when sent a terminal information signal. Do not infer that an apparently silent command has stopped, and do not remove the drive while writes are underway.
Prefer an absolute path to the ISO, especially if the filename contains spaces. Shell quoting protects the path from being split into unintended arguments. A misspelled input usually causes an error; a valid but wrong output device can cause irreversible data loss. That asymmetry is why confirming of= is far more important than memorizing a fashionable block-size setting.
Allow dd to finish and read its transfer summary. A successful exit confirms that the copy operation completed at the operating-system level; it does not by itself prove that the image is bootable on the target hardware. Running sync can help ensure pending buffered writes have been requested for storage. Then use diskutil eject /dev/diskN to safely remove the USB device, using the same verified drive identity from the completed operation.
macOS may display an alert saying the resulting disk is not readable. That can be normal for media containing partitions or filesystems the Mac does not recognize. Do not initialize or format the drive in response to that alert, because doing so may destroy the boot image you just wrote. Eject it and test it on the intended target computer following that computer’s documented boot-device procedure.
If you need stronger assurance, compare the written bytes with the image using a tool appropriate to your environment and the image size. Do not attempt to compare an entire larger USB disk with a smaller ISO, as the remaining device space is not part of the original image. Check both the image integrity and whether the target machine actually recognizes the intended boot format. Some image writers also expose verify-after-write options that are easier to use safely.
A missing USB boot option does not automatically mean dd failed. Check whether the image supports UEFI, legacy BIOS or both, and whether the target computer permits booting from external media. Some machines enforce Secure Boot restrictions or expose separate boot options for the same device. Disk layout, EFI boot files and image architecture all matter. Boot behavior on one test machine cannot guarantee bootability on another.
If the image requires files to be extracted and copied into a FAT32 or other filesystem, raw image writing may not be the publisher’s supported method. In that case follow the official workflow instead of repeatedly flashing the same incompatible ISO. Reformatting a failed stick will erase its contents; do that only after the failure is understood and the original data, if any, is no longer needed.
For Linux recovery media, a successfully booted rescue system can be a starting point for a separate bootloader task. The site’s GRUB recovery explanation distinguishes UEFI boot-entry repair from legacy BIOS bootloader recovery; it is not a replacement for preparing compatible USB media. Keeping media creation and operating-system repair as distinct steps makes it easier to diagnose failures accurately.
For current supported macOS installers, Apple documents a dedicated bootable-installer workflow using a full installer application and the relevant createinstallmedia tool. That process prepares installation media differently from a direct ISO block copy. Do not rename a macOS installer or disk-image file to .iso and assume it becomes a hybrid image. On Apple silicon, external startup also has hardware and security prerequisites that are different from booting an ordinary PC.
Likewise, for a Windows installer or a product-specific recovery image, use the vendor’s recommended tool or procedure. It may need to construct a supported USB partition layout, account for large installation files or install appropriate boot components. If the official documentation says to use a specific image flasher, follow it. The most reliable method is the one appropriate for the actual installer format and target machine, not a universal terminal trick.
Raw writing remains an effective tool when three conditions are met: the image publisher supports the method, the target removable drive has been independently identified, and erasing the whole device is acceptable. The procedure is short; the discipline that makes it safe is deliberate verification before and after that procedure. Keep that distinction clear, and a bootable USB becomes a controlled maintenance step rather than a data-loss gamble.