=============================================================================== DEBIAN LIVE PERSISTENCE GUIDE: COMPLETE HANDBOOK A Comprehensive Guide for Multiboot & Frugal-Style Install Enthusiasts =============================================================================== ------------------------------------------------------------------------------- 1. OVERVIEW & CONCEPTS ------------------------------------------------------------------------------- In Puppy Linux, frugal installs save system changes into a directory or save file (such as `.3fs` or `.4fs`). Standard Debian Live (`live-boot`) manages persistence via union mounts (OverlayFS). Debian Live offers maximum flexibility for retaining changes: - Method 1: Directory Persistence on Same Partition (Easiest, No Loopback) - Method 2: Dedicated Partition Persistence - Method 3: Multi-Profile Persistence (Folder Profiles vs. Partition Profiles) - Method 4: Loopback File Persistence (Puppy-style single save container) ------------------------------------------------------------------------------- 2. PREREQUISITES ------------------------------------------------------------------------------- - A USB drive or partition formatted with a Linux-native filesystem (ext4 is recommended). - Official Debian Live ISO (Standard, XFCE, GNOME, KDE, etc.). - Root or `sudo` access in a working Linux environment. ------------------------------------------------------------------------------- 3. METHOD 1: DIRECTORY PERSISTENCE ON USB (Easiest - No Loopback, No Extra Partitions) ------------------------------------------------------------------------------- If your USB drive (or main system partition) is already formatted as `ext4` and labeled `persistence`, you can save changes directly into folders on that same partition without creating virtual disk files or adding extra partitions. 1. Format your main USB partition as ext4 with the label `persistence`: sudo mkfs.ext4 -L persistence /dev/sdX1 2. Copy your Debian boot files into a folder (e.g., `/debian-live/`): - `vmlinuz` - `initrd.img` - `filesystem.squashfs` 3. Create `persistence.conf` directly in the root of the partition: sudo mount /dev/sdX1 /mnt echo "/ union" | sudo tee /mnt/persistence.conf sudo umount /mnt 4. Boot with `persistence` enabled in your bootloader. `live-boot` will write changes directly to directories created on the USB filesystem. ------------------------------------------------------------------------------- 4. METHOD 2: DEDICATED PERSISTENCE PARTITION (Granular Folder Mapping) ------------------------------------------------------------------------------- If your live system lives on a FAT32 partition, create a second `ext4` partition labeled `persistence` dedicated solely to holding changes. 1. Format and label the secondary partition: sudo mkfs.ext4 -L persistence /dev/sdX2 2. Configure folder mappings in `persistence.conf`: sudo mkdir -p /mnt/persist sudo mount /dev/sdX2 /mnt/persist sudo nano /mnt/persist/persistence.conf Add the specific system directories you want to save: /home union /etc/NetworkManager union /var/lib/apt union *(Note: Using `/ union` instead will save the entire root filesystem).* 3. Unmount: sudo umount /mnt/persist ------------------------------------------------------------------------------- 5. METHOD 3: MULTI-PROFILE PERSISTENCE (Work vs. Personal) ------------------------------------------------------------------------------- OPTION A: Folder Profiles on a Single Partition (Recommended) ------------------------------------------------------------- You can host multiple separate save profiles inside dedicated folders on a single `persistence` partition. 1. Mount your `persistence` partition: sudo mount /dev/sdX2 /mnt/persist 2. Create directories for each profile: sudo mkdir /mnt/persist/work sudo mkdir /mnt/persist/personal 3. Place a custom `persistence.conf` inside each profile directory: # For Work: echo "/home union" | sudo tee /mnt/persist/work/persistence.conf echo "/etc/NetworkManager union" | sudo tee -a /mnt/persist/work/persistence.conf # For Personal: echo "/home union" | sudo tee /mnt/persist/personal/persistence.conf sudo umount /mnt/persist 4. Boot using `persistence-path=` (see Bootloader section below). OPTION B: Partition-Based Profiles (Separate Drives/Partitions) --------------------------------------------------------------- 1. Create partitions with custom labels: sudo mkfs.ext4 -L work-persist /dev/sdX2 sudo mkfs.ext4 -L home-persist /dev/sdX3 2. Add `persistence.conf` (`/home union`) into each partition's root directory. 3. Boot using `persistence-label=` (see Bootloader section below). ------------------------------------------------------------------------------- 6. METHOD 4: LOOPBACK FILE PERSISTENCE (Single Save-File Container) ------------------------------------------------------------------------------- Useful if your drive is FAT32 or NTFS and you cannot use native folder persistence. 1. Create a container file named `persistence` in your boot folder: cd /debian-live/ dd if=/dev/zero of=persistence bs=1M count=0 seek=4096 mkfs.ext4 persistence 2. Configure `persistence.conf` inside the loopback file: sudo mkdir -p /mnt/debian_persist sudo mount -o loop persistence /mnt/debian_persist echo "/ union" | sudo tee /mnt/debian_persist/persistence.conf sudo umount /mnt/debian_persist ------------------------------------------------------------------------------- 7. BOOTLOADER CONFIGURATION EXAMPLES (GRUB2) ------------------------------------------------------------------------------- Add the relevant menu entry to your `grub.cfg`: # Standard Persistence (Method 1, Method 2, or Method 4): menuentry "Debian Live - Standard Persistence" { linux /debian-live/vmlinuz boot=live persistence live-media-path=/debian-live initrd /debian-live/initrd.img } # Multi-Profile via Folders (Method 3 - Option A): menuentry "Debian Live - Work Profile (Folder)" { linux /debian-live/vmlinuz boot=live persistence persistence-path=/work live-media-path=/debian-live initrd /debian-live/initrd.img } menuentry "Debian Live - Personal Profile (Folder)" { linux /debian-live/vmlinuz boot=live persistence persistence-path=/personal live-media-path=/debian-live initrd /debian-live/initrd.img } # Multi-Profile via Partitions (Method 3 - Option B): menuentry "Debian Live - Work Profile (Partition)" { linux /debian-live/vmlinuz boot=live persistence persistence-label=work-persist live-media-path=/debian-live initrd /debian-live/initrd.img } # Clean Boot (RAM only, no changes loaded): menuentry "Debian Live - RAM Boot (No Persistence)" { linux /debian-live/vmlinuz boot=live live-media-path=/debian-live initrd /debian-live/initrd.img } ===============================================================================