2018 / 01 / 02
2020 / 02 / 07
How to create an Ubuntu live USB using the CLI

Using only the dd command :)

live usb

If the Startup Disk Creator app is not working for you or takes forever to finish, or always present an error at the end… Why don’t you try deploying the Ubuntu ISO from the CLI?

It’s super easy, let’s see how.

Be sure to have an .iso file ready, or download the latest Ubuntu image from here.

Find the right letter for your device

Insert the stick into a port and get a list of connected devices with this:

sudo fdisk -l

Identify the letter for your drive on the output, in my case the drive I’m looking for is this one:

/dev/sdb1          8192 15636863 15628672  7.5G  c W95 FAT32 (LBA)

I can tell because it’s —supposedly— an 8GB device, look at the 7.5GB size reported above.

In this example, the letter for the drive is the b from sdb. It could have been c, d or something else.
Just make sure that it is indeed the drive you want to trash.
You won’t be able to recover anything from it once it’s been zeroed.

Zero the bits out of the USB drive

Next, let’s zero the drive out, this serves as a security measure and also it allows you to tell if the drive is still functioning well —if the drive is dying, the process will take an unusual long time, or it’ll get stuck before reaching the end, that’s a sign that you need to get a new USB.

Ok, let’s write zeros all over the USB drive with:

sudo dd if=/dev/zero of=/dev/sdX bs=1M status=progress conv=fdatasync

It’ll be reporting progress back to you.

Copy the ISO image to the USB drive

When finished, go to the directory where you downloaded the .iso file, and deploy it to the USB like this:

sudo dd if=ubuntu-image.iso of=/dev/sdX bs=1M status=progress conv=fdatasync

That’s it, now you should have a bootable USB with Ubuntu in it!