A broken Mac computer with Mac OS X. A trial copy of the TransMac software. One high quality USB flash drive with 16GB of storage. A copy of Apple’s macOS (DMG file). Now that you have all the necessary ingredients, you’re ready to make a Mac OS X bootable USB using the DMG file of the operating system with the steps below. 2018-3-14 Make sure that the Mac OS installer file is present in your /Applications folder. If it's not there, or you're not sure of its name, seethe previous section of this guide for details on the installer file name, and how to download the needed file. Plug your USB.
This quick step by step will show you how to make a bootable USB stick from a downloaded ISO image file using an Apple Mac OS X.
Note: this procedure requires an .img file that you will be required to create from the .iso file you download.
Tip: Drag and Drop a file from Finder to Terminal to 'paste' the full path without typing and risking typos.
- Download the desired file
- Open the Terminal (in /Applications/Utilities/ or query Terminal in Spotlight)
- Convert the .iso file to .img using the convert option of hdiutil:
hdiutil convert -format UDRW -o /path/to/target.img /path/to/source.iso
Note: OS X tends to put the.dmg
ending on the output file automatically. Rename the file by typing:mv /path/to/target.img.dmg /path/to/target.img
- Run
diskutil list
to get the current list of devices - Insert your flash media
- Run
diskutil list
again and determine the device node assigned to your flash media (e.g. /dev/disk2) - Run
diskutil unmountDisk /dev/diskN
(replace N with the disk number from the last command - in the previous example, N would be 2) - Execute
sudo dd if=/path/to/downloaded.img of=/dev/rdiskN bs=1m
(replace/path/to/downloaded.img
with the path where the image file is located; for example,./ubuntu.img
or./ubuntu.dmg
).
Note: Using/dev/rdisk
instead of/dev/disk
may be faster.
Note: If you see the errordd: Invalid number '1m'
, you are using GNU dd. Use the same command but replacebs=1m
withbs=1M
.
Note: If you see the errordd: /dev/diskN: Resource busy
, make sure the disk is not in use. Start the 'Disk Utility.app' and unmount (don't eject) the drive. - Run
diskutil eject /dev/diskN
and remove your flash media when the command completes
Been doing tons of writing images to USB recently and have found these few commands very useful.
To do this we first need a ISO image we want to write to USB. In our case this would be the latest Ubuntu release I grabbed.
First we need to convert that .iso to .dmg which dd can understand and write to the USB. Do this by running the following command:
Once this complete there will now be a .img file at
~/path/to/ubuntu.img
which we will write to the USB.Before we write to the USB we first need to identify which /dev/{device-name} we are referring to. To do this run:
The easiest is to run the command, then remove your device and run it again. The missing device is your USB device. THIS IS VERY IMPORTANT IF YOU PICK THE WRONG DEVICE THAT DEVICE WILL BE WIPED!!
Next make sure to unmount the disk so dd can do some magic on it:
Once that is done run the following command, pointing dd both to
~/path/to/ubuntu.img
which we created the device we found from diskutil list
.If the command fails look at perhaps using '1m' instead of '1M', users have noted differences on platforms in the comments.
For more speed on the dd command consider using /dev/r{device-name} which will rather use raw and give a slight boost in performance.
That will take a while and do the actual write and wiping of the device. Once done your device should be ready for action.
Just to be thorough let's eject the device before removing it to save our precious data !
And that's that, you'll now have a bootable device. Problems / other ways ? Let me know in the comments !