Burning Linux ISO to USB Using a Mac

My main computer is an old MacBook Pro. I often download Linux ISOs to install on other computers. In recent Debian-esque releases this is actually really simple.

1. I find it quicker and easier to install from USB so first insert a USB pen / stick of some sort.

Note: This USB stick will be erased, so don’t use one with data that you need to keep!

2. Next we need to find out which number has been assigned to the USB stick. If you only have one disk in your Mac then the USB will usually be disk1, but always check first. (Note: Disks are numbered from zero, so your internal drive should be disk0) On your Mac open Disk Utility, which is located within Applications / Utilities. (See Image)

Disk Utility

Select the USB stick from the lefthand window and then click the Info button which is on the toolbar. (See Image)

USB Info

You will get a pop up window with loads of information about the device. We only need the Disk Identifier. Make a note of this for later.

Disk Identifier

3. To allow us to write data to the USB stick we need to unmount any volumes currently on there. (see image)

Unmount USB

4. Now comes the actual writing. First locate the Terminal application, again within Applications / Utilities. (see image)

Mac Terminal

5. Remember to change the code to match your Disk Identifier from earlier. There are a few things to note about the following command.

sudo – allows you to run dangerous commands, so will require an administrator password

Instead of typing the location of the ISO file you can just drag the ISO onto the terminal when required.

When we found out the Disk Identifier, it was disk1. That will work in the command, but we use rdisk1 instead, which gives us raw access to the disk. This may not be necessary, but it works for me.

There is a lot of discussion about block sizes, but I find 4MB is reasonable for writing ISOs to USB. In Linux we often type bs=4M, however the Mac prefers it like bs=4096 instead. It’s the same thing, just expressed differently.

The command:

sudo dd if=[drag iso here] of=/dev/r[disk number] bs=4096; sync

Example:

sudo dd if=/Users/dan/Desktop/linux.iso of=/dev/rdisk1 bs=4096; sync

If you’ve got it right, you shouldn’t get any feedback until it finishes. Your USB stick may have a blinking LED whilst the data is being written. For reference the 200MB debian-netinst ISO took just over a minute to write.

Too many times you end up needing some silly utility to do simple tasks like this, your guide was very much appreciated and saved me wasting a blank DVD to test out a distro. Go green computing, ha ha!

G’day Dan.
Thanks so much for dd in mac disk utility.
I got to partioning & installing linux distro’s a week
ago, ( & have learnt so much from that), but now making iso’s
& bootable usb’s, and using a bit of command line, too,
is something i never thought i’d be able to do.
Thanks Mate.
Regards James from OZ.

I’ve done this before, but I lost my “cheat sheet” and Google brought me to you. I do remember successfully using “4m” instead of “4096” for the bs value in the past, but I’m taking your advice here and using the full numeric this time. Looking forward to testing Bodhi Linux on my Mac mini!

I actually started this as a guide for myself, and I refer to it all the time. Since writing this, I think I’ve used 4M instead of 4096, but I think the M needs to be capitalised. 4096 definitely works though.

Important Links

Advice

Stop using the hard drive as soon as possible. If the problem is getting worse then you may eventually lose access completely.

Don't download ANYTHING to the disk. It could write over the files you're trying to recover.

Don't try to scan, repair or fix any errors unless you have backups of the data. A failed repair process can damage the files beyond recovery.

Don't re-install or restore the computer unless you have backups of the data already. It may get the machine running again, but only in a factory-fresh way. Your data will be lost.

If you manage to access your files at any point, make a copy to another drive as soon as you can. It may be a fluke, and could be the last time you see the files. Don't reboot expecting to see them again.

If the files you need are really important then you should consider getting the disk professionally recovered. We've spent years making our process as safe as possible to maximise our chances of success.

If you decide to try your own recovery, keep a close watch on the time estimates. If the time keeps incrementing up it could be a sign of disk trouble. Failure to deal with that could cause the drive to fail completely, and beyond repair. A hard drive shouldn't take longer than a few hours to extract.