Creating a Complete Distribution on CD

If you need a CD distribution that is more flexible and customizable than the ones readily available, create your own.
Cleaning Up

When your first trial CD is working, it's time to do some cleaning. Basically, there are two locations where some major cleaning up of the boot process can be done. First, you have to take care of /etc/rc.d/rc.sysinit. In this file, which always is executed on system boot, a lot of things are taken care of and probably a lot of things can be skipped for your specific configuration. The most important things to look at all are the instances where files are created. Besides that, you can disable the lines where services are activated that you don't need. Think, for example, of services such as isapnp setup and probably many more.

Next, you have to clean the boot-up of your runlevel. Let's first do a quick refresher of how services are activated when entering a runlevel. On Red Hat, you find all the general scripts used to start services in /etc/rc.d/init.d. A script called smb, for instance, can be used to start Samba services. If you want this script to be executed when entering runlevel 3, you have to create a symbolic link that starts with S followed by a number to determine the exact moment when the script should be executed. By default, many of these links probably start services you don't need. You could encounter, amongst others, the link S60lpd in /etc/rc.d/rc3.d, which dictates that the line printer dæmon is started every time you enter runlevel 3. In order to clean the startup procedure of services you don't need, simply remove all of these links.

Automatic Login and Starting X

Returning to our initial example, say you want to use your Linux distribution for customers who have to complete an evaluation without providing a user name and password. By changing a simple line in /etc/inittab, you can log in your users automatically. You can use any account you like, because it is a read-only filesystem--you even could use root if you wanted. In order to log in to the system automatically, change

1:2345:respawn:/sbin/mingetty tty1


1:2345:respawn:/usr/bin/open -c 1 -w -- /bin/login -f username

Don't forget to remove the password for the user you are here. You probably don't want to oblige your users to fill in anything before they can start using your CD.

Before you can give the CD to an innocent user, you need to take one more step, making it possible to start the X Window System. It is rather easy to make this happen; simply give your default user a writable home directory. At an earlier stage you created a read/write accessible /var director, so this is a nice location in which to create the home directory. After that, X is happy to be able to create its temporary files, and everything works the way it should.



Root Over NFS Clients & Server Howto

Linux Devfs FAQ

For Knoppix and the source code used for Knoppix automatic hardware detection, go to

Sander van Vugt lives in the Netherlands. He works for Azlan Network Training (part of the Techdata Group) as a trainer and consultant, and he has written several books and articles about Linux.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

great article! if your

Anonymous's picture

great article!
if your wanting to remaster ubuntu or other debian based distributions check out this guide:

thanks anyhow!

creating a live cd

uk's picture

nice article, i'm trying to create one based on this. but i've some doubts.
1. i didn't find any devfs in /etc/rc.d/rc.devfs( thn wht did u mean by tht)
2.i installed a minimum of fedora core but not gotgraphics. how could i enable it, on live cd

Re: Creating a Complete Distribution on CD

kurtm's picture

Would it be possible to keep in mind that non-x86 Linux ports exist?

I realize it's really beyond the scope of this article to cover the different boot formats needed for non-x86 architectures, but you could at least mention that the procedure is different for them.

The Linux community is quick to point at how many platforms Linux runs on, but then assumes everyone's machine is x86.

Re: Creating a Complete Distribution on CD

Anonymous's picture

Try the Gentoo LiveCD. I haven't personally tried it, but it claims to work on several different types.


Re: Creating a Complete Distribution on CD

Anonymous's picture

Smaller than Knoppix and Morphix: DamnsmallLinux and LinuxBBC

bootcd automates the process

Anonymous's picture

At least in the Debian distro, there is a set of scripts in a package called "bootcd" that automates the creation of a bootable live CD.

The scripts basically copy the installed system to a working directory, compress the directory, and generate a compressed ISO (using the Rockridge compressed filesystem extensions in the Linux kernel). I've personally gotten a 1.6GB system onto a 700MB CD in this way. The scripts even handle creating ram disks to hold /dev, /var, /etc, /tmp, /root, and /home. You can tweak what is and isn't included on the CD and what is and isn't loaded into the ram disks through the config file.

I use a 10GB partition for the install and to allow room for authoring the CD. 1.6GB of installed software + roughly 1.6GB for the "working directory" copy it creates + roughly 1-1.4GB for the compressed directory + 700MB for the resulting ISO == about 5-6GB (with some room to spare). Once the script finished creating the ISO, it automatically cleans up after itself by removing the working and compressed directories. By default it removes the ISO as well if it is configured to immediately burn a CD. I turned this off in the config file so I can burn multiple copies.

I've been impressed so far.

As since I'm doing this in Debian, configuring exactly what packages I want on the CD is simple with apt-get. Do a very simple install, "apt-get install" the software you want, "apt-get remove" the software you don't, and then start making ISOs.

Descriptions, sources, and packages (for Debian) can be found at

Re: Creating a Complete Distribution on CD

Anonymous's picture

This is not a good article, it really doesn't prove the point of why you should make your own bootable; makes erroneous comments in options like knoppix, doesn't cover very important topics like how to discover where the cd rom is, it just forces you to have a distribution customized for a particular configuration... nevertheless you can see some of the "behind the scenes" live cds preparation

Re: Creating a Complete Distribution on CD

Anonymous's picture

Also check out Timo's Rescue Cd Creation Set on sourceforge:

The iso is a great pre-built rescue disk based on debian, but you can also download the source and custom tweak it however you like.

More than 650 MB?

Anonymous's picture

How do you get more than 650 MB? I believe that Knoppix is using compression and allows one to have considerably more software than one could have in just a 650MB partition. Interesting article.

what about morphix

Anonymous's picture

If you want a prepackaged distro that allows you to add
exactly what you want, try

Re: what about morphix

Anonymous's picture is a web site designer, what you want is

Re: Creating a Complete Distribution on CD

Anonymous's picture

About Knoppix author wrote:

3. Knoppix. Knoppix is a solution that looks a lot like the SuSE Live Evaluation. It is a nice solution based on Debian Linux, and it includes everything you need. The only drawback is you do need a DHCP server to activate the network card with a fixed IP address.

No, that is not true. In Knoppix you can activate the network card with a fixed IP address! You do not need DHCP server for that.

1. Command prompt : netcardconfig
2. KDE Menu: KNOPPIX-Network/Internet-Network card configuration

Re: Creating a Complete Distribution on CD

Anonymous's picture

Morphix seems to be another good choice.
its originally based upon knoppix but is designed as a framework
for adding just the components you need.

Re: Creating a Complete Distribution on CD

Anonymous's picture

The web address is

The Mandrake method

Anonymous's picture

1)Install Mandrake 9.2

2)Add a urpmi medium for contrib
See for help on doing this (or 'urpmi urpmi.setup; urpmi.setup)

3)Install mklivecd
# urpmi mklivecd

4)Make your Live CD

# mklivecd livecd.iso

Of course, there are many things you might want to change, and that is why mklivecd has a lot of options (allowing you to build the image from a chrooted installation, specifying which kernel to run, which bootsplash screen to use etc).

What does this method give over the method in the article?
-cloop support (like Knoppix), so you can have filesystems of up to about 2GB
-important places in /etc and /var writeable, as well as /home (in memory)
-it's trvial to use
-It's quicker to do than remastering Knoppix

There are some things that don't work in the version in 9.2 contrib (like local printing, although remote printing works fine), but most of those are fixed in CVS. Also, be sure to use the updated kernels for Mandrake 9.2, you need cloop-1.02 for reliable use of a live CD, which was merged into the official kernels for 2.4.22-18mdk.

One CD has already been distributed en masse, and there are a few more coming.

Unfortuntely the web site (actually, minicd's website at hasn't been updated, but the mailing list is relatively active, and CVS has a few commits a week.

Re: Creating a Complete Distribution on CD

Anonymous's picture

Don't forget the excellent and improving Dyne::Bolic -- not just a general distribution on CD, but specializing in audio/video editing and streaming tools. Great "brickout" style game, too. :)