Live CD Tips


From Knoppix Documentation Wiki
Revision as of 21:11, 23 June 2007 by Harry Kuhman (Talk | contribs)

Jump to: navigation, search

Using a Live CD does not mean that you are stuck with what is on the CD. New technologies make the Knoppix Live CD very versatile and flexible, and there are many things you can do with the Live CD without having to resort to a full-blown hard disk install.

With a Live CD, you will be using Knoppix in the way it was designed for. You will be mobile. All you need to carry around is a CD and a small USB flash drive to store your settings and configurations. You will then be able to start Knoppix from almost anywhere with the same data, settings and even your own installed programs. A hard disk installation on the other hand, will tie you to the disk where you installed it, plus all the possible problems that come with a hard disk install.


Free up the CD Drive

toram cheat code

At the boot prompt, type "knoppix toram". Knoppix will load the contents of the CD into ram and run from there. After boot up, the CD can be removed and the cd drive will be available for other uses. Because this will take up a lot of ram, it is recommended for those with at least 1 GB of ram. See also Cheat Codes

tohd cheat code

Insert and start with the CD. At the boot prompt, type "knoppix tohd=<path to some hard disk>". For example if you have space in hda2, type "knoppix tohd=/dev/hda2. Knoppix will create a folder called "knoppix" in the disk you chose and run from there. After this, the CD can be removed. The disk partition used can be a Linux format such as ext3 but can also be fat32, but not ntfs. See also Cheat Codes.

At the next boot, you can save some steps by using the cheat code: "knoppix fromhd=<path to the disk you used>. This procedure has been called the Basic Poor Mans Install.

bootfrom cheat code

This allows you to use an iso image file stored on media. Insert the CD and start with the CD. At the boot prompt, type: “knoppix bootfrom=<path to where iso is stored>. After boot up, the CD can be removed. See also Cheat Codes.

Several different isos can be booted from the same CD. The only limitation is that the kernel version on the CD must be the same as that in the iso file. This method is often used to test remastered Knoppix iso files before committing to a burn.

There are also tweaks which allow you to do away with the CD altogether.

This method is more robust than a full-blown hard disk install. Since the integrity of the iso file is maintained just as it would be on a CD itself, the likelihood of problems arising is reduced.


Installing Programs

One of the limitations of a Live CD is that most of the system area is read-only – in particular, /usr where most executable programs are kept. Some programs can run from /home, which is writable, but many programs need to change and access components into standard locations like /lib or /usr/lib are read-only. Fortunately there are solutions.

Klik

klik website for details. There is also an entire section in the forum devoted to klik, including instructions on how to set it up for Knoppix.

Unionfs

Unionfs is another important development introduced into Knoppix from Version 3.8 onwards. Unionfs is a virtual filesystem. It creates a writable system file area in ram with all the system directories such as /etc /usr and so on. This is then seamlessly merged with the read-only system files on the CD. A very readable description of unionfs can be found here: Kyle Rankin on unionfs


Of course, you may still download an incompatible package which upsets Knoppix's delicate balance and break Knoppix, just like in a hard disk install. But this is a Live CD! The problems go away at the next reboot.

On the other hand, if you installed something which works well, you will not have to do it again. You can save it and it can be made available at the next session – see below.


Saving Configurations, Data and System changes

Save Knoppix Configuration

This can be launched from the Knoppix Menu -> Configure -> Save Knoppix configuration. It saves many configuration settings and also your /home directory into a file. It also creates a script knoppix.sh which will run at the next reboot to load the saved settings.

To load the saved configuration at the next reboot, enter the cheat code “knoppix myconfig=<path to where config was saved>.

For details see the following references:

Persistent Disk Image

This is one of the most useful features in Knoppix, and together with unionfs, makes Knoppix very versatile indeed. Earlier versions allowed the /home directory to be saved. From V3.8 onwards, the entire unionfs can be saved, so that configuration changes, settings, user data, packages which have been downloaded and installed etc can all be saved and will be available at subsequent sessions.

To set up a persistent Knoppix disk image, run Knoppix menu -> Configure -> Create a persistent KNOPPIX disk image (V5.0.1). You will be asked to select a location, a size, and a choice to use encryption (etc if you want to keep your data private). A image file knoppix.img will be created at the location you chose.

At the next boot, Knoppix will scan for any image file named knoppix.img and then ask if you want to load it. If you load it, any changes you make will be saved into the image file automatically.

Make multiple persistent images!

What happens if you make lots of configuration changes or download and install packages and then Knoppix breaks? Doesn't a persistent image bring the same problems as a hard disk install? Here, a good strategy is to make a copy of your previous, stable persistent image to another file e.g. backup.img. Knoppix will only load knoppix.img. Go ahead, do your experiments, make your changes, install packages etc with confidence. If Knoppix breaks, just rename backup.img to knoppix.img and you have very quickly rolled back to your last, stable and good configuration. It is certainly much easier than trying to fix a broken hard disk installation.