Ubuntu Bootable Usb For Mac



  • Connect the USB flash drive or other volume that you're using for the bootable installer. Make sure that it has at least 12GB of available storage and is formatted as Mac OS Extended. Open Terminal, which is in the Utilities folder of your Applications folder.
  • All I wanted was just: an USB key with Ubuntu 16.04 LTS installed on it, with /home and swap encrypted,; that I could boot from any of my 2 Macs, by simply pressing and holding the “option.
  • 8 GB USB thumb drive; Run DiskMaker X on your Mac, point it to the macOS installation app and insert the USB stick. A few minutes later, you’ll have a bootable installation USB stick for that version of macOS. Along the way, you’ll see progress notifications of “DiskMaker X 8 for macOS Mojave” When you hear DiskMaker roar (No kidding!

You’ll see the boot options menu appear. Select the connected USB drive. The Mac will boot the Linux system from the connected USB drive. If your Mac just boots to the login screen and you don’t see the boot options menu, reboot your Mac again and hold down the Option key earlier in the boot process. This solution will allow you to boot. The firmware in newer Macs allows to boot standard UEFI bootable media, which are rather trivial to create and don't require special Ubuntu images. – LiveWireBT May 7 '15 at 9:20 The standard USB-image will boot on a mac if prepared according to instructions.

The Need

I was recently using multiple machines for work (Lab machines, friend’s laptop, etc) and I needed Linux. I own a 128GB MacBook Air I could’nt install Linux on it as storage was tiny. I did have a USB 3.0 flash drive which had speeds comparable to some(not-so-fast) harddrives. It struck me that if I install Linux on my flash drive it would make my life a hell lot easier. It was later that I realised it wasn’t so straight forward mainly because of EFI boot and Mac ‘quirks’. I did a lot of googling but could’nt find anything that worked. After reading multiple sources I deduced what was the problem. Since I got it figured out I decided to write this post so that other people can benefit from it.

The problem

  • Modern Macs boot using EFI and their bootloader expects boot partition to be HFS+ or APFS(High Sierra) not EXT4.
  • Ubuntu installer is buggy and always installs bootloader in EFI partition of internal HDD despite being instructed to install it on EFI partition of flash drive.
    • This makes the flash drive only bootable on the mac it was made on

The Solution

Step 1: Preparing live USB for installation
  • Download https://unetbootin.github.io/

  • Download your favourite Ubuntu flavor, Im using Ubuntu Mate

  • Burn the iso to a USB drive(not on your installation flash drive) using UNetbootin

Step 2: Boot using live installation drive
For
  • Plug both drives and press option+power button

  • Choose EFI boot option

  • Choose Try Ubuntu without Installing

Step 3: Install Linux on target flash drive
  • Once into the live session, open terminal and run ubuquity —no-bootloader , this will start installation wizard in a mode that wont install a bootloader (Dont worry we will take care of it later)
Fig 1: Run installer with no-bootloader option
Ubuntu make bootable usb mac os
  • Keep going next untill an option comes as shown in below image. Choose Something else
Fig 2: Choose this option
  • On your target drive, create a 200MB EFI System Partition as the first partition (Primary)
  • Create a reasonable sized ext4 partition, with mount point = ' (Primary)
Usb
Fig 3: Sample partitions
  • Click on Install
  • Reboot into Mac after installation finishes
Step 4: Setting up Boot manager

We will be using a super awesome 3rd party boot manager rEFInd. It can detect any operating systems installed in EFI mode and boot them.

  • Download rEFInd zip and extract it
  • Open Terminal and navigate to rEFInd directory
  • Run diskutil list and find the name of your flash drive’s EFI partition. (In my case /dev/disk2s1)
  • Run ./refind-install --usedefault /dev/diskXXX (replace XXX with appropriate name)
Fig 4: Output must be similar to this

Now your flash drive is ready to boot on any Mac or EFI compatible PC. Moreover, if you ever mess up your bootloader and are unable to boot rEFInd can help you boot into your OS (if it exists :p)

Ubuntu bootable usb for mac usb

Testing on Mac and PC

MacBook Air (Early 2015)
  • Press option+power and select EFI Boot
Fig 5: rEFInd screen
  • Select your apropriate Linux to boot
Fig 6: MacBook booted
Asus X550LD (PC)
  • Boot from flash drive in UEFI Mode
Fig 7: rEFInd screen
  • Select your apropriate Linux to boot
Fig 8: PC booted

CDs are long gone and if you want to reinstall an operating system, a bootable USB drive is the one required. Let’s learn how to create a bootable USB disk from Ubuntu using terminal today. We’ll be creating a bootable USB of the Ubuntu ISO file, but you can work with any ISO file that was designed to be written to a CD to be bootable.

The Steps to Create a Bootable USB Disk

So as I mentioned, we’re working with the Ubuntu ISO file here to create a bootable USB disk, but you can replace the ISO with any other ISO that’s built to be bootable and then follow the tutorial exactly as is.

For Ubuntu, we need a USB disk that’s 8GB so we can have all the files. If you’re working with any other ISO or operating system, the storage requirements will be different.

1. Download the ISO File

To create a bootable USB disk from the Ubuntu terminal, we need to download the ISO file first. In my case, I’m downloading the Ubuntu ISO file for version 20.04. You can choose to download the ISO for another operating system that you want to write to USB. You can follow this link to reach the Ubuntu download page – https://ubuntu.com/download/desktop

Select the package which you wish to set up your bootable USB drive with. For this demonstration, we are using the Ubuntu 20.04 (Codename Focal Fossa). You can either directly download the file by clicking on the Download link on the page or use the wget command to get the file on your system.

2. Connect the USB drive

Once we have downloaded the correct disk image file, we will open the terminal and connect our USB drive. One that’s done, our next step is to figure out the drive name using the Linux fdisk -l command

This will give you a list of all the disk drives that are available on the system. You’ll see a separate section with just a single disk path like /dev/sdb1 with a mount path that’s different from the common ones in Linux (like /home/, /etc/, /boot/ etc.). With Ubuntu, the default mount point is in the /media/ directory. Mine was mounted on the /mnt/

3. Unmount the USB stick

Since Ubuntu automounts any external device that’s connected, we need to unmount it so we can proceed to write the ISO to the USB. We use the umountcommand for this purpose. This action can be executed in two different methods.

The first method will involve using the path at which our USB device has been mounted. This command should look like this.

In this particular case, we will use the command as given below.

This will unmount the USB disk from our system.

Alternatively, we can use the device’s name in this format.

In this particular case, we will use the command as given below to unmount the USB disk.

Now that the device has been unmounted, we will make a bootable drive using it.

4. Write the ISO to the USB Disk

Our USB disk has been unmounted and our ISO file is already downloaded on our system. Now we will make this USB drive bootable for Ubuntu 20.04 using one single command. This is how you enter this command in the terminal.

  • This command requires us to use sudo privileges.
  • The bstag reads the number of bytes which will be read from the source and written to the destination at a time.
  • The second tag, if denotes the path of the input file for the function
  • Whereas ofdenotes the path where the file has to be output to.

The thing about the dd command in Linux is that it will do anything you ask it to do without asking any questions. Hence, we need to use the command carefully. Before you begin writing, ensure that the output path is the path that you want to write the data to. There’s no turning back once the data has been written.

Make Ubuntu Bootable Usb For Mac

For our system, we will use the command as given below to create our bootable USB disk for Ubuntu 20.04.

This should start the process of writing the ISO image file on your USB disk and converting it into a bootable drive. You should see a screen as given below. Once you are done, which should take only a few minutes, your USB disk is ready to work as a USB bootable disk for Ubuntu 20.04.

Ubuntu Bootable Usb For Mac Usb

Wrapping up

Create Ubuntu Bootable Usb

There are multiple methods to create a bootable USB disk for the Ubuntu OS. Using the terminal for the task is a commonly used method because it eliminates the need for you to install any additional software. Further, it often takes less time to create a bootable USB disk from the Ubuntu terminal as compared to other methods like using the Startup Disk Creator or installing some other software.

Ubuntu Bootable Usb For Mac Os

Hence this method is advisable even if you are not much comfortable with the terminal-based commands. It eliminates the need for any GUI software, which may be unavailable in some situations. The only major flaw in this method is the lack of a safe-check with the dd command, but it can be eliminated by carefully entering the command. This tutorial aimed to help you create a bootable USB disk from the Ubuntu terminal. If you have any feedback, queries or suggestions, feel free to reach out to us in the comments below.