Skip to content

Adding Persistence to a Gnoppix Live USB Drive

Gnoppix “Live” has two options in the default boot menu which enable persistence — the preservation of data on the “Gnoppix Live” USB drive — across reboots. You can choose between:

  • USB Persistence (this guide)
  • USB Encrypted Persistence (LUKS-encrypted)

This is an extremely useful enhancement, enabling you to retain documents, collected results, configurations, and more when running Gnoppix “Live” from the USB drive, even across different systems. The persistent data is stored in its own partition on the USB drive, which can also be optionally LUKS-encrypted.

To use the USB persistence options at boot time, you need to do some additional setup on your Gnoppix “Live” USB drive. This guide walks you through the process.

This guide assumes you have already created a Gnoppix “Live” USB drive. For the purposes of this article, we assume you are working on a Linux-based system.


You will need root privileges to do this procedure, or the ability to escalate with sudo.


In this example, we assume:

  • Your USB drive is /dev/sdX (the last letter will probably be different). Check connected USB drives with lsblk and adjust the device name in the usb variable before running commands.
  • Your USB drive has a capacity of at least 8 GB — the Gnoppix image takes over 4 GB, and we will create a new partition to store persistent data.

We will create a new partition starting right above the second Gnoppix Live partition, format it with ext4, and create a persistence.conf file.


  1. First, begin by imaging the latest Gnoppix live ISO to your USB drive.

While /dev/sdX is used throughout this page, replace it with the proper device label for your system. Use lsblk to verify.

We assume the two partitions created by the imaging process are /dev/sdX1 and /dev/sdX2:

Terminal window
user@gnoppix:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:16 0 2.7T 0 disk
├─sda1 8:17 0 512M 0 part /boot/efi
├─sda2 8:18 0 2.7T 0 part /
└─sda3 8:19 0 977M 0 part [SWAP]
sdX 8:32 1 58.4G 0 disk
├─sdX1 8:33 1 4.6G 0 part
└─sdX2 8:34 1 4M 0 part
user@gnoppix:~$
user@gnoppix:~$ usb=/dev/sdX

  1. Create and format an additional partition on the USB drive.

Create the new partition in the empty space above the Gnoppix Live partitions:

Terminal window
user@gnoppix:~$ usb=/dev/sdX
user@gnoppix:~$
user@gnoppix:~$ sudo fdisk $usb <<< $(printf "p\nn\np\n\n\n\np\nw")
[...]
user@gnoppix:~$

When fdisk completes, the new partition should be created at /dev/sdX3. Verify with lsblk:

Terminal window
user@gnoppix:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
[...]
sdb 8:48 1 58.4G 0 disk
├─sdb1 8:49 1 4.6G 0 part
├─sdb2 8:50 1 4M 0 part
└─sdb3 8:51 1 53.8G 0 part
user@gnoppix:~$

  1. Next, create an ext4 file system on the partition and label it persistence:
Terminal window
user@gnoppix:~$ usb=/dev/sdX
user@gnoppix:~$
user@gnoppix:~$ sudo mkfs.ext4 -L persistence ${usb}3
mke2fs 1.47.2 (1-Jan-2025)
Creating filesystem with 14114816 4k blocks and 3530752 inodes
Filesystem UUID: ccb5cd13-3675-40ac-8b81-a684802a8dd0
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424
Allocating group tables: done
Writing inode tables: done
Creating journal (65536 blocks): done
Writing superblocks and filesystem accounting information: done
user@gnoppix:~$

  1. Create a mount point, mount the new partition there, create the configuration file to enable persistence, then unmount:
Terminal window
user@gnoppix:~$ usb=/dev/sdX
user@gnoppix:~$
user@gnoppix:~$ sudo mkdir -pv /mnt/my_usb
mkdir: created directory '/mnt/my_usb'
user@gnoppix:~$
user@gnoppix:~$ sudo mount -v ${usb}3 /mnt/my_usb
mount: /dev/sdX3 mounted on /mnt/my_usb.
user@gnoppix:~$
user@gnoppix:~$ echo "/ union" | sudo tee /mnt/my_usb/persistence.conf
/ union
user@gnoppix:~$ sudo umount -v ${usb}3
umount: /mnt/my_usb (/dev/sdX3) unmounted
user@gnoppix:~$

Reboot, select to boot from USB, and choose “Live USB Persistence” in the boot menu. You will need to select this option every time you want your persistent data to be loaded.

Terminal window
user@gnoppix:~$ reboot

You can have multiple persistence stores on the USB drive, both encrypted or not, and choose which one to load at boot time.

Delete the previous large partition and create two separate stores. We will label one work and the other ctf.

Terminal window
user@gnoppix:~$ sudo parted /dev/sdX
GNU Parted 3.6
Using /dev/sdX
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted)
(parted) unit MiB
(parted)
(parted) print
Model: SanDisk Extreme (scsi)
Disk /dev/sdX: 59840MiB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 0.03MiB 4699MiB 4699MiB primary boot, hidden
2 4699MiB 4703MiB 4.00MiB primary
3 4704MiB 59840MiB 55136MiB primary
(parted)
(parted) rm 3
(parted)

Create two 5 GB partitions:

  • Partition 3: 4704 MiB to 9704 MiB (will hold work data)
  • Partition 4: 9704 MiB to 14704 MiB (will hold ctf data)
Terminal window
(parted) mkpart primary ext4 4704MiB 9704MiB
(parted)
(parted) mkpart primary ext4 9704MiB 14704MiB
(parted)
(parted) print
Model: SanDisk Extreme (scsi)
Disk /dev/sdX: 59840MiB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 0.03MiB 4699MiB 4699MiB primary boot, hidden
2 4699MiB 4703MiB 4.00MiB primary
3 4704MiB 9704MiB 5000MiB primary ext4
4 9704MiB 14704MiB 5000MiB primary ext4
(parted) quit
Information: You may need to update /etc/fstab.
user@gnoppix:~$
Terminal window
user@gnoppix:~$ sudo mkfs.ext4 /dev/sdX3
mke2fs 1.47.2 (1-Jan-2025)
[...]
user@gnoppix:~$
user@gnoppix:~$ sudo e2label /dev/sdX3 work
user@gnoppix:~$
user@gnoppix:~$ sudo mkfs.ext4 -L ctf /dev/sdX4
mke2fs 1.47.2 (1-Jan-2025)
[...]
user@gnoppix:~$

0x03 — Mount and create persistence.conf

Section titled “0x03 — Mount and create persistence.conf”
Terminal window
user@gnoppix:~$ sudo mkdir -pv /mnt/my_usb{3,4}
mkdir: created directory '/mnt/my_usb3'
mkdir: created directory '/mnt/my_usb4'
user@gnoppix:~$
user@gnoppix:~$ sudo mount -v /dev/sdX3 /mnt/my_usb3
mount: /dev/sdX3 mounted on /mnt/my_usb3.
user@gnoppix:~$
user@gnoppix:~$ sudo mount -v /dev/sdX4 /mnt/my_usb4
mount: /dev/sdX4 mounted on /mnt/my_usb4.
user@gnoppix:~$
user@gnoppix:~$ echo "/ union" | sudo tee /mnt/my_usb{3,4}/persistence.conf
/ union
user@gnoppix:~$ sudo umount -v /mnt/my_usb3 /mnt/my_usb4
umount: /mnt/my_usb3 unmounted
umount: /mnt/my_usb4 unmounted
user@gnoppix:~$

Now boot from USB. When the boot menu appears, press Tab to edit the persistence-label parameter to point to your preferred persistence store. For example, to use the work partition:

Terminal window
user@gnoppix:~$ reboot