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
If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.
Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.
Sponsored by ActiveState
| Speed Up Your Web Site with Varnish | Jun 19, 2013 |
| Non-Linux FOSS: libnotify, OS X Style | Jun 18, 2013 |
| Containers—Not Virtual Machines—Are the Future Cloud | Jun 17, 2013 |
| Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer | Jun 12, 2013 |
| Weechat, Irssi's Little Brother | Jun 11, 2013 |
| One Tail Just Isn't Enough | Jun 07, 2013 |
- Speed Up Your Web Site with Varnish
- Containers—Not Virtual Machines—Are the Future Cloud
- Linux Systems Administrator
- Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer
- Senior Perl Developer
- Technical Support Rep
- RSS Feeds
- Non-Linux FOSS: libnotify, OS X Style
- UX Designer
- Web & UI Developer (JavaScript & j Query)
- It is quiet helping
2 hours 4 min ago - Technology
2 hours 21 min ago - Reachli - Amplifying your
3 hours 38 min ago - excellent
4 hours 26 min ago - good point!
4 hours 29 min ago - Varnish works!
4 hours 38 min ago - Reply to comment | Linux Journal
5 hours 8 min ago - Reply to comment | Linux Journal
7 hours 34 min ago - Reply to comment | Linux Journal
11 hours 34 min ago - Yeah, user namespaces are
12 hours 50 min ago
Featured Jobs
| Linux Systems Administrator | Houston and Austin, Texas | Host Gator |
| Senior Perl Developer | Austin, Texas | Host Gator |
| Technical Support Rep | Houston and Austin, Texas | Host Gator |
| UX Designer | Austin, Texas | Host Gator |
| Web & UI Developer (JavaScript & j Query) | Austin, Texas | Host Gator |
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