Since Apple destroyed the awesome tool that was Disk Utility in the pre-Capitan days, we now have to resort to this kind of lunacy to do what used to be a simple task. Way to go, Apple. You're making Microsoft look borderline useful with these kinds of fuck-ups, and I find myself gravitating toward the power, consistency and flexibility I can get with Linux with each passing day. Get your shit together.
...anyway...
sudo su
diskutil list # find the right disk designation, say disk2
diskutil unmountDisk /dev/disk2 # unmount the whole thing, incl. all partitions
dd if=/path/to/your/iso of=/dev/rdisk2 # note the r for "raw"
diskutil eject /dev/disk2
- Identify the disk device according to the OS;
- Use
dd
to write zeros to the RAW version of that disk.
Use diskutil list
:
$ diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *500.3 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_CoreStorage WRAITH 449.4 GB disk0s2
3: Apple_Boot Recovery HD 650.0 MB disk0s3
4: Microsoft Reserved 16.8 MB disk0s4
5: Microsoft Basic Data BOOTCAMP 50.0 GB disk0s5
/dev/disk1 (internal, virtual):
#: TYPE NAME SIZE IDENTIFIER
0: Apple_HFS WRAITH +449.0 GB disk1
Logical Volume on disk0s2
244105AB-8769-4F86-947C-A312FFF5ED7E
Unlocked Encrypted
/dev/disk2 (external, physical): <-- THIS IS MY EXT USB DRIVE
#: TYPE NAME SIZE IDENTIFIER <--
0: GUID_partition_scheme *15.5 GB disk2 <-- HERE'S A PARTITION
1: EFI EFI 209.7 MB disk2s1 <-- AND ANOTHER
2: Apple_HFS ESXi 15.2 GB disk2s2 <-- AND ANOTHER...?
Since /dev/disk2
has three partitions mounted (/dev/disk2s1
, /dev/disk2s2
), we should unmount those first:
$ sudo umount /dev/disk2s1
$ sudo umount /dev/disk2s2
$ sudo umount /dev/disk2
Now we can zero the drive, but we should use the raw disk interface to do this as it'll go faster. Prefix the
disk device name with the letter r
to get that functionality:
$ sudo dd if=/dev/zero of=/dev/rdisk2 bs=1m
if
-- input file
of
-- output file
bs
-- block size (in this case, 1 megabyte)
You used to be able to do this with a practical snap of the fingers before Yosemite, but noooooo, Apple had to break its legs. You guys suck.
Same thing here - dd
to the rescue.
$ sudo dd if=/Users/you/Downloads/YourISO.iso of=/dev/rdisk2 bs=1m
# ... output ...
If all goes well you should be able to see an exit status of zero:
$ echo $?
0
Pullin' the plug now, here we go!
$ diskutil eject /dev/disk2
Disk /dev/disk2 ejected
Now pull that thing out, cross your fingers, swear fealty to the lords of hell, and maybe if you're lucky that damn thing'll actually boot! 😃
How to convert a macOS DMG
to a more useful ISO
Use hdiutil:
hdiutil makehybrid -iso -o Where-To-Put-The-Final-Output.iso /path/to/the/source.dmg
- makehybrid -- a "hybrid" filesystem for read-only disk images. Should be readable most anywhere.
-iso
-- yeah we want an actual ISO image here-o
-- think of it as the argument saying where to put the output...
Damn, dd
is taking for-evar! How can I check its progress?
In the same terminal window in which the process is running, hit CTRL+T
. No, I don't mean CMD
instead of CTRL
, I actually, quite literally mean the CTRL
key here. This feature may be specific to macOS's version of dd
; Linux or other *nix users may need to use a different method or key combination.