Ventoy Persistence Plugin

Many distros (like Ubuntu/MX/LinuxMint ...) provide feature for persistence. This allows saving any changes you make to the live system, so that they are still present the next time you boot to it. In normal case, we create a separate partition to do this which is not so flexible.
Now Ventoy brings a new feature here. You have no need to create any partition, no need to add persistent boot parameter. Just put a persistence data file in the 1st partition and tell Ventoy by the json configuration, and that's all.
You can put many different data files for different iso files at a time. You can also share a data file between different iso files as long as it can be supported by the distros. Even you can specify more than one data files to an iso file, Ventoy will provide a menu to choose before boot.

  • 1. Supported Distros

Arch/Ubuntu and those distros based on them. Tested list: (Updating)

Distros Tested ISO Label Notes
Arch Linux archlinux-2021.03.01-x86_64.iso vtoycow Arch/ArchMan/ArchBang/ArchLabs/BlackArch... are also supported.
Ubuntu ubuntu-20.04-desktop-amd64.iso casper-rw
MX Linux MX-19.1_x64.iso MX-Persist
LinuxMint linuxmint-19.3-xfce-64bit.iso casper-rw
elementary OS elementaryos-5.1-stable.20200405.iso casper-rw
Zorin Zorin-OS-15.1-Core-64-bit-r2.iso casper-rw
Kaspersky Rescue Disk krd18.iso casper-rw
Kali kali-linux-2020.2-live-amd64.iso persistence Need -c persistence.conf option. And use Live USB Persistence boot option.
CloneZilla clonezilla-live-20200703-focal-amd64.iso persistence Need -c persistence.conf option
Fedora Fedora-Workstation-Live-x86_64-33-1.2.iso vtoycow Need to add selinux=0 in the boot option
  • 2. Json Configuration

A persistence array is defined to describe the configuration in /ventoy/ventoy.json.

{
    "persistence": [
        {
            "image": "/ISO/MX-19.1_x64.iso",
            "backend": "/persistence/MX-19.1_x64.dat"
        },
        {
            "image": "/ISO/ubuntu-20.04-desktop-amd64.iso",
            "backend": [
                "/persistence/ubuntu_20.04_1.dat",
                "/persistence/ubuntu_20.04_2.dat",
                "/persistence/ubuntu_20.04_3.dat"
            ],
            "autosel": 2
        },        
        {
            "image": "/linuxmint-19.3-xfce-64bit.iso",
            "backend": "/persistence/linuxmint_19.03.dat",
            "autosel": 1            
        }
    ]
}

Key Type Description
image STRING The full path of the iso file. This option supports fuzzy matching, please refer About Path Matching
backend STRING or ARRAY The persistence backend image file path for the iso file. Can be a single string or string array.
autosel INTEGER Optional. If you set it, that means you auto select the corresponding option in the prompt menu. And the prompt menu will NOT be shown.
0: boot without persistence backend image file
1: boot with the 1st persistence backend image file
2: boot with the 2nd persistence backend image file
......
  • 3. Multi-Mode

Supported. You can set different configurations for different BIOS mode. Please refer Multi-Mode Option for details.

  • 4. Backend Image File

The backend image file is a disk image with a label. You can directly download the created image files or create it by yourself.
Download
You can download created image files from https://github.com/ventoy/backend/releases
Create
I have provided a CreatePersistentImg.sh script here.
Download it and just run sudo sh CreatePersistentImg.sh in the linux shell, by default a persistence.dat file will be created with size=1GB fs=ext4 label=casper-rw.

sh CreatePersistentImg.sh  [ -s SIZE_IN_MB ] [ -t FSTYPE ] [ -l LABEL ] [ -c CFG ]  for example:

sh CreatePersistentImg.sh                 ---->  persistence.dat in 1GB size and ext4 filesystem and casper-rw label
sh CreatePersistentImg.sh -l MX-Persist   ---->  persistence.dat in 1GB size and ext4 filesystem and MX-Persist label
sh CreatePersistentImg.sh -s 2048         ---->  persistence.dat in 2GB size and ext4 filesystem and casper-rw label
sh CreatePersistentImg.sh -s 4096 -t xfs  ---->  persistence.dat in 4GB size and xfs  filesystem  (ext2/3/4 xfs are supported)  and casper-rw label

sh CreatePersistentImg.sh -l persistence -c persistence.conf  ---->  persistence.dat in 1GB size and ext4 filesystem and persistence label. Finally will create a 
persistence.conf file inside the persistence.dat. The file only has 1 line "/ union". Some distros have this requirement (e.g. Debian/Kali/CloneZilla...)

  1. When creating the image file and copy to USB, take care about the buffer. (can use sync to flush the data to the disk)
  2. Different distros use different Labels by default, for example ubuntu use casper-rw and MX Linux use MX-Persist, you can use -l to set it
  3. The backend image file must be put in the first partition. It can be in the root directory or any subdirectory.
  4. Once you have made a backend image file, you can compress and save it as a template in your computer (very small after compressed).
  • 5. Extend persistent dat file

Sometimes, you may find that the persistence space is insufficient after a period of use.
Of course you can use a new bigger persistence dat file, but you need to backup and restore your old data.
Here I provide ExtendPersistentImg.sh script for you to nondestructively extend the persistent dat file. Just download and run it in a linux shell as follows:

sudo sh ExtendPersistentImg.sh  datfile extend_size_mb
For example:
sudo sh ExtendPersistentImg.sh  persistent.dat 2048
That means extend persistent.dat by 2048MB (+2GB), if the old size is 1GB, then it will grow to 3GB after you extend it.

  • 6. Prompt Before Boot (1.0.12+)

When you boot an iso file with persistence config, a prompt will be shown. You can choose whether to use the persistence image and which image to use for this time.