Tuesday, October 13, 2015
Ubuntu has a great set of instructions on creating a bootable USB drive in Mac OS X, but they have an additional step I found to not be needed; there’s no need to convert the Ubuntu ISO to an IMG file. You can simply download the ISO and use
dd to copy it to a USB drive.
Start by downloading the Ubuntu ISO you want to boot from.
Next, plug your USB drive into your Mac; it will automatically be mounted by OS X.
Open Terminal and run the following command to figure out which device the USB drive was mapped to:
Once you figure out which device the USB drive was mapped to, unmount it (disk2 is the device in this example, your device will probably be different):
diskutil unmountDisk /dev/disk2
When the Ubuntu ISO finishes downloading, you are ready to copy it to the USB drive using
sudo dd if=~/Downloads/ubuntu-14.04.3-server-amd64.iso of=/dev/rdisk2 bs=1048576
You’ll notice a couple of odd things in this command.
First, the block size value, bs=1048576. Most instructions would have bs=1Mb. Well, OS X’s
dd command is still a bit dated and doesn’t interpret anything but bytes. 1048576 is 1 Mib in bytes.
Second, the output file value, of=/dev/rdisk2. rdisk2 is used instead of disk2. Why? I would try to explain it, but
man hdiutil already does so well:
Since any /dev entry can be treated as a raw disk image, it is worth noting which devices can be accessed when and how. /dev/rdisk nodes are character-special devices, but are “raw” in the BSD sense and force block-aligned I/O. They are closer to the physical disk than the buffer cache. /dev/disk nodes, on the other hand, are buffered block-special devices and are used primarily by the kernel’s filesystem code.
Additionally, check out Why is “/dev/rdisk” about 20 times faster than “/dev/disk” in Mac OS X.
The process may take a while to complete depending on how the speed your USB drive.
Once the process is finished, OS X will try to mount the USB drive and will throw the following warning on the screen:
You can safely ignore this error and eject the USB drive through the modal dialog window or by using the following command:
diskutil eject /dev/disk2
Finally, plug the USB drive into the computer you want to install Ubuntu on and boot from it.
Modern laptops and desktop motherboards typically have several USB boot options. You may be required to boot to USB-HDD, USB-ZIP, USB-FDD, or USB-CDROM.