A standard live USB lets you boot an operating system without installing it on your hard drive. However, any changes you make during the session, such as installing software or editing documents, are not saved once the system is rebooted. A persistent live USB is designed to retain these changes by allocating a portion of USB storage space as a persistence overlay
, where all modifications during a session are saved, leading to a portable and fully functional operating environment .
What Is a Persistent Live USB and How Does It Work?
A persistent live USB is essentially a portable Linux system that saves your data, installed applications, and system settings between reboots . It uses a special file or partition to store changes made during a live session. The technical mechanism varies depending on the Linux distribution family:
Ubuntu, Linux Mint, and Ubuntu-based distros (casper): The live session manager (casper) checks for a file named casper-rw in the USB's root directory or a partition with the label casper-rw. This file acts as a "virtual hard drive" for the live Linux system, allowing it to save changes instead of discarding them when you shut down . The casper-rw loop file is essential for persistent saving because it eliminates the need for separate partitions on the USB drive, making setup simpler and more compatible with different USB formats .
Debian and Debian-based distros (live-boot): Debian uses a different mechanism that requires a volume (partition or loop file) labelled persistence containing a persistence.conf file that lists what to persist. The config file typically contains a single line: / union, which persists the whole root via an overlay . Without persistence.conf, live-boot ignores the persistence volume entirely .
Tools and Methods for Creating Persistent Live USB
Rufus (Windows)
Rufus is a popular tool for creating bootable USB drives with persistence capability on Windows systems . The process is straightforward:
-
Download the latest Ubuntu ISO from the official Ubuntu website .
-
Choose partition scheme: "MBR" for BIOS or UEFI compatibility, or "GPT" for a GPT system exclusively .
-
Under "Persistent partition size," move the slider to allocate space for persistent storage .
-
Click "Start" to initiate the process.
Rufus has been noted to have inconsistent results with some Linux distributions, and users sometimes find that persistence does not work as expected with certain distros .
mkusb (Linux Native)
mkusb is a powerful tool for creating persistent live drives that works natively on Ubuntu, Linux Mint, Elementary OS, and other Ubuntu-based distributions . It can create persistent live drives that work with both UEFI and BIOS modes, and the persistent partition it creates uses casper-rw, which allows it to have a size larger than 4GB .
To install mkusb:
$ sudo add-apt-repository ppa:mkusb/ppa $ sudo apt update $ sudo apt install --install-recommends mkusb mkusb-nox usb-pack-efi
The mkusb tool provides a graphical interface using Zenity and guides users through the process :
-
Open the mkusb application and select "Install (make a boot device)".
-
Select the ISO image of your chosen distribution.
-
Select the USB device as the target.
-
Choose the "upefi" option, which allows Grub to work in both BIOS and UEFI modes .
-
Select the percentage of available space to be assigned to persistent storage. The remaining space is used for a partition called
usbdataformatted as NTFS, accessible from any operating system .
Universal USB Installer (Windows)
Universal USB Installer is a compact Windows tool that supports persistent storage for numerous Linux distributions . It guides the user through the process by selecting the USB drive, choosing a distribution or loading an existing ISO image, and configuring the persistent storage . The tool works portably without installation and supports both BIOS and UEFI systems .
LinuxLive USB Creator (LiLi) (Windows)
LinuxLive USB Creator, also known as LiLi, is a Windows utility designed to simplify the creation of bootable USB drives with Linux systems . It supports persistence and offers a numbered step-by-step interface that guides users through the process without requiring technical knowledge . One distinctive feature is that LiLi does not require the USB drive to be exclusively formatted for Linux; users can maintain personal files on the same device while the program organizes the space appropriately . However, the project went years without significant updates, leading many users to migrate to alternatives .
Advanced Manual Method
For users who prefer more control or need to create a persistent USB from a non-Windows environment, a manual approach is possible:
-
Create a live USB using a tool like Balena Etcher or Rufus.
-
Create an additional partition on the USB drive. For Ubuntu-based distros, this partition should be formatted as ext4 and labelled
casper-rw. For Debian, the label should bepersistenceand it must contain apersistence.conffile with/ union. -
Modify boot parameters to add the
persistent(Ubuntu/Mint) orpersistence(Debian) kernel argument .
Using Ventoy for Multiple Distributions
Ventoy is an innovative tool that allows multiple ISOs on a single USB drive, enabling users to choose which distribution to boot . It supports persistent storage through configuration files placed in a ventoy folder on the USB drive . To set up persistence with Ventoy:
-
Install Ventoy to the USB drive.
-
Copy the Linux ISO files to the USB drive.
-
Create a
ventoy.jsonfile in theventoyfolder with persistence configuration for each ISO .
Important Considerations
USB Drive Requirements: A USB drive with a minimum of 4GB capacity is recommended, although 8GB or more is preferable for better performance and more storage . USB 3.0 or higher speeds significantly improve system performance and file transfer speeds .
Limitations: Persistent live USBs have several limitations:
-
Wayland sessions may be unavailable on some configurations .
-
Boot and shutdown times are slower than a full installation .
-
Kernel upgrades are not possible without rebuilding the live ISO .
Factory Reset Capability: One advantage of persistence is the ability to "factory reset" the live system by deleting everything in the writable partition, allowing the system to boot like new again while preserving the base live environment .
Full Installation Alternative: For users who find persistence limiting, performing a full installation to a USB drive (treating it as a hard drive) offers a more stable and flexible solution, although it requires more space and a different setup process
Claire Jones
Cloud Engineer / Technical Writer
eBits Tech Platform @ ebits.icu