Creating a bootable Linux live-USB on OSX


I’m attending a Linux server course this fall held by Tero Karvinen. With his recommendation to create my own web page based on WordPress I’m right here writing my first report to his class with the title Linux live USB.

I’m using a Macbook Pro (late 2013) with the latest OSX Yosemite version 10.10.5. I will be doing the live-USB disk using a Terminal. The USB stick I chose for this fate is a small Kingston DTGE9 8GB USB2.0 stick, which I had unused.

The first thing I did is downloaded the ubuntu package I’m going to boot to. The teacher recommended Xubuntu 14.04.3 (Trusty Tahr). I haven’t tried this distro before. (21:30)

Now that I had the .iso file in my downloads folder, I first needed to convert the file to .img format. This will change the filesystem and make it bootable. To do this, I needed to run this command in my terminal. (21:35)

hdiutil convert -format UDRW -o xubuntu-14.04.3-desktop-amd64.img xubuntu-14.04.3-desktop-amd64.iso

As a result I’ve got a file called ‘xubuntu-14.04.3-desktop-amd64.img.dmg’ in the same folder. OSX tends to put the .dmg ending on the output by itself, so I edited the file name to get rid of it.

I needed to find out which volume is my USB drive, do I ran the command (21:40)

diskutil list

Then I inserted my flash drive and ran the command again to determine which disk is the one inserted. This happened to be /dev/disk2 for me.

Now that I knew what number my disk was, I needed to format the disk and convert the disk to FAT32 filesystem (if was NTFS for some reason).

diskutil eraseDisk FAT32 XubuntuLive disk2

Here I ran in to my first problem, the command above didn’t work if the disk name was in lower case letters, so I put in upper case letters instead. (21:45)

diskutil eraseDisk FAT32 XUBUNTULIVE disk2

I unmounted the disk to make sure it’s unused while we create the live disk. (21:46)

diskutil unmountDisk /dev/disk2

 I created the live USB with this command using the .img file. (21:48)

sudo dd if=xubuntu-14.04.3-desktop-amd64.img of=/dev/rdisk2 bs=1M

Here I encountered an error: dd: bs: illegal numeric value’. The error was because I had typed the last letter in upper case, while it should be in lower. The command that worked is here: (21:50)

sudo dd if=xubuntu-14.04.3-desktop-amd64.img of=/dev/rdiskX bs=1m

Now I got my bootable ubuntu live USB created with OSX Terminal. Now I just needed to eject the drive. (22:00)

diskutil eject /dev/disk2

Then I tested it on my laptop. Pressing alt while booting up and selecting the flash drive to boot Xubuntu.

I used this guide to get along. And Googled this page to get ahead on the formatting command.


Miro Metsänheimo

A software developer from Finland born in -92. I'm passionate about computers and technology. Feel free to message me about anything!


Leave a Reply