Klaus Knopper answers your Linux questions
Ask Klaus
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 fileKNOPPIX1
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).
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
(incl. VAT)
Buy Linux Magazine
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.
News
-
The Gnome Foundation Struggling to Stay Afloat
The foundation behind the Gnome desktop environment is having to go through some serious belt-tightening due to continued financial problems.
-
Thousands of Linux Servers Infected with Stealth Malware Since 2021
Perfctl is capable of remaining undetected, which makes it dangerous and hard to mitigate.
-
Halcyon Creates Anti-Ransomware Protection for Linux
As more Linux systems are targeted by ransomware, Halcyon is stepping up its protection.
-
Valve and Arch Linux Announce Collaboration
Valve and Arch have come together for two projects that will have a serious impact on the Linux distribution.
-
Hacker Successfully Runs Linux on a CPU from the Early ‘70s
From the office of "Look what I can do," Dmitry Grinberg was able to get Linux running on a processor that was created in 1971.
-
OSI and LPI Form Strategic Alliance
With a goal of strengthening Linux and open source communities, this new alliance aims to nurture the growth of more highly skilled professionals.
-
Fedora 41 Beta Available with Some Interesting Additions
If you're a Fedora fan, you'll be excited to hear the beta version of the latest release is now available for testing and includes plenty of updates.
-
AlmaLinux Unveils New Hardware Certification Process
The AlmaLinux Hardware Certification Program run by the Certification Special Interest Group (SIG) aims to ensure seamless compatibility between AlmaLinux and a wide range of hardware configurations.
-
Wind River Introduces eLxr Pro Linux Solution
eLxr Pro offers an end-to-end Linux solution backed by expert commercial support.
-
Juno Tab 3 Launches with Ubuntu 24.04
Anyone looking for a full-blown Linux tablet need look no further. Juno has released the Tab 3.