How to make a bootable Linux USB install disk

  • By Christopher Kielty, last updated September 07, 2016
  • Filed under: Linux Mac Windows

This guide is for anyone using Mac OS X or Windows who wants to make a bootable USB Linux install disk. Basically, we’re going to take a Linux ISO file and copy it onto a thumb drive. When we’re done, you’ll be able to boot your new drive on pretty much any computer that can boot from a USB drive.

For demonstration purposes, we will be making an Arch Linux install disk. Have a different Linux distribution you’re trying to make a USB disk out of? Don’t worry! This guide should work for the vast majority of Linux distros. While following these instructions , simply replace the Arch ISO with an ISO from whichever flavor of of our favorite penguin OS you happen to be using.

For the purposes of this guide, I am going to assume you are familiar with computers. If you’ve burned Linux onto a CD before, great. If not, that’s ok too. Unfortunately, making a bootable flash drive isn’t quite as straightforward as making a CD. In some cases, extra software is needed. In other cases, one must resort to using the dreaded command line. Oh no!

Even though its a little more complicated, going the USB route is probably going to be worth it for most people. Many (dare I say most) computers these days don’t have a CD drive. Believe it or not, it’s actually very difficult to plug a CD into a USB port. For starters, they’re not the same size. Fortunately, there are adapters for that.

Double Check There is a Proper Backup of all Data

Please make sure all of your data is properly backed up before continuing. Following these directions will permenantly overwrite at least a portion of the USB disk we’re turning into a Linux install disk. Accidentally choosing the wrong disk to write to isn’t outside of the realm of possibility. So, please, back up your data.

Windows

USBWriter on Windows

When I said that in some cases you’d have to install additional software, did you guess I was talking about Windows? Because I was. The good news is USBWriter exists. USBWriter is free (free as in public domain), lightweight (about 64 KB), easy to install, and it makes easy work out of writing images to USB drives. Pick up a copy from SourceForge.

Once downloaded, unzip it, plug in the USB drive, and fire it up. Select the source image, select the USB drive and hit Write. Don't see your USB drive listed? Try hitting Refresh. A short wait for the files to write... and... done.

Make sure the correct target device is selected before hitting write. Accidentally overwriting the wrong drive is bad news. But this is what backups are for.

Mac OS X

OS X disk not readable

There’s good news for OS X users. You don’t have to download any extra software. The bad news is you’re gonna have to use the command line a little bit. Actually, on OS X, we’ll be using the terminal exclusively to get this done.

If you’re not familiar with the command line, that’s ok. This is a relatively simple procedure. Perhaps not as simple as USBWriter is on Windows, but definitely not rocket science.

In a nutshell, we’re going to take the ISO image, convert it to a DMG image, then write it to the USB drive. We’ll be using hdiutil to convert the ISO image to something more usable, then dd to write the image to disk.

Navigate to the directory containing the ISO image. If it’s in the Downloads folder, do cd ~/Downloads. Then use hdiutil to convert the ISO image to a DMG image.

hdiutil convert -format UDRW -o arch.dmg archlinux-2014.10.01-dual.iso

In case you were wondering, UDRW is the readable/writable variant of the Universal Disk Image Format. UDIF is native to OS X. It’s essentially the same thing as a DMG. Actually, a DMG is a UDIF.

Next, use diskutil to see what drives are available on the system.

diskutil list

Good. Now connect the thumb drive you want to turn into Linux installation media and do diskutil list again. Notice a new device listed? Note the location of that device. It should be something like /dev/disk#. It’s also a good idea to note the size listed for the drive. Assuming you know how big your USB drive is, this can help to verify that we’re using the correct drive. Unless you’re on a Chromebook, or a Netbook, or something like that, your thumb drive should be significantly smaller than your system drive.

Now we’re gonna use diskutil to unmount the USB drive we just mounted. We’re not actually ejecting the disk, just unmounting it. This will allow dd to properly access the drive. Confusing. yes.

diskutil unmountDisk /dev/disk#

You should see the message Unmount of all volumes on disk# was successful in the terminal window.

Now for the fun part. We’re going to use dd to write our image to the USB disk. We’re going to need to use sudo here to make this work. Sudo will prompt you for your password. Type in the usual password for your account and hit enter. Unless you’re on some kind of account with limited access there shouldn’t be any other password for sudo.

sudo dd if=arch.dmg of=/dev/rdisk# bs=1m

Notice that instead of /dev/disk# (replace # with the actual number, of course) I’ve used /dev/rdisk#. Wait, what? Ok, so /dev/disk# and /dev/rdisk# actually point to the same place. The USB drive. The difference is that disk# has to take a very indirect route and go through a buffer to get to the disk. Meanwhile, rdisk# (note the “r” in front of “disk”) goes straight to the disk. Presto! Magic. This means the main limiting factor here is going to be the maximum real world write speed of the thumb drive itself. As it should be.

Once you execute this command, it might look like the terminal window is frozen. It just sits there and doesn’t do anything. Don’t worry, it’s doing lots of stuff, just without any verbosity. Give it some time to finish. How much time? Let’s say you have a basic USB 2.0 drive with a write speed of about 5 MB/s (that’s bytes, not bits per second). Let’s also assume that Linux image is 600MB. That’s 600MB / 5 MB/s = 2 minutes. Depending on the kind of drive you’re using, it could be faster, or slower.

Once dd finishes, you'll probably get a system message saying "The disk inserted was not readable by this computer." This is actually a good sign. Click Ignore.

Done.

Arch Linux USB install disk