eph baum dot dev

← Back to blog

How to Create Bootable USB in Linix Terminal

Published on 05/05/2022 02:46 PM by Eph Baum

Featured Image

I’m tired of forgetting these steps, so they’re here for me for later but I hope they help you too.

TL;DR

sudo dd if=distro.iso of=/dev/sda status=“progress”

L;R

You’ll need two things to accomplish this process

To make a bootable USB drive, you need a USB flash drive that is larger than the disc image you’re trying to write and a bootable disc image in ISO format.

Whatever the size of your USB flash drive, it will be constrained to the the size of the image you’re creating, additional space will no longer be accessible.

First, insert your drive.

Make sure the drive is seen by your OS, and find out if it’s mounted or not using any number of programs like LSBLK or FDISK. Your drive should appear like /dev/sda or /dev/sdb, and you might see a numbered partition as well like /dev/sda1 for example.

Make sure that the drive is not mounted (unmounted):

umount /dev/sda

Where /dev/sda is the path or your drive.

Next you’ll want to format the drive. THIS WILL ERASE THE DRIVE!!!

sudo mkfs.ext4 /dev/sda1

This should be straightforward and simple, you’ll see some status related to the progress and then you’ll have a fresh drive.

Finally, make sure you’re in the directory where your downloaded ISO file lives and then write it to the flash with DD. For example: if you’re creating a bootable Puppy Linux install disk and your ISO file is puppy-linux.iso and your USB is attached at /dev/sda your command would look like this:

sudo dd if=puppy-linux.iso of=/dev/sda status=progress

The if parameter is ‘input file’ while of is, unsurprisingly, ‘output file’

The status parameter being set to progress gives you regular feedback while the process is running, which is particularly useful for very large image writes that could take a little time and feel like your machine has hung or something.

And that’s it.

Seriously, it’s really easy, I just sometimes forget a step or two.

Arguably it’s easier than Rufus or Balena Etcher, which you’d probably want to use if you’re on macOS or Windows (or even Linux, which is an option for Balena Etcher, if you’re so inclined)

Written by Eph Baum

← Back to blog
  • 50 Stars - Puzzle Solver (of Little Renown)

    50 Stars - Puzzle Solver (of Little Renown)

    Join Eph Baum as they recount their journey through the Advent of Code 2023. For the first time, Eph completes all puzzles, leveraging resources like GPT-4 and Code Llama. Despite the challenges and time constraints, Eph not only stays on top of the puzzles but also lands on the top 1,000 leaderboard. Dive into this post to explore the role of generative AIs in problem-solving and the joy of coding puzzles. - GitHub Co-pilot

  • Don't Trust AI - An Advent of Code Tale

    Don't Trust AI - An Advent of Code Tale

    Join Eph Baum in 'Don't Trust AI - An Advent of Code Tale' as they navigate the Advent of Code 2023. Despite the December rush, Eph is determined to complete all puzzles. This post shares an intriguing incident where an AI-generated code line proves less than helpful. Eph's journey underscores the importance of verifying AI suggestions, especially when optimizing code. Dive in to explore the challenges and triumphs of coding puzzles, and the role of AI in this process. - GitHub CoPilot

  • Condoning Another Pi Day

    Condoning Another Pi Day

    Placeholder description for imported post from Ghost Blog

  • ANSI Terminal Colors

    ANSI Terminal Colors

    Placeholder description for imported post from Ghost Blog

  • WTF is Idiomatic

    WTF is Idiomatic

    Placeholder description for imported post from Ghost Blog

  • From Early Return in OOP to Control Flow in Elixir - A Transition Guide

    From Early Return in OOP to Control Flow in Elixir - A Transition Guide

    Placeholder description for imported post from Ghost Blog