Warning: This will erase all data on your USB drive.
You can use a bootable Linux USB stick to:
- Install or upgrade you current operating system
- Test or use Linux without affecting you current operating system
- Repair your current operating system
This guide covers creating a bootable USB stick whilst using Linux. They can also be created from Microsoft Windows and Apple macOS.
Using Startup Disk Creator
If you are using Ubuntu or one of its derivatives, you can easily create a recovery USB using a program called Startup Disk Creator. This can be installed from the Ubuntu Apps Directory or by using the below command:
sudo apt install usb-creator-gtk -y
Once installed, open Startup Disk Creator.
It will automatically look for any ISO files in your Downloads folder, as well as any attached USB storage. If you do not see you ISO, click Other... to manually locate your downloaded ISO file.
Click Make Startup Disk to create the bootable USB stick. You will be asked to confirm the correct disk has been selected as this will erase all data on the USB drive.
The process is now complete and your bootable USB stick is ready to use.
Using the terminal
Navigate to the folder where the downloaded ISO is. For example, if you downloaded the ISO to your Downloads folder, you could type:
To check you are in the right directory, you can use the below command. This will list all ISO files.
ls | grep .iso
The below command will list the disks connected to your laptop.
sudo fdisk -l | grep sd
The easiest way to identify the USB drive is to run the command with the USB drive disconnected, and then run the command again with the USB drive connect. You will then be able to identify the new entry. It will be in the format of /dev/sdx.
The below example will use /dev/sda but if your USB is sdb or sdc, use this accordingly.
Once the drive has been identified, run the below command to un-mount any partitions that may be on the drive.
sudo umount /dev/sda*
After that, run the command to image the drive. This will erase all data on the drive. The below example uses an Ubuntu 18.10 ISO but you can replace this with the name of your downloaded ISO.
sudo dd if=ubuntu-18.10-desktop-amd64.iso of=/dev/sda bs=1M
There will be no indication of progress but you can tell the process is complete once the terminal returns to a new line with a flashing cursor.
Your drive is now done and the process is complete.