Skip to content

Instantly share code, notes, and snippets.

@wallydz
Last active November 4, 2016 08:15
Show Gist options
  • Save wallydz/21edddcdc9981ffa2c58ec732ef39cf3 to your computer and use it in GitHub Desktop.
Save wallydz/21edddcdc9981ffa2c58ec732ef39cf3 to your computer and use it in GitHub Desktop.
Boot on OsX

#How to create a bootable USB stick on OS X

This procedure requires that you create an .img file from the .iso file you download. It will also change the filesystem that is on the USB stick to make it bootable, so backup all data before continuing.

  • Download Ubuntu Desktop
  • Open the Terminal (in /Applications/Utilities/ or query Terminal in Spotlight).
  • Insert your USB flash media, which must be 2GB or larger.
  • Launch the Disk Utility app which is located in Applications -> Utilities. Booting Ubuntu from the USB drive
  • In the lefthand pane, click on the USB drive to select it.
  • Click the Partition tab.
  • Select 1 Partition from the dropdown menu.
  • Enter a name for the drive.
  • Change the Format to Mac OS Extended (Journaled).
  • Click the Options button.
  • Ensure that the GUID Partition Table radio button is selected and click OK.
  • Click Apply.
  • Convert the .iso file to .img using the convert option of hdiutil e.g.,

hdiutil convert -format UDRW -o ~/path/to/target.img ~/path/to/ubuntu.iso

Note: OS X tends to put the .dmg ending on the output file automatically. Run:

diskutil list

to get the current list of devices.

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). Using /dev/rdisk instead of /dev/disk may be faster If you see the error dd: Invalid number '1m', you are using GNU dd. Use the same command but replace bs=1m with bs=1M If you see the error dd: /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. The newly created Ubuntu live USB drive is now ready to be inserted into a Mac.

#Booting Ubuntu from the USB drive

##To test the Ubuntu live USB on a Mac:

  • Insert the USB drive into an available USB port.
  • Reboot or turn on the Mac.
  • Immediately after the startup chime, press the Option key (sometimes marked Alt).
  • Select the USB drive from which to boot by using the left and right arrow and Enter keys.
  • If you can't see the USB drive in step 4, download rEFIt EFI Boot Menu and Toolkit to get a screen where you can choose from the available devices to boot from.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment