How to Create Bootable Ubuntu 18.04 USB Stick on Linux

Posted 

3 min read

In this tutorial, we will show you how to create a bootable Ubuntu USB stick from the Linux terminal. You can use this USB stick to boot and test out or install Ubuntu on any computer that supports booting from USB.

Prerequisites

  • A 4GB or larger USB stick drive
  • Computer running any Linux distribution
  • Ubuntu ISO file. Visit the Ubuntu downloads page where you can find download links for Ubuntu Desktop, Ubuntu Server and various Ubuntu flavors. Most likely you will want to download the latest Ubuntu LST Desktop version.

Creating Bootable Ubuntu 18.04 USB Stick on Linux

While there are many different GUI tools that allows you to flash ISO images to USB drives, in this tutorial, we will create a bootable ubuntu 18.04 USB stick using the dd command.

Creating Bootable Ubuntu 18.04 USB Stick on Linux is a quick and easy process, just follow the steps detailed below.

  1. Start by inserting the USB flash drive into the USB port.

  2. Find out the name of your USB drive with the lsblk command:

    lsblk

    The output will look like this:

    NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
    sda           8:0    0 465.8G  0 disk 
    └─sda1        8:1    0 465.8G  0 part /data
    sdx           8:16   1   7.5G  0 disk 
    └─sdx1        8:17   1   7.5G  0 part /run/media/linuxize/Kingston
    nvme0n1     259:0    0 232.9G  0 disk 
    ├─nvme0n1p1 259:1    0   512M  0 part /boot
    ├─nvme0n1p2 259:2    0    16G  0 part [SWAP]
    └─nvme0n1p3 259:3    0 216.4G  0 part /

    As you can see from the output above, the USB device is /dev/sdx but this may vary on your system.

  3. Most Linux distributions will automatically mount USB flash drive when inserted. Before flashing the image make sure the USB device is not mounted. To do so use the umount command followed by either the directory where it has been mounted (mount point) or the device name:

    sudo umount /dev/sdx1
  4. The final step is to flash the Ubuntu ISO image to the USB drive. Make sure you replace /dev/sdx with your drive and do not append the partition number. Also, replace /path/to/ubuntu-18.04.2-desktop-amd64.iso with the path to the ISO file. If you downloaded the file using a web browser then it should be stored in the Downloads folder located in your user account.

    sudo dd bs=4M if=/path/to/ubuntu-18.04.2-desktop-amd64.iso of=/dev/sdx status=progress oflag=sync

    The command will show a progress bar while flashing the image.

    The process may take several minutes, depending on the size of the ISO file and the USB stick speed. Once completed you will see something like below:

    458+1 records in
    458+1 records out
    1921843200 bytes (1.9 GB, 1.8 GiB) copied, 147.006 s, 13 MB/s

That’s all! You have a bootable Ubuntu on your USB stick.

Conclusion

You have learned how to create a bootable Ubuntu USB stick from the Linux terminal.

If you hit a problem or have feedback, leave a comment below.