This note works for Windows (e.g. Windows 7, Windows 8, …), Linux … ISO image only, and all commands in Terminal.
If you’re interested in using Disk Utility, try this: Create OS X Mavericks Bootable USB Drive from AppStore Release, but DON’T forget to unmount partitions.
To launch a Terminal, simply open Spotlight and type Terminal, in most cases, you can see Terminal listed after ‘Ter‘.
For Windows 7/8 or later, Boot Camp Assistant is the BEST tool.
In ‘Select Tasks‘, CHECK ‘Create a Windows 7 or later version disk’ and UNCHECK all others.
In ‘Create Bootable USB Drive for Windows Installation‘, choose the right usb destination disk.
1 Prepare ISO Image
If you’re about to install on a Mac/Macbook, this conversion is necessary, but for pc/laptop, SKIP to 2 and use ISO.
1 |
hdiutil convert -format UDRW -o os.img os.iso |
Assume you have your windows 7 iso named as cn_windows_7_ultimate_with_sp1_x64_dvd_618537.iso
you may execute:
1 2 3 4 5 6 7 |
$ hdiutil convert -format UDRW -o win7usp1.img cn_windows_7_ultimate_with_sp1_x64_dvd_618537.iso Reading GRMCULXFRER_CN_DVD (Apple_UDF : 0)… ............................................................................................................................................................................................................................................................................................................................. Elapsed Time: 23.053s Speed: 141.4Mbytes/sec Savings: 0.0% created: /Users/sskaje/Downloads/win7usp1.img.dmg |
You see, a ‘.dmg’ is automatically appended to the file name.
2 Prepare USB Drive
Insert a USB Drive, 8GB or larger, USB 3.0 would be better.
Recognise Disk and Partition
1
diskutil list
On my MBP
123456789101112
$ diskutil list/dev/disk0 #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *751.3 GB disk0 1: EFI EFI 209.7 MB disk0s1 2: Apple_HFS Macintosh HD 750.4 GB disk0s2 3: Apple_Boot Recovery HD 650.0 MB disk0s3/dev/disk1 #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *31.6 GB disk1 1: EFI EFI 209.7 MB disk1s1 2: Microsoft Basic Data UNTITLED 1 31.4 GB disk1s2
The disk1 is the USB drive I’m burning the image to.
1 |
diskutil list |
1 2 3 4 5 6 7 8 9 10 11 12 |
$ diskutil list /dev/disk0 #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *751.3 GB disk0 1: EFI EFI 209.7 MB disk0s1 2: Apple_HFS Macintosh HD 750.4 GB disk0s2 3: Apple_Boot Recovery HD 650.0 MB disk0s3 /dev/disk1 #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *31.6 GB disk1 1: EFI EFI 209.7 MB disk1s1 2: Microsoft Basic Data UNTITLED 1 31.4 GB disk1s2 |
If you skip to Step 3 here, you’ll see Resource Busy.
Unmount Partitions
Find out what partition(s) is/are mounted
1 |
mount |
1 2 3 4 5 6 |
$ mount /dev/disk0s2 on / (hfs, local, journaled) devfs on /dev (devfs, local, nobrowse) map -hosts on /net (autofs, nosuid, automounted, nobrowse) map auto_home on /home (autofs, automounted, nobrowse) /dev/disk1s2 on /Volumes/UNTITLED 1 (msdos, local, nodev, nosuid, noowners) |
The mount point on my MBP is “/Volumes/UNTITLED 1”,
Unmount
1 |
hdiutil unmount |
You can unmount by either device name or mount point
1 2 |
$ hdiutil unmount "/Volumes/UNTITLED 1" "/Volumes/UNTITLED 1" unmounted successfully. |
1 2 |
$ hdiutil unmount /dev/disk1s2 "/dev/disk1s2" unmounted successfully. |
3 Burn Image
1 |
sudo dd if=win7usp1.img of=/dev/disk1 bs=1m |
If you find dd dead slow, try a new block size, another choice is using rdisk instead of disk:
1 2 3 4 5 6 7 8 |
sskajetekiMacBook-Pro:Downloads sskaje$ sudo dd if=win7usp1.img.dmg of=/dev/disk1 bs=1m 3260+1 records in 3260+1 records out 3419052032 bytes transferred in 231.464308 secs (14771401 bytes/sec) sskajetekiMacBook-Pro:Downloads sskaje$ sudo dd if=win7usp1.img.dmg of=/dev/rdisk1 bs=1m 3260+1 records in 3260+1 records out 3419052032 bytes transferred in 40.417126 secs (84594141 bytes/sec) |