loading...
Cover image for How to create an Ubuntu live USB using the CLI

How to create an Ubuntu live USB using the CLI

lobo_tuerto profile image Víctor Adrián Originally published at lobotuerto.com on ・2 min read

You can check the latest updated version of this article at lobotuerto's notes - How to create an Ubuntu live USB using the CLI.


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=4M 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=4M status=progress conv=fdatasync

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

Posted on by:

lobo_tuerto profile

Víctor Adrián

@lobo_tuerto

Fullstack Developer — Specializing Generalist — UI Engineering ⚫ Elixir, Phoenix, Javascript, Vue.js, Material Design, D3, HTML, CSS ⚫ Gamedev/VR/ComputerArt hobbyist ⚫ Aspiring Zen Buddhist

Discussion

markdown guide