How to Make an Ubuntu 18.04 USB Installer on Linux
In this tutorial, we will show you how to create an Ubuntu installer on a USB stick that can be booted from a Linux terminal.
You can use this USB stick to boot and test or install Ubuntu on any computer that supports booting from USB.
Precondition
USB stick drive 4GB or larger
The computer runs a Linux distribution
Ubuntu ISO file. Visit the Ubuntu download page where you can find download links for Ubuntu Desktop, Ubuntu Server and various Ubuntu flavors.
Make a Bootable Ubuntu 18.04 USB Stick on Linux
Although there are many GUI tools that allow you to flash ISO images to a USB drive, in this tutorial, we will make a bootable Ubuntu 18.04 USB using the dd command.
Making a Bootable Ubuntu 18.04 USB Stick on Linux is a quick and easy process, just follow the steps outlined below.
Insert the USB flash drive into the USB port.
Find out the name of the USB drive with the lsblk command:
lsblk
The output will look like this:
MAJ NAME: MIN RM SIZE RO TYPE MOUNTPOINT
sda 8: 0 0 465.8G 0 disk
└─sda1 8: 1 0 465.8G 0 parts / data
sdx 8:16 1 7.5G 0 disk
└─sdx1 8:17 1 7.5G 0 part / run / media / linuxid / Kingston
nvme0n1 259: 0 0 232.9G 0 disk
├─nvme0n1p1 259: 1 0 512M 0 parts / 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 might be different on your system.
Most Linux distributions will automatically mount a USB flash drive when inserted. Before flashing the image, make sure the USB device is unmounted. To do this, use the umount command followed by the directory where it was mounted (mount point) or the name of the device:
sudo umount / dev / sdx1
The final step is to flash the Ubuntu ISO image to a USB drive. Make sure you replace / dev / sdx with your drive and not add the partition number. For /path/to/ubuntu-18.04.2-desktop-amd64 is the path to the ISO file. If you download a file using a web browser, the file will be stored in the Download 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 display a progress bar when flashing the image.
The process may take several minutes, depending on the ISO file size and USB stick write speed.
When finished you will see an output similar to the one below:
458 + 1 records ina
458 + 1 records out
1921843200 bytes (1.9 GB, 1.8 GiB) copied, 147,006 s, 13 MB / s
At this point you already have an Ubuntu installer that can boot on your USB stick.