Faster Learning Tutorials

Create a Linux Bootable USB drive

A process with many names (bootable USB, bootable pendrive, boot flash drive, USB installer, bootable thumb drive) should take less than 5 minutes.
  1. Overview - Review how to burn the ISO to USB drive for a Linux server installation.
  2. Which client OS? - Decide on which client operating system to use to make a bootable USB.
  3. Linux server - Review steps for each OS: Linux, Mac and Windows.
  4. Considerations - Discuss ISO to USB steps at the commands line.
  5. Up next: install - Prepare for a Linux installation.
Paul Alan Davis, CFA, January 23, 2017
Updated: August 11, 2018
So that is how we will do it, let's get started.

Outline Back Next

~/ home  / tech  / full stack  / linux bootable usb

How to Make a Bootable USB drive suitable for a Linux ISO download


Video Tutorial

Create a Linux Bootable USB drive for an ISO to USB Install (4:50)

Videos can also be accessed from our Full Stack Playlist 1 on YouTube.

Code Examples and Video Script

Welcome. Today's question: How do you create a Linux-bootable flast USB drive?

I'm Paul, and if you're like me, then you want to speed through hardware setup, so you can get right to the fun part, data analysis.

Step 1 - Overview

Here's the overview. The project is to set up this Lenovo computer as a local Linux server, for exercises in Data Science and we need to download a file, called an ISO image, and create a USB stick to boot from, as introduced in the last video (tutorial).

Step 2 - Which client Operating System?

So if we're on the same page, then the next question is: which operating system will you be using to create the USB drive? Because the procedures for Linux, Mac and Windows are different.

I'll start with a few commands on the Linux server, then jot down notes in a text file, where I'll discuss considerations and point you to where you can find help, being mindful that there are too many scenarios to cover all three operating systems in four minutes.

Also, my Linux distribution is Debian, so I'll refer to suggestions in their documentation, and then in video 7, we'll do the install.

Step 3 - Linux Server

Here's our window into the server, after I installed Linux on my end, as this command shows.

paul@fullstack:~$ lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 8.6 (jessie) Release: 8.6 Codename: jessie

These instructions are as of this date today.

paul@fullstack:~$ date Mon Jan 23 10:56:58 PST 2017

Next, I'll change the directory to notes, create a new text file using nano, and here we go.

paul@fullstack:~$ cd notes paul@fullstack:~$ nano video0006.txt

And here we go.

Step 4 - Considerations

GNU nano 2.2.6 File: video0006.txt Your operating system: - Linux sudo cp name_of_downloaded_file.iso /dev/sdX sync - Windows Win32 Disk Imager UNetbootin - macOS (may require superuser/sudo privilege) - Format the USB drive - Disk Utility - Terminal - Save ISO file to UDRW format diskutil list dd if=file.iso of=/dev/disk2 bs=1m diskutil eject /dev/disk2 ^G Get Help ^O WriteOut ^R Read File ^Y Prev Page ^K Cut Text ^C Cur Pos ^X Exit ^J Justify ^W Where Is ^V Next Page ^U UnCut Text ^T To Spell

First, Linux. Years ago most Linux installations were performed with the CD/DVD option and now the USB flash drive option is popular, for obvious reasons. In fact, some manufacturers skip optical media altogether, like the Lenovo computer you saw earlier. If you are using Debian, please review the Installation Guide for specifics. There you will find an option allowing you to copy the CD/DVD version ISO straight to a USB drive with one partition, using a command like this.

$ sudo cp name_of_downloaded_file.iso /dev/sdX $ sync

Where sudo gives superuser privileges, cp to copy, the name of the downloaded file you selected for your hardware, then the destination /dev/sdX, where X is the device number, the the command sync to write RAM to disk. (Be very careful to select the appropriate device number or you may write over your hard drive!!)

Next, Windows. The suggested method from Debian is to download a program called Win32 Disk Imager. Also, some use UNetbootin for Windows and I've included a line to both, but as full disclosure, I opted not to take this route.

MacOS was the route I took. I plugged in the USB drive, and after it was recognized, I used the Disk Utility program in the GUI to format the USB drive. but I could have easily done this at the command line in the program called Terminal.

Using the GUI, I selected the whole device, not the partitions, hit erase, then gave it the name debian8, and where I saw format, I used FAT and GPT for the partition table.

The second step didn't make sense at first, so here's a tip, the ISO file downloaded isn't directly bootable, and must be saved to the USB drive in the proper format, called UDRW, for Universal Disk Read and Write. For this I went to the Mac Terminal and used the diskutil command to find the name of the USB, normally named /dev/disk2.

$ diskutil list

Next, I used the dd command noted here.

$ dd if=file.iso of=/dev/disk2 bs=1m

In my case, where you see file.iso, I substituted in the name of the file specific to my hardware. I was careful with the output file part here (of=/dev/disk2 bs=1m).

$ dd if=file.iso of=/dev/disk2 bs=1m

It did take about a minute, then I ejected it and voila, a bootable USB.

$ diskutil eject /dev/disk2

Now, I will close this file Ctrl-x y Enter (and the Linux Terminal session).

paul@fullstack:~/notes$ exit

I'll remind you to read the documentation for your distribution as this video was meant to be a summary, not a step-by-step guide.

Step 5 - Up next: install

So you can see where we are headed in this Playlist (pointing to Advanced Data Science).

Here is a picture of some of the software we're building on this Linux Server.

  • Client : HTML, CSS, JavaScript
  • Software : Python Scientific Stack
  • Data : PostgreSQL, MySQL
  • OS : Linux (command line), Debian

You are welcome to join at any time, and in our next video we will install Debian Linux.

Have a nice day.

What's Next?

The journey to Data Science has just begun, join us on our YouTube Channel. Subscribe here.

  • To access all tutorials, click Outline.
  • To see how to prepare for a Debian Linux installation, click Back.
  • To walk through screens you will see in the Debian installation, click Next.

Outline Back Next

~/ home  / tech  / full stack  / linux bootable usb

linux bootable usb
bootable usb
boot usb
iso to usb
iso image download
boot usb
linux server install
bootable pendrive
boot usb
linux usb installer
pendrive linux
bootable flash drive
bootable thumb drive
data science tutorial