-
Senior Member
registered user
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.
Code:
#!/bin/bash
#
[ -d sqfs ] || mkdir sqfs ;
[ -d persfs ] || mkdir persfs
[ -d aufs ] || mkdir aufs
[ -d copyfs ] || mkdir copyfs
#
# Running under Knoppix 7.7.1 w/Debian 9.1 image on same partition as Knoppix, persistent store at /dev/sda9
[ -d /media/sda9/deb91_1p ] || mount /media/sda9
fsck.ext3 -y /media/sda9/deb91_1p/persistence
mount -o ro,loop /mnt-system/deb910/live/filesystem.squashfs sqfs
mount -o loop /media/sda9/deb91_1p/persistence persfs
mount -t aufs -o "br=persfs/rw=rw:sqfs=ro,noplink" none aufs
#
#
# Clean up, in case
rm -rf copyfs/*
# Copy union file system
rsync -axu aufs/* copyfs
# Clean up mounts
umount aufs
umount sqfs
umount persfs
#
# Compress file system to new live file
mksquashfs copyfs filesystem_rem_1.squashfs
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.
-
Senior Member
registered user
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.
Code:
user@debian:/store/download/iso$ md5sum -c KNOPPIX_V8.1-2017-09-05-EN.iso.md5
KNOPPIX_V8.1-2017-09-05-EN.iso: OK
user@debian:/store/download/iso$ sudo kvm -cdrom KNOPPIX_V8.1-2017-09-05-EN.iso -hdb /dev/sdb -m 1024 -boot d &
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.
-
Senior Member
registered user
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.
Code:
title Knoppix 8.1.0 64 bits sda1 cloop no persistence fixed screen
kernel (hd0,5)/boot/knx810/linux64 screen=1920x1200 fromhd=/dev/sda1 noimage knoppix_dir=KNOPPIX810_0 nosound keyboard=no ramdisk_size=100000 lang=no apm=power-off initrd=minirt.gz nomce hpsa.hpsa_allow_any=1 loglevel=1 tz=localtime
initrd (hd0,5)/boot/knx810/minirt.gz
title Knoppix 8.1.0 64 bits sda1 cloop fixed screen
kernel (hd0,5)/boot/knx810/linux64 screen=1920x1200 fromhd=/dev/sda1 knoppix_dir=KNOPPIX810_0 nosound keyboard=no ramdisk_size=100000 lang=no apm=power-off initrd=minirt.gz nomce hpsa.hpsa_allow_any=1 loglevel=1 tz=localtime
initrd (hd0,5)/boot/knx810/minirt.gz
title Knoppix 8.1.0 64 bits sda1 cloop fbdev
kernel (hd0,5)/boot/knx810/linux64 fromhd=/dev/sda1 knoppix_dir=KNOPPIX810_0 vga=794 video=1280x1024 xmodule=fbdev nosound keyboard=no ramdisk_size=100000 lang=no apm=power-off initrd=minirt.gz nomce hpsa.hpsa_allow_any=1 loglevel=1 tz=localtime
initrd (hd0,5)/boot/knx810/minirt.gz
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.
Last edited by Capricorny; 11-11-2017 at 02:37 PM.
-
Senior Member
registered user
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.
Last edited by Capricorny; 11-11-2017 at 06:14 PM.
-
Senior Member
registered user
Update for Knoppix 8.2: The same procedure also works with Knoppix 8.2, but there were a few complications I didn't really understand. I also tried the "hybrid" direct dump option, but didn't get a working system from that. Running the ISO image under kvm and copying to flash disk worked fine, but going back to hard disk, several things did not work properly. When i did a lot of upgrading/installing (ca 2GB worth) and wrote a "remastered" image to flash, leaving me with KNOPPIX, KNOPPIX1 and KNOPPIX2 cloop files, the final system worked perfectly, with an almost empty persistent store. Seemingly no problems with hardware detection or graphics - it may have to do with X and other components having been upgraded.
Installing a running system to flash with the "remastering" option can be a great timesaver - in return for a couple of gigabytes extra space used, we don't have to do remastering ourselves, and the whole system is still FAT32-compatible. Which my standard squashfs Debian 9.1 image will not be after the third remastering. A 16GB flash stick will be more than enough for all the space requirements of a Knoppix release.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Intel Xeon E5-2699 V3 2.3GHz LGA Server Processor CPU
$30.00
Intel Xeon E5-2698 V4 2.20GHz 50MB 20 Core 9.6GT/s 135W CPU Processor SR2JW
$61.99
Dell Windows 11 Pro Desktop Computer PC Intel Xeon E-2224G 32GB RAM 1TB SSD WiFi
$316.97
Lot of 2 Intel Xeon E5-2697 V4 2.3GHz 18 Core LGA 2011-3 Server CPU Processor
$80.55
Intel Xeon E5-2699 V3 2.3GHz LGA Server Processor CPU
$27.99
Intel Xeon 18-Core E5-2699v3 @ 2.3GHz 45MB 145W Processor SR1XD CPU
$29.95
HP PROLIANT DL380 GEN9 719061-B21 Server 15x3.5" 2*XEON E5-2640 v3 128GB
$175.00
Intel Xeon E3-1270 V2 SR0P6 Quad-Core 3.5 GHz CPU Processor 69W LGA1155
$18.90
Dell Desktop Computer PC XEON, up to 64GB RAM, 4TB SSD, Windows 11 Pro, WiFi BT
$279.99
HP Proliant DL380 Gen10 2xXeon Silver 4112 32GB RAM 4x2Tb 3.5" SATA No OS Server
$292.50