Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Using kvm to install Knoppix from ISO image to flash and HD, 7.6.1 example.

  1. #11
    Senior Member registered user
    Join Date
    Sep 2006
    Posts
    798

    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.

  2. #12
    Senior Member registered user
    Join Date
    Sep 2006
    Posts
    798

    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.

  3. #13
    Senior Member registered user
    Join Date
    Sep 2006
    Posts
    798

    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 01:37 PM.

  4. #14
    Senior Member registered user
    Join Date
    Sep 2006
    Posts
    798
    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 05:14 PM.

  5. #15
    Senior Member registered user
    Join Date
    Sep 2006
    Posts
    798
    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.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •