Klaus Knopper answers your Linux questions

Ask Klaus

Article from Issue 168/2014

Delivering Knoppix

Hello Klaus, I hope this message finds you doing well.

I wanted to share with you my use of Knoppix. Currently, the students in my district use Knoppix in every lab. This consist of just over 1,000+ computers and growing. I do this in a manner of diskless clients, PCs with no hard drive.

I have Knoppix installed on my PC and I update, add, remove, maintain bookmarks and such so that every PC can access their needs. Once my local installation is exactly the way I need it, I use the re-mastering option to get the new big KNOPPIX file.

I upload this to a CentOS virtual server that resides in my ESXi cluster, which can deliver the file via PXE boot to all the PCs needed. This works very fast and very good for me.

Now my idea is to expand this to mobile devices, notebooks/laptops. My theory is to do a flash disk install to the hard drive and choose the option for read only. This way the install remains persistent, and the very young students can do as they wish without my fear of them trashing the install. Now that its installed with the read-only option, I would need to make changes to it when I choose to and rsync their install with mine. Now, we come to my question.

Is it possible to change the read-only install to write and then back to read-only without re-imaging the hard drives?

Thanks greatly, sincerely, Tim

I'm quite impressed by your installation of Knoppix as a self-contained system for a large number of PCs. :-). First, answering your main question: I think the easiest way to accomplish a quick change of bookmarks and additional software could be the "add-on" feature, which allows you to use a second read-only compressed overlay file.

When booting, the Knoppix /init script residing inside the minirt.gz initial ramdisk searches for the cloop-compressed block device snapshots – /mnt-system/KNOPPIX/KNOPPIX, /mnt-system/KNOPPIX/KNOPPIX1, /mnt-system/KNOPPIX/KNOPPIX2, and so on in that order – and stacks them on top of each other. Higher numbers are higher priority, meaning that the content of KNOPPIX1 can override the content of KNOPPIX in case of identical file names or "whiteout" files inside, which indicate a file or directory's deletion relating to the previous stack content.

By adding or updating the file /mnt-system/KNOPPIX/KNOPPIX1 on the clients via rsync, you could add or change software or bookmarks or virtually "remove" content at the next boot. Make sure you don't just overwrite the file in place; rather, delete or move away the old and create a new file when currently running the system with those files in use. Rsync usually takes care of this if you don't use the --inplace option. Think of the KNOPPIX1<n> files as "changes relative to the previous base."

Creating the additional overlay file is easy. You could boot Knoppix in "use only ramdisk" mode to make sure that you don't also catch things modified in a previous session on a mastering computer with

knoppix noimage

which will prevent a permanent overlay from being mounted. Then, for example, you can install additional software or modify bookmarks and then copy just the modified data to a new directory (e.g., /home and /usr in this example):

sudo su -
cd /tmp
mkdir Addons
cp -a /ramdisk/home /ramdisk/usr Addons/

Note that I just switched to root here to preserve all permissions with cp -a.

If you only want distinct files from the /ramdisk/home or /ramdisk/usr directories, create the upper level directories inside the Addons directory with exactly the same permissions as are used in /ramdisk. Otherwise, permission problems are ahead, because the new overlay shadows the previous installation.

When started with the permanent overlay partition or file instead of the ramdisk-only (noimage) option, the same modified data resides in /KNOPPIX-DATA instead of in /ramdisk.

Now, create an image containing the modifications only. Although the ext2-4 filesystems or ReiserFS are possible, I usually use the ISO 9660 read-only DVD filesystem because it's easy to handle, read-speed optimized, and unfragmented, and the cloop overlay block devices are read-only anyway.

Still in the root shell, do:

cd Addons
mkisofs -l -R -U -v . | create_compressed_fs -L -2 \
  -B 131072 -m - ../KNOPPIX1

mkisofs creates the ISO 9660 filesystem from the Addons directory, and create_compressed_fs burns it onto a compressed block device file on the fly. The create_compressed_fs command is part of the cloop-utils and should be present in all Knoppix versions.

The mkisofs options make sure that Unix permissions and file names are not changed in the resulting ISO 9660 filesystem. The create_compressed_fs options shown here are:

  • -L -2 – Try all compressions from Gzip -0-9 plus 7zip and take the smallest output.
  • -B 131072 – Compression and device-read block size (larger results in better compression, smaller reads small files faster; must be a multiple of 512).
  • -m – Use in-memory compression (no temporary files).
  • - – Use output of command pipe as input.
  • ../KNOPPIX1 – Write output to file KNOPPIX1 in the upper level directory.

If you put KNOPPIX1 inside the KNOPPIX directory of your clients now, they will see your changes when the directory stack is evaluated at boot time. Students can still use a private read/write overlay file or partition to save their working results  – if you let them and if you have prepared an overlay partition on the client computers.

Some patches in Knoppix 7.4.1 may be useful for you, so I mention them here:

1. No more automatic creation of an overlay image except when booting with the "mkimage" option. The initial ramdisk in Knoppix used to ask whether the user wanted to create an overlay image on the writable disk media if enough space was available. Because this does not exactly mention the description of "no overlay – read only (like DVD)" from the flash-knoppix installer, I changed it to require a boot option. Listing 1 shows the change in /init from the minirt.gz initial ramdisk (a compressed cpio archive).

Listing 1

/init Changes


2. A small but important fix in the /usr/sbin/knoppix-terminalserver script. Some kernel modules for Ethernet cards require that more than one module be loaded as dependencies before they can also be loaded (e.g., the "tg3" card). To fix this, I made a new version of the knoppix-terminalserver package [1], which you can update.

sudo apt-get update
sudo apt-get install knoppix-terminalserver

Instead of making these changes, you can use Knoppix 7.4.1, or parts thereof, which is now available on the mirrors.

3. Corrected the disappearing taskbar (see later question).

Accessibility Services

Dear Mr. Knopper,

As a visually impaired newcomer to Linux (and hence to Knoppix), I recently downloaded and burnt the Knoppix 7.3 ISO file to DVD to be used "live" on a Windows PC.

There was no problem booting from the DVD, magnification worked out of the box, but activating speech output (Orca) was only possible with sighted assistance. Luckily, my wife is fully sighted, and she helped me out. However, once the screen reader was enabled with settings adjusted to suit my needs, it was a disappointment to find there was no speech support on the desktop. No speech when using the Tab key or when I invoked the menu list by pressing Alt+F1.

What could I have done wrong or missed out on? Could you help me out, please? Thank you. Kind regards, Tony

It's not sufficient just to start Orca when the desktop is already up and running, because accessibility features must be turned on inside the desktop before Orca is started. Knoppix tries to keep a small memory footprint, so services are only started on demand, not automatically every time.

To start LXDE with Orca enabled for everything, you have two possibilities:

1. Use the ADRIANE desktop (type adriane at the boot: screen), which is designed for blind computer users, and choose Graphical programs | Full desktop) from the menu. This will reuse speech output and Braille support from ADRIANE in a LXDE session.

2. Use the "orca" boot option; that is, type knoppix orca at the boot: screen. This will start the accessibility services and Orca before starting the graphical desktop. Orca will start hidden; you can activate the "settings" window (Figure 1) with OrcaKey-Space (the OrcaKey is usually CapsLock).

Figure 1: Orca setup.

If you want to make this startup mode with talking LXDE desktop permanent after flashing Knoppix to a USB flash disk, change the APPEND lines after LABEL knoppix and LABEL knoppix64 so that they contain "orca" as a space-separated option in the syslinux boot configuration file (/mnt-system/boot/syslinux/syslinux.cfg), or just edit boot/syslinux/syslinux.cfg using any plain text editor if you plug in the USB flash disk from another operating system.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Ask Klaus!

    Klaus Knopper is the creator of Knoppix and co-founder of LinuxTag expo. He currently works as a teacher, programmer, and consultant. If you have a configuration problem, or if you just want to learn more about how Linux works, send your questions to: klaus@linux-magazine.com

  • Ask Klaus!

    Klaus Knopper is the creator of Knoppix and co-founder of LinuxTag expo. He currently works as a teacher, programmer, and consultant. If you have a configuration problem, or if you just want to learn more about how Linux works, send your questions to: klaus@linux-magazine.com

  • Ask Klaus

    Klaus Knopper answers your Linux questions.

  • Ask Klaus!


  • Knoppix 7.3

    Knoppix 7.3 comprises the current state of Debian GNU/Linux development and comes with the current hardware support of kernel 3.13, a new update function, and extended security and privacy features.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More