Make a Casper Persistent File from Windows

Use the Linux persistent USB file creator to make a casper rw persistent file or writable persistence loop file for Ubuntu based distributions. Written for use from within Windows, this tool enables you to quickly create a loopback filesystem image to use for saving and restoring Ubuntu changes while booted from a live USB.

About Casper rw persistence

Casper-rw is a term associated with Ubuntu based live USB drives. It refers to a special loop file or partition that acts as a virtual block device. Also known as a persistent overlay images, these casper-rw block files work as a companion to your Ubuntu live bootable USB, allowing you to save your custom changes, settings, and stored files between sessions.

Whilst running from a live USB version of Ubuntu or one of its derivatives, this unique feature enables a Live system to act similar to a full installation. Albeit with some exceptions like not being able to perform some system and kernel updates, as those types of changes are stored outside of the overlay image.

  • What is a Live USB Drive? A Live USB drive is a portable storage device (usually a USB flash drive) that contain bootable operating system(s). Users can plug these drives into a computer and boot from them, enabling them to run the operating system without installing it on the computer's hard drive.
  • What is Persistence? By default, when you boot from a live USB, any changes you make to the operating system, such as installing new software, modifying settings, or saving files, are lost when you shut down or reboot the computer. This is because the live USB loads the operating system into RAM, and RAM is volatile memory.
  • What is Casper? In Ubuntu based live USBs, the "casper" or "writable" component is responsible for this live session functionality. It allows the operating system to run entirely from the USB drive and creates a temporary file system in RAM. However, casper itself does not provide persistence.
  • What is Casper-rw? To enable persistence and allow users to save changes, a casper-rw file or partition is added to the live USB drive. This storage area acts as a writable overlay on top of the read only live system. It's essentially a place where changes and data can be stored and retrieved between sessions. The "rw" in "casper-rw" stands for "read-write," signifying its role in providing a writable space.
  • Casper-rw use case: Casper-rw is especially useful for users who want to create a portable, customizable Ubuntu environment on a USB drive. For example, you can install additional software, customize the desktop, and save files to the persistent storage space, and these changes will persist across reboots.
  • Casper-rw file size considerations: The size of the casper-rw space can vary depending on how much space you allocate during its creation. When using a loop file for persistent storage, you'll also need to consider any file size limitations on the type of filesystem format being used; for example the 4GB file size limit on Fat32 filesystems. It's important to choose an appropriate size based on your use case and needs, as it ultimately determines how much data you can save.

Casper-rw allows users to save some changes, settings, and files while booted and running from Ubuntu based live USB drives. It provides persistence by offering a writable overlay on top of the booted read only live environment, making the following a valuable tool for creating persistent portable Ubuntu installations.

Casper-rw Persistent File Creator

Make a Casper Persistent File - Pen Drive Linux
Source Code SHA-256: 69116a284e1d56b8a06730902bc0a5d440463a78d1620df4df1d500066d0dceb
Important: Some Ubuntu based distributions starting from 20.04 onward started to require both the volume label and file to be named writable. Whereas, 19.10 and lower used casper-rw for the volume label and file name.

How to Make a Casper Persistent Block File

Proceed to create a persistent file using the following easy steps:

  1. Download Persistence File Creator and run the executable.
  2. First, select your USB Flash Drive from the drop down.
  3. Then choose which filename to create; casper-rw or writable
  4. Using the slider, set the size of the file.
  5. Click the Create button.

Note: The persistent block file or overlay image will be stored at the root of the drive you choose. However, you can move it around later to fit your needs.

Booting and using a Casper Persistent Overlay Image

Booting Ubuntu with Persistence enabled

Depending on how you created your Ubuntu, Xubuntu, Kubuntu or other Bootable USB flash drive, you may need to append the persistent boot parameter to your boot menu. To do this, at the Boot Menu, press F6. Then press ESC and add the word persistent to the boot string. Finally, press Enter to boot.

Persistent overlay usage

Persistent overlay images work well for saving and restoring most things. I.E. personalized settings, application settings, customizations, and saved files. However, an overlay does not serve to completely replace a full USB installation.

When using a persistent overlay you will need to avoid complete system upgrades. Parts of the system including the kernel, remain compressed and outside of the image. If you try to upgrade, the compressed kernel cannot be modified, and this could result in an unbootable system.

This concludes How to make Casper Persistent Files from within Windows 11, 10, 8, 7. I hope that you found this software utility useful. Here is a link to Ubuntu's Casper Manual page for reference.

Casper-RW Persistent File FAQ

What is the purpose of a persistent live USB drive?
A persistent live USB drive allows you to boot an operating system (such as Ubuntu) from a USB stick while keeping the ability to save files, settings, and installed applications between reboots.
How does Casper-RW work?
Casper-RW is a special file (or partition) used in Ubuntu live USBs to enable persistence. It acts as a writable overlay on the system, enabling users to store changes, files, and customizations, which persist between reboots.
What is the difference between casper-rw and writable in Ubuntu?
In Ubuntu 20.04 and newer versions, the persistent overlay is referred to as “writable,” while earlier versions used "casper-rw." The volume label and file need to be named "writable" in newer versions, but older versions can still use "casper-rw."
Can I upgrade the system using a persistent live USB?
While you can install software and make customizations, you should avoid performing system upgrades, as the compressed kernel remains outside the persistent overlay, which could lead to issues like an unbootable system.
What is the maximum file size for the casper-rw file?
The maximum file size for the casper-rw file depends on the file system of your USB drive. For example, FAT32 has a 4GB limit, so it's essential to consider this when creating a persistent file. Ext4 would not have this limitation.
Can I move the casper-rw file after creation?
Yes, you can move the casper-rw file to another location on your USB drive after it's created. However, it must remain within the root directory to function properly during boot-up.
How do I boot from a persistent live USB?
To boot from a persistent live USB, select the persistent option in your boot menu. This can be done by pressing F6, then ESC, and appending "persistent" to the boot string before hitting Enter.

Final Thoughts

Creating a persistent live USB with Ubuntu based distributions has become a highly convenient and flexible way to carry your OS and personal data wherever you go. By utilizing the Casper-RW persistence feature, users can ensure that any changes made—whether they are system customizations, installed applications, or saved files—will persist even after rebooting, giving the USB drive a more permanent nature. However, it’s important to understand that while Casper-RW allows for persistence, it has limitations, such as the inability to update certain parts of the system like the kernel.

For those who need a portable, customizable Ubuntu environment, this tool is invaluable. It's especially useful when you need to make on-the-go changes without the need to install Ubuntu on a permanent machine. When combined with the Casper-RW Persistent File Creator, the process of creating and managing your persistent live USB becomes a breeze.

As a cautionary note, users should always be mindful of the size of the persistent file and the file system limitations. Additionally, trying to perform system upgrades on a persistent live USB setup could lead to issues, so it's crucial to stick to personal data and software customization.

By understanding how Casper-RW works, you can unlock the full potential of your Ubuntu live USB and create a reliable portable working environment.