Remaster Knoppix without Remastering
If you have used Knoppix for any extended period of time, chances are you eventually thought about customizing it. You might have simply wanted to make cosmetic changes with a new background and a different theme, or you might have wanted to add programs, change what happens at startup, or make any number of more-intensive changes. Well, you aren't alone. There are more than a hundred different Knoppix-based live CDs in existence. Some have changed only a few tools, and others have performed a complete overhaul of the programs, the themes and even the file structure.
If you had decided to change Knoppix, you quickly would become acquainted with some of the guides both on-line and in print about Knoppix remastering. At that point, some of you would have read the complicated set of steps and decided it just wasn't worth it. Knoppix fits all of its software within a compressed loopback filesystem on the disc. To remaster Knoppix, you must make a copy of the uncompressed contents of that filesystem, use chroot to access the copy as though it were the root filesystem, make any changes you want to make, and then re-create the new cloop filesystem and ISO image with a few gigantic commands on the command line.
Of course, I oversimplified and excluded a few steps there. Besides some of the more technical steps, I also left out that minor bug you undoubtedly introduced but didn't notice until you booted. That means you get to go through the remastering process (especially the time-consuming steps of creating a new cloop filesystem) all over again. I also left out the step where you notice that even though you made minor changes, your ISO inexplicably is much larger than it was before and won't fit on a CD, so back to the remastering process you go to free up more space.
The fact is, traditional Knoppix remastering is a time-consuming, error-prone, complex process full of trial and error, but there is a better way. There are a few different methods you can use to tweak the default Knoppix disc without using the remastering process. I like to refer to these methods as “remastering Knoppix without remastering”, because the default Knoppix cloop filesystem stays the same throughout the entire process.
I first became interested in low-impact Knoppix tweaks when I had to create a custom CD to include with my book, Knoppix Hacks. I didn't want to do much—just change the default background and add a few links to the desktop. Although I could have remastered the CD, I was concerned about introducing bugs, even with minor changes. Imagine if I had discovered a bug after the CD was printed and shipped around the country with the book! I figured if I could tweak Knoppix but leave the compressed image alone, I would reduce the risk considerably.
Ever since my first attempt to remaster Knoppix without remastering, I've used these methods so much that I actually prefer them and find them superior to remastering for most people's needs. Not only is the process much quicker and less complex, it's also simpler to migrate your changes once the next version of Knoppix is released.
The first method you can use to change Knoppix involves a classic Knoppix tool called saveconfig. This tool creates and lets you choose a number of different files and settings from your user's configuration files, all of the files on the desktop, and network, graphics and other settings. saveconfig then creates a tarball called configs.tbz out of the files and stores it on a USB key, hard drive or other writeable media of your choice along with a custom knoppix.sh script.
To run saveconfig, click K→Knoppix→Configure→Save Knoppix Configuration or type saveconfig in a terminal. Then, you can choose which settings to save and to which hard drive to save them. The next time you boot your computer, type myconfig=/dev/sda1/ to point Knoppix to a particular saved config, or type myconfig=scan, and Knoppix will scan all available drives for you. At the end of the boot process, Knoppix will run the knoppix.sh script on the drive, which will extract the tarball and restore your settings.
For minor, mostly cosmetic changes, the standard saveconfig script might serve all your needs. Simply make your changes, and then tell saveconfig to back up your personal configuration. This is useful, but you might want to back up only a few files, or you might want to add files that saveconfig doesn't save by default. To do that, you can tweak either the configs.tbz or knoppix.sh file. First, run saveconfig to create a configs.tbz and knoppix.sh file. Then, uncompress the configs.tbz file:
$ bunzip2 configs.tbz
Now, use tar to add new files to the tarball:
$ tar -rpPf configs.tar /path/to/file
You also can use tar to delete files:
tar --delete -pPf configs.tar /path/to/file
Once you are finished with your changes, you can recompress the tarball:
$ BZIP2=-9 bzip2 configs.tar $ mv configs.tar.bz2 configs.tbz
Another way to tweak saveconfig (or even bypass it altogether) is to realize that when you tell Knoppix to use a particular saved configuration, all it really does is execute the knoppix.sh file, which is a standard shell script. That shell script contains the tar commands to extract the file. This means anything you put in the knoppix.sh file will be executed at the end of the boot process. What's more, if you create a new Knoppix disc and place the knoppix.sh in the KNOPPIX/ directory on the disc, it will be executed automatically every time Knoppix boots. So, if there's an extra program you'd like Knoppix to have, just track down the .deb file for it and any of its dependencies, and add them to the disc. Then, in the knoppix.sh script you can put:
dpkg -i /cdrom/*.deb
Knoppix will install all of those programs at the end of the boot process. If you want to run any other commands or start any services, you also could put them in this script.
Kyle Rankin is a systems architect; and the author of DevOps Troubleshooting, The Official Ubuntu Server Book, Knoppix Hacks, Knoppix Pocket Reference, Linux Multimedia Hacks, and Ubuntu Hacks.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
- Dynamic DNS—an Object Lesson in Problem Solving
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Using Salt Stack and Vagrant for Drupal Development
- New Products
- A Topic for Discussion - Open Source Feature-Richness?
- Drupal Is a Framework: Why Everyone Needs to Understand This
- Validate an E-Mail Address with PHP, the Right Way
- RSS Feeds
- Readers' Choice Awards
- Tech Tip: Really Simple HTTP Server with Python
- BASH script to log IPs on public web server
2 hours 30 min ago - DynDNS
6 hours 5 min ago - Reply to comment | Linux Journal
6 hours 38 min ago - All the articles you talked
9 hours 1 min ago - All the articles you talked
9 hours 4 min ago - All the articles you talked
9 hours 6 min ago - myip
13 hours 31 min ago - Keeping track of IP address
15 hours 22 min ago - Roll your own dynamic dns
20 hours 35 min ago - Please correct the URL for Salt Stack's web site
23 hours 46 min ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?




Comments
Persistent Disk Image
Hi Dear Kyle
Thanks for the info. Currently I'm using Knoppix version 6 and as it has switched to LXDE, the instruction for the creating persistent disk image, as you said by selecting from menu ... is not available.
I have two questions:
1) How can I create the disk imgae from the terminal ?
2) After creating a disk can I resize it ?
Thanks a lot.
Best regards