When you create a bootable Linux or Ubuntu USB, it lets you access a live session of the OS apart from allowing you to install the OS on your system. This is really useful when you want to do something and don’t have an operating system installed on your PC. This is also helpful if your PC refuses to boot. There can be many other similar situations, but this live session has one problem. Every time you boot, it’s a blank slate. You can install programs, make changes to the OS, customize it, but as soon as you shut down, all the changes are lost. This is good for most people, but if you want a system that picks up where you left off, you can create a persistent Ubuntu USB.
What is a persistent Ubuntu USB?
It’s a bootable Ubuntu USB but with persistent storage. As the name suggests, the user data from the live session is persistent, i.e., it does not disappear after reboot. This is done via a persistent overlay file that stores all the information about the changes. Any programs you install, the settings you change, are all written to this file. You’ll have to allocate a part of your USB storage to this persistent file. You can theme the system, but you cannot change any system files such as the kernel. You won’t be able to install major system upgrades, such as an update from Ubuntu 17.04 or 17.10 to 18.04. Additional hardware drivers also cannot be installed.
Other than that you can do pretty much everything else. You can install programs, update them, save your files, customize your OS, it’s pretty much like carrying your OS on your USB. All you need is the hardware to boot it up and use it. This can be anyone else’s computer or other computers you may have around. You won’t have to start from scratch each time you boot your Ubuntu live session. Persistence does not work with all Linux distributions but it does work with Ubuntu and Ubuntu-based systems. We have a detailed guide on enabling Flatpak support on Ubuntu and you might find that interesting.
Steps to create a persistent Ubuntu USB
To create a persistent Ubuntu USB, you will need the mkusb tool which is easy to install if you’ve installed programs on Ubuntu before. You’ll need to do this via the official ppa using the terminal. Before you can do this though you’ll also need to enable the universe repository for your Ubuntu system if you haven’t already. You can do this via the graphical interface but simply pasting the command below in a terminal would be much easier.
sudo add-apt-repository universe
- To install mkusb, enter the following commands one by one.
sudo add-apt-repository ppa:mkusb/ppa sudo apt-get update (Ubuntu 18.04 users can skip this step) sudo apt-get install mkusb
This will install the GUI version of mkusb.
- Run the tool via the Terminal using this command.
sudo -H mkusb /path/to/iso/filename.iso p
/path/to/iso/filename.isowith the path to the Ubuntu ISO file and the correct file name. For instance,
sudo -H mkusb ubuntu-18.04-desktop-i386.iso p
- You’ll be provided with a list of options, type e and hit enter.
- In the new window that opens up, click on Select target device:
- Click on the USB drive that you want to install the Ubuntu ISO with persistent storage and click OK.
- Make sure you have selected the right drive because the process will wipe all the data on the drive. When you’re ready, check the checkbox as shown below and click Go.
- In the dialogue box that appears next, select Quit from this menu. This will let mkusb choose the default option.
- Next, select the percentage of storage you want to allocate for persistence. If you have enough space on your USB as I had with a 32GB USB, 20 would be a good number to enter here.
- The process can take a few minutes, but if everything goes well, you’ll see something like the window below with a message, click OK.
You can now remove the USB and use it to boot on any available computer. You’ll find that any of the changes you make are saved and still there on the next boot. When it comes to the file systems, Linux users got some good options. Check out which File System should you be using on Linux.