If you want to install a brand new Linux distribution (like Ubuntu (LINK ARTICLE) or Debian) on your computer, you will need to burn the disc image file (also referred to as an “ISO file” or “ISO image”) of the OS to do so. Chances are you will also need to burn the ISO tile to USB unless you use a virtual machine to try out your disk image.
You can find an ITgirl.tech article on how to burn a disc image file to USB flash drive using third-party software. Unfortunately for macOS Big Sur users, native tools are not available for this procedure. However, if you are reading the present article, chances are you’re looking for a different way of doing things, namely by using the command line.
More often than not, we use dedicated software applications on our computers and burning a disc image file to USB is no exception to this rule. It is natural to think that the easiest way of doing this process is through the use of graphical software. After all, we’re accustomed to our laptop or desktop computer displaying an interactive visual interface. However, sometimes there’s no way around using the command line to get the results we want. Some operating systems (such as macOS Big Sur and virtually all Linux distributions) even make using the command-line the most efficient way of burning a disc image file on your pen drive.
Advantages of using the macOS Terminal
I’d like to dispel some of the negative aura surrounding this old school way of doing things. Unlike dedicated applications, the Terminal is a tool that doesn’t require to install additional components. It is also a great alternative to fall back on when you eventually end up with a program that seems to have a mind of its own. Also, being able to execute simple commands in a matter of seconds using the Terminal can be a real breath of fresh air (especially when you’ve spent the last hour browsing forums trying to troubleshoot your new software). As a bonus, by using the Terminal, you get to understand the technology behind your OS better.
As always, remember to format your pen drive before burning your disc image file on it! Additional steps are required if you are currently using Mac OS and want to burn a Windows disk image. That is because these two operating systems use different formats by default. If you format your USB key in macOS without considering the file type, you will end up with a pen drive that is only compatible with other Mac computers. Consequently, your burned Windows disc image file will not work.
Burning disc image files on other releases
Up until macOS High Sierra, burning disc image files using the native tools found on Mac was a possibility. However, ever since macOS Mojave, doing so is an arduous, if not downright impossible chore. And this is where the command line comes in handy.
If you’re using an older version of macOS such as Mac OS X Yosemite, Mac OS X El Capitan or macOS High Sierra, then you might want to consider reading this ITgirl.tech article. Unlike on macOS Big Sur, it is possible to burn ISO files using the tools already provided by your OS with these older versions. For those on High Sierra, Sierra or OS X El Capitan that want to burn the ISO file to CD or DVD instead of USB, I recommend this guide by Paul Horowitz from the OSX Daily website.
Using the command line isn’t hard, but there is always a higher risk of compromising either your file or your drive when executing commands from the Terminal. When in doubt, it is best to do a backup of your system before proceeding with the steps found within this guide.
The tool we are using for this procedure is called “dd.” Because “dd” can be used to burn any drive, you have to be extremely vigilant when executing commands with it. There will be no software asking you whether or not you want to burn the disc you selected; it will simply do so, no questions asked. Also, this includes not only external drives such as USK keys, SD memory cards or external HDD hard drives but also internal hard drives (ie, your main computer hard drive, with all its stored information).
Note for those wanting to burn a Windows 10 ISO file
Unlike with computers running Windows or Linux, Mac doesn’t allow one to burn the Windows 10 disk image directly on a USB key. You will require a particular procedure that you can find HERE. For everything else, including regular software and Linux distributions, follow the instructions below.
How to burn a disc image file to USB using the command-line
Download your ISO file and remember its location on your hard drive (ideally, a place that is easy to remember, such as Downloads, Documents, or Desktop).
Format your pen drive. You can either do so using the command line or the Disk Utility tool. Make sure to select a format that is compatible with Windows if you intend to use your disk image on an operating system such as Windows 10. By default, Mac uses the HFS+ format, which is proprietary to Apple products and cannot be read by Windows. Also note that if you plan on burning a macOS disk image, you have to format your pen drive using the Apple Partition Map file type.
Access the Terminal by doing a spotlight search for “Terminal.”
The first thing we will want to do is to identify the drive linked to your USB key. Make sure that you have inserted the USB key before continuing. Enter the following command:
You will find a list of disks; in the example above, you can see that my USB key is the external drive located on disc 3. You can identify your pen drive by the following:
When it says “(external, physical),” it means that it is an external drive such as a pen drive or external hard drive. If you see the words “internal,” “synthesized,” or “disk image,” it is not a pen drive.
It makes things easier if you have a single USB key inserted. Otherwise, look for the particularities of the USB you wish to use to burn your ISO file. Its size is the biggest giveaway.
Now that you know the name of the disk linked to your USB key, you will need to take note of its identifier. You will notice that your pen drive has two of them (unless you partitioned it, but it shouldn’t be the case if you are using a formatted pen drive). The identifier we want to remember is the one below the one with the disk number. In this example, the identifier is disk3s1.
Make sure that your USB key is unmounted. To do so, while still in the Terminal, type the following:
sudo umount /dev/<identifier>
Where <identifier> is the identifier we noted in step 6. In this example, I would type “sudo umount /dev/disk3s1”.
You will be asked to enter your password, as the “sudo” command means that you are executing a command as an Admin.
Note: If you get an error message like “umount(/Volumes/USB): Resource busy — try ‘diskutil unmount,'” don’t panic. As per the official Apple Developer website, “[d]ue to the complex and interwoven nature of Mac OS X, umount may fail often.” Even though you are most probably using MacOS and not Mac OS X, this information is still relevant today.
The solution is simple. To unmount using the command line, type:
diskutil unmount /Volumes/<NameOfDisk>
Where <NameOfDisk> is the name of your disk (not to be confused with its identifier; the disk name is the one appearing in your Finder and under your desktop USB icon).
In this example, I will write:
diskutil unmount /Volumes/USB-KEY
Once you have correctly unmounted your external drive, you should then be able to proceed as planned with the dd burning command.
Now for the moment of truth, burning your disc image file on your pen drive. Enter the following:
sudo dd if=</path/image.iso> of=/dev/r<identifier> bs=1m
Where </path/to/image.iso> is the location of your ISO file, as well as the name of the file itself (including the .iso), and <identifier> is your pen drive identifier found in step 6.
In this example, I use the disk image of Bodhi Linux, which I had moved to a dedicated ISO files folder. I am also using the USB drive identified earlier.
sudo dd if=/users/LariNeko/Documents/ISO-files/bodhi-5.0.0-64.iso of=/dev/rdisk3s1 bs=1m
If prompted, enter your password (this is a “sudo” command after all and requires admin privileges).
Now, wait. Unlike with regular software tools used to burn a disc image file to USB, the command line doesn’t give any indication that it is doing anything while burning the image. You will find no status bar, no percentage, nothing. Instead, after executing the command and pressing Enter, you will be left with a blank line. Do not do anything. After a short time (about two minutes), the process will be completed, and you will see a written recap of what just happened. In this example, it looks like this:
706+0 records in
706+0 records out
740294656 bytes transferred in 133.359096 secs (5551137 bytes/sec)
Where general transfer data is provided, as well as the amount in bytes of data transferred as well as the time it took to burn the ISO file to USB.
You will then be automatically redirected to a new regular command-line prompt (in this case, “LariNekos-MacBook-Air:~ LariNeko$”).
Now all you have to do is exit the command line by pressing the upper left corner x. Voilà!
If you aren’t sure of how to write the specific location of your ISO file, do the following:
- Find your ISO file using the Finder file manager.
- Right-click the file, then select “Get Info.”
- A new window will appear. Look for a part indicating “Where.” Right next to it, you will see the full path of the file. If you see “Untitled” as the first part of the file location, as is the case in the example below, that means to put a “/” before the following word (in this case, the path indicates “Untitled → Users”, which means that my path will start with “/Users”).
- IMPORTANT: Make sure to indicate each folder exactly as they are written, including capitalization.
*What if I get an error message?
If upon entering the dd command you get an error message such as “dd: /dev/disk1s1: Operation not permitted” or “dd: /dev/disk1s1: Permission denied”, it probably means that you did not correctly unmount your USB key.
If instead of doing an unmount of the external drive you eject it using the eject icon, then you not only unmount but also eject the USB key. To remediate this, remove the pen drive, reinsert it and then either use Disk Utility or the command line to unmount the drive. Explanations on how to do so are in step 7.
Does the USB key matter when you burn a disk image?
You can use any old pen drive laying around to burn a disk image. However, as with most things tech-related, the better the hardware, the easier the process. For instance, the type of USB you choose (USB 2.0 vs. USB 3.0 vs. USB 3.1) will have an impact on the data transfer speed. The brand you opt for (e.g., a free USB key received as a promotional item from your last work convention vs. a SanDisk pen drive) will also have an impact. The better recognized the brand and the better its hardware reputation, the fewer chances you will have of having your electronics fail on you at a critical time.
Even though tech gadgets have come a long way in terms of their portability and versatility, they can be quite lackluster when it comes to their design.
If you own a MacBook Pro or MacBook Air, chances are you might want a pen drive that is ideally highly portable and with a sleek design. This is where ultra-compact USB flash drives come in. By having a pen drive the size of a dice, you can keep it plugged in your laptop and bring it with you wherever you go. Bonus if it also looks great and doesn’t stick out like a sore thumb against the aesthetics of your Mac.
You will find below a list of ultra-fit USB keys. To ensure quality control, I only included well-known brands whose models received Amazon reviews that outshined their competitors. Note that unlike full-sized USB flash drives, their ultra-compact counterparts might experience some overheating. I’ve had the opportunity to use two ultra-fit Samsung pen drives for many years now, and have never personally experienced this issue. As always, YMMV.
I have not personally tested these USB keys. However, I feel confident about their performance judging by the numerous, well-detailed reviews available for these particular models. These flash drives are for those that are looking for some serious performance from their electronics. However, sometimes ultra-fit USB keys have the advantage of higher portability at the cost of less efficient hardware. If you don’t mind bulkier pen drives, then I suggest taking a look at the ones found in THIS ARTICLE. If instead, you are looking for something a bit more economical (while still being high-quality), I will refer you to the USB keys listed HERE.
Note that the two links posted above are affiliate links. If you go through them to make a purchase, I will earn a commission (at no cost to you). I link these companies and their products because of their quality and not because of the commission I receive from your purchases. These links are used to pay for the cost and upkeep of ITgirl.tech. Thank you!
© 2019 – 2021, ITgirl.tech. All rights reserved.