Recombine flash disk installation

Not for unexperienced users!

Backup your files before using this script!

Copy at '/mnt-system/KNOPPIX/' (download).

Hint: Creating persistent memory for the first time, select "max size - 1".

You need available space on a separate partition which you can use after booting your flash disk installation and a second Knoppix (CD/DVD, flash disk or a HD installation) for step "Reassemble your flash disk".

What filesystem on the separate partition?

You can use a Linux filesystem, a NTFS or a FAT32 filesystem. I prefer a ext2/ext3 formatted partition. The limitation is the size of the new compressed filesystem Image stored at '$STOR/knx/KNOPPIX'. If you recombine a flash disk installation from a Knoppix DVD with a huge persistent memory, it may be that the new file 'KNOPPIX' exceeds the size of 4GB. In this case you can not use a FAT32 formatted partition; but if you recombine a CD Installation, also a FAT32 formatted partition can be used.

Principles of recombine

  • KNOPPIX contains the compressed filesystem
  • knoppix-data.img (.aes) is the persistent memory and contains
    → new installed packages and new files
    → markings about deleted packages and files within KNOPPIX
  • UNIONFS merges (decompressed) KNOPPIX with persistent memory
  • rsync UNIONFS to '$STOR/knx/recombine' will
    → include all new and
    → omit all deleted stuff
  • create new (compressed) KNOPPIX from '$STOR/knx/recombine'
  • exchange old KNOPPIX with new KNOPPIX
  • delete old knoppix-data.img (.aes)
  • let Knoppix build new persistent memory

Caution: If new KNOPPIX (step 5) exceeds the size of 4 GB you cannot exchange old KNOPPIX with the new one (step6)!


Prepare new compressed Filesystem Image

  • Boot your flash disk installation and start /mnt-system/KNOPPIX/ with the option: "Rsync UNIONFS and build new KNOPPIX".

The script will ask you on which partition to store the whole 'rsync UNIONFS' and the new compressed Filesystem Image (= KNOPPIX).

Needed free space on the used partition will be calculated. If you ever used this separate partition for recombine, you'll get back the used space within this partition.

You'll get an error message, if new KNOPPIX exceeds the size of 4 GB. For such occasion try to delete huge packages

dpkg-query -W --showformat='${Installed-Size} ${Package}\n' \
| sort -nr | awk '{print "\t"$1"\t"$2}' | less

within your flash disk installation first and start with "Rsync UNIONFS ..." once more.

  • Shutdown your computer and unplug the flash disk

Reassemble your flash disk installation

  • Boot with another Knoppix (CD/DVD, flash disk or HD installation). After booting reinsert your flash disk and start /media/sdb1/KNOPPIX/ with the option: "Write new KNOPPIX to flash disk"

Caution: reinsert your flash disk after boot process has completed.

The old files 'KNOPPIX' and 'knoppix-data.img' respectively 'knoppix-data.aes' (= persistent memory) will be removed.

To complete the recombine process the new KNOPPIX is written to the flash disk.

New persistent memory

  • Boot your flash disk installation once more.

Knoppix will ask you again, if you want to create a persistent memory.


I've tested 'kn-recombine' with a Knoppix V7.0.1DVD flash disk installation on partition #1 (8 GB) of an extern USB-drive instead of an USB stick.

There are some calculations of transfer rate with which you can compare the use of a partition on HD versus a partition on flash medium.

To exclude or include files or directories within the rsync of UNIONFS, please edit the function 'fkrsync()' after the line:

"rsync -vaH /UNIONFS/ $STOR/knx/recombine".