If you have downloaded an ISO image of another operating system, say Rocky Linux or OpenSense, and you wish to turn that ISO image file into a bootable USB installer drive using a USB flash drive or USB key, you’ll find the most reliable way to copy or ‘burn’ the ISO to that target USB volume is by turning to the command line of MacOS X. There are alternative solutions, but this command line approach using dd requires no third party downloads, it is quite fast, and is consistently reliable in producing bootable volumes out of ISO files.
This will erase the target volume, replacing whatever data is on the destination drive with the ISO contents. There is no confirmation, therefore it is critical you use the proper drive identifier and proper syntax to avoid erasing the wrong thing. You should back up the Mac with Time Machine before beginning.
1.. Attach the target USB drive to the Mac if you haven’t done so yet, then launch Terminal
2. Type the following command to print a list of attached volumes on the Mac:
diskutil list
This may look something like the following, it will be different on every Mac:
$ diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *251.0 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_CoreStorage 250.1 GB disk0s2
3: Apple_Boot Recovery HD 650.1 MB disk0s3
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: Apple_HFS Macintosh HD *249.8 GB disk1
Logical Volume on disk0s2
Unlocked Encrypted
/dev/disk3
#: TYPE NAME SIZE IDENTIFIER
0: partition_scheme *5.3 MB disk3
1: partition_map 32.3 KB disk3s1
2: FAT_32 THE_DESTINATION 8.2 GB disk3s2
/dev/disk4
#: TYPE NAME
3. Locate the USB volume name of the target drive (in this example, “THE_DESTINATION”) and make note of the identifier (in this example, “disk3s2”)
4. Unmount the target volume using the following command, replacing the identifier as appropriate:
sudo umount /dev/(IDENTIFIER)
Again using the above example, which is not universally applicable:
sudo umount /dev/disk3s2
5. You’re now ready to format the target drive and ‘burn’ the ISO to that USB volume – this will erase all data on the target drive replacing it with the ISO, this can not be undone – it is absolutely critical that you target the proper identifier to avoid unintended data loss. Assuming you know what you’re doing, replace the iso path with the ISO to burn to the intended target identifier volume using the following command:
sudo dd if=/path/image.iso of=/dev/r(IDENTIFIER) bs=1m
For example, with a Rocky Linux 8 ISO named ‘Rocky-8.7-x86_64-dvd1.iso’ on the desktop, the syntax would be:
sudo dd if=~/Desktop/Rocky-8.7-x86_64-dvd1.iso of=/dev/rdisk3s2 bs=1m
Note that an ‘r’ signifier is placed in front of the disk identifier, this makes the command much faster. The ‘bs=1m’ at the end is for blocksize, which also speeds up the process. Neither of these adjustments are necessary to copy the ISO to the disk image successfully, it just results in a notably faster experience.
6. When you’re certain the syntax is proper, hit return and enter the administrator password, the copy process will begin immediately
There is no progress bar so just wait it out, how long the ISO copy process takes depends on a variety of things, including the speed of the Mac, the speed of the target volume, and the size of the ISO file being copied or burned to the destination.
When finished, you can eject the volume, it’s ready to go.
diskutil eject /dev/(IDENTIFIER)
For what it’s worth, this works to copy ISO images that aren’t boot volumes and installers too. For example, if you made an ISO yourself of a volume, you could use the above command sequence to copy that ISO to another volume as well.