Making bootable USB sticks

Bootable distro USB sticks

Below I’m demonstrating a command-line way of writing the .iso image of Xubuntu onto a USB stick. Ubuntu’s site and Elementary OS’s site have good instructions on how to do this in Windows, Mac OS X or Ubuntu.

Or just use the super simple cross-platform application Etcher to write the image:

Etcher image burner

Before doing this, however, it’s recommendable to verify the downloaded .iso file. Many people decide to skip this phase, I did too, but every now and then I later find out that I had written an uncomplete .iso file into the USB stick and needed to download and check the .iso again to be sure.

So, after the verification is done, stick the USB stick in and run in the terminal:

# List block device information:
lsblk

Check the USB stick’s location (sdc, for example):

The results of the lsblk (list block device information) command

And then unmount its first partition (sdc1):

sudo umount /dev/sdc1

After that, use the dd command to overwrite the .iso image to the whole USB drive (use the drive letter you saw before, in this case /dev/sdc):

# Using the dd command to write the .iso image to the USB drive. Replace "/storage/Distros" with the path where you downloaded the image into:
sudo dd bs=4M if=/storage/Distros/xubuntu-16.04.1-desktop-amd64.iso of=/dev/sdc && sync

The terminal intentionally freezes for a while, which means it’s in the middle of the write-process. It will take 2–10 minutes for the .iso to be written to the drive.

Finally, the write-process says something like:

388+1 records in
388+1 records out
1631322112 bytes (1.6 GB) copied, 173.498 s, 9.4 MB/s

Which means it’s done.

You’re now free to restart the computer.

Note, if you want to replace a distro on a USB disk with another one, there’s no need to format the stick for that. Simply just run the commands above again and everything will be automatically overwritten.