-
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
12TB 7200RPM 256MB Cache SATA 6.0Gb/s 3.5" Internal NAS Hard Drive -
$84.95
Certified Refurbished 5TB WD Elements Portable Hard Drive - RWDBU6Y0050BBK-WESN
$99.99
HITACHI HUS724040ALA640 4TB 7200RPM 64MB SATA 6.0Gb/s 3.5" HARD DRIVE ZERO HOURS
$59.99
Certified Refurbished 2TB WD Elements Portable Hard Drive - RWDBU6Y0020BBK-WESN
$49.99
HGST Ultrastar DC HC520 12TB SATA 6Gb 256MB 3.5" Enterprise HDD- HUH721212ALE601
$89.99
WD Ultrastar DC HC530 14TB SATA 6G 3.5" 7200RPM Enterprise HDD - WUH721414ALE604
$109.99
Hitachi HUS723030ALS640 3TB 3.5" 64MB 7.2K RPM SAS Drive P/N:0B26328 Tested
$13.99
HITACHI HGST HTS721010A9E630 1TB 2.5" SATA3 7200RPM Hard Drive - B GRADE TESTED
$14.95
SEAGATE ST6000NM0034 6TB 7.2K SAS 3.5" HDD HARD DRIVE
$64.00
Segate IronWolf 8TB 3.5" SATA Desktop HDD Hard Drive Tested, Wiped - ST8000VN004
$89.69