Script for remastering Debian 9.1.0 under Knoppix

For the record, here is the script used to remaster Debian Live 9.1.0. Basically, it performs the aufs union mount, copies the whole thing to a directory with rsync, and then compresses the result. Squashfs-tools are needed. The whole operation takes only a few minutes on a contemporary i7 machine with SSD disk.

Afterwards, the new live file is copied to a new directory, a new persistence file is created in a new directory, and a new grub entry is created with the new locations. This way, it is possible to go back to an earlier version on the fly if somethings goes very wrong. At irregular intervals, depending on how much is changed, the new persistence file is backed up.

Procedure applied to Knoppix 8.1: It basically works

Have just repeated the procedure with Knoppix 8.1 under Debian 8.3 live. A bit more glitches than earlier, but it has worked.
Downloaded the ISO+md5sums and went to the directory. Kvm had no problems running the ISO, and after checking that things seemed to work, and that the flash was recognized as /dev/sdb, I used flash-knoppix to create a bootable flash install.
Used the old setup with persistence file, no encryption.

I had some problems with the choices in the flash-knoppix setup. We must choose fixed disk, for that's what the flash drive looks like from kvm Knoppix. But I had to double click to choose that.
Also, it complained that it couldn't get the geometry for the persistent image right. The file was created, but file system creation somehow went wrong.
So, I had to do a mkfs.ext2 on the knoppix-data.img file afterwards. From there, things seem to work fine.

But, to get the stick to boot properly and consistently on a Windows PC, I had to use a USB2 port - the recognition in the USB3 ports seemed a bit random. Maybe it has to do with the drive, a 32 GB HyperX Fury.

There is an interesting new option for remastering in flash-knoppix. Will try it out from a Poor Man's Install. Will also try this whole procedure under Knoppix, and under Debian 9.1.

Workaround for problem with wrong resolution detection in 8.1

Posting this from 8.1 Poor Man's Install. For the first time, I have had to manually set screen resolution - wrong detection left me with an unusable Knoppix.
But, as so often, the knoppix-cheatcodes.txt file helped me out. What I needed, was a specification screen=1920x1200. One might think the norandr alternative would do, but it didn't.

Here are the Knoppix 8.1.0 boot stanzas from legacy grub's menu.lst file. I have added a 1280x1024 frame buffer alternative to have a fallback.

By specifying knoppix_dir, and eventually fromhd, I can multi-boot as many Knoppixes I want. I place the kernel and initrd files in separate directories under boot on the partition where grub is installed.
One important reason for having noimage ie. no persistence, boot alternatives, is that I can then backup or copy the persistence file "from within".

Right now, I have 5 live OS alternatives for booting on this old PC: Knoppix 7.05, 7.4.2, 6.7.1 and 8.1.0, and Debian 8.3.0. The old stuff is for running program versions or hardware drivers that can no longer be installed under newer OS versions.

The problem with flash-knoppix not recognizing drives seems to depend on the type of drive. An old, quite slow 16GB USB2 stick (Kingston DataTraveler G2) was handled straight away. But the problem with creating file system on the persistent image correctly, persists. Not that hard to fix, though - boot the stick, go to /mnt-system/KNOPPIX and do a mkfs.ext2 on knoppix-data.img, reboot and the new persistent store is used.
Flash-knoppix isn't all that bright - looks like it won't transfer the system unless Knoppix resides in a KNOPPIX directory - which it should not do if we are doing multi-booting. Which in turn is necessary with each upgrade at least until we have verified that all important things work well in the new version.