|
|
How to use the Knoppix live CD
|
Most Windows users would be familiar with the Windows Boot Disk. This is one of the simplest examples of a "live floppy drive". It contains a complete (though rudimentary) DOS operating system, utility programs and it can run from the floppy drive without needing to be copied to the hard drive.
Similarly, the bootable Windows installation disk is an example of a live CD, although the live CD functionality is used only as a utility disk and to install Windows.
In the Linux world collections of software used to operate a computer are called distributions. Because Linux and most of the utility software is open source there are few barriers to innovation and as a result there are hundreds of Linux distributions to choose from.
Some of the more popular ones are:
A very comprehensive listing of many live Linux CD's is available for perusal at http://www.frozentech.com/content/livecd.php
One of the first and still one best live Linux CDs is called Knoppix (named after Klaus Knopper the lead developer on the project).
Knoppix is CD based version of Linux that, when booted, will allow the Linux system to run, will auto-detect a large range of hardware and install drivers for hardware seamlessly.
Knoppix will provide a very large range of programs in addition to the basic operating system including games, multimedia functionality, CD and DVD burning, Office suites, mail programs, programming utilities and compilers etc. etc.
All of this is accomplished without disturbing the underlying system configuration of the computer being used as a base.
Knoppix live CDs are freely available for download and burning an iso image (ie. a CD image).
After the Knoppix system is shutdown and the live CD removed, the underlying Windows system (for example) will be exactly as it was before the Knoppix session was begun (unless the user had purposely copied some files to the hard drive).
The operation of Knoppix does not, of itself, need to copy any file to or modify the existing system in any way.
Knoppix is very good at detecting all the hardware on a computer (eg. network cards, video cards) and automatically running the correct drivers.
Knoppix has a excellent "on the fly" compression algorithm which allows it to contain a wide array of utilities and programs on a single CD.
Knoppix is open source and hence freely and widely available for download.
Knoppix is based on Debian Linux, which is itself a widely deployed Linux distribution.
For those wishing to preserve an existing system configuration (eg. a Windows partition) Knoppix can be used from the CD, leaving the underlying system pristine.
Alternatively, Knoppix can be installed to the hard drive, if required.
In relation to those courses there would seem to be a few prime target user groups:
The range of software is too extensive to canvas in this context but most new users will be surprised at the scope and extent of the inclusions - almost every conceivable program grouping is covered.
Many of you will have experienced a situation where you want to use some Linux functionality, as a first choice, but find that the only box available is some different system (probably Windows). A common example is a work computer or a friend's computer over which you have no authority or desire to alter the configuration. In such an instance (love that C++ programmer talk) you can boot up the Knoppix live CD, accomplish whatever tasks are required, remove the CD and reboot to a Windows box exactly as it was before your arrival.
Thus, you can complete your iCanProgram tasks on an existing Windows
box - in your lunch break, coffee break, before or after work with no adverse
effects or abuse from the SysAdmin!
The Knoppix Live CD is all contained on just one CD.
For those of us in countries with widespread broadband access we are lucky, because this image is quite large at 700Mb.
If you do not have access to a broadband internet connection you can:
It contains all the files from the source system in the correct locations on the drive to enable the system to operate successfully.
As an example, if a Windows system was installed to a clean hard drive and all the files that were needed for complete operation were loaded (eg Office, Photoshop etc), it would be possible to create what is known as an image of the hard drive.
This image is generally created as an iso file that contains every file from the hard drive. If such an image was obtained it would be possible to format the drive back to clean and unpack the image file to it and the resulting system would be identical to the original system.
Although the iso file is one single file with a .iso extension it contains many individual files and directories in a complete package.
VERY IMPORTANT POINT... When the iso file is obtained, it should
be burned to a CD using appropriate iso burning methodology. DO NOT
simply copy this file to a CD as it will not be unpacked properly and it
will not boot!
For example, many ISP's have free download areas where Knoppix iso files can be found. If you know of such a site and prefer to use it, that is fine.
However, if you do not know where Knoppix files might be located then point your browser to:- http://www.knoppix.org then click on one of the flag icons to be directed to the page for your language.
Find the download link (which on the current version of the web page is the second in a row of penguin graphics) and click on it.
You will be directed to a list of Knoppix mirrors in various locations around the world. Pick an appropriate site near you and click on the link to one of the protocols (rsync, ftp, http) ... if you are unsure of what ftp, http or rsync are then just click on the http protocol entry for your chosen mirror.
You will be directed to a page containing the download agreement and asked to read and accept it.
Once you have read and accepted the agreement you will be directed to a page on which there are many file entries. The file you will be looking for may have a circular CD icon (in Internet Explorer) or a question mark icon (in Firefox) and will be about 700Mb in size.
There may be more than one file that looks like this and the naming convention should be intuitive. It is:
KNOPPIX_(version)-(date)-(language).isofor example Knoppix 3.6 for English language is
KNOPPIX_v3.6-2004-8-16-EN.isoDownload this file and burn it to a CD.
Usually, in Windows, if you find the location of the file in Windows Explorer and double click on it, the appropriate burning methodology will be started.
Otherwise, consult your CD Burner documentation on how to burn an iso image. The most important issue here is that the iso file is burned appropriately and not just copied to a blank CD.
If you have burned the CD correctly it should be bootable (make sure your BIOS has the CD boot option before the HDD boot option though).
The first screen from the CD will take you to the boot: option.
It is possible to pass many paramaters to the boot command but if this
is just left blank and the ENTER key pressed (or just wait a few
seconds) the system will boot into the Knoppix GUI which is KDE Desktop.
Knoppix documentation indicates that 20 Mb RAM is required to run in console (text) mode and a minimum of 82 Mb is required to run the GUI (although 128 Mb is preferred). Even if there is sufficient memory, running in a ramdisk has limitations. One major limitation is that data can only survive while the system is live and any files that are saved will be lost when the system is powered off.
To permanently save files some persistent storage device (eg hard drive, floppy drive, CD burner, USB memory key) is required. It is then possible to save files such as the lesson files, source files and executable files on these devices for later use. In unix systems hardware elements are known as devices and they usually have entries in the /dev filesystem associated with them. It is necessary to mount devices on mount points before they can be accessed for reading or writing.
As you travel along the unix/Linux path you will learn more about the /dev filesystem and mount points but, for the moment, all that is needed to know is that the current version (and the current version of Knoppix is ver 3.6 or 3.7) of Knoppix will handle device detection and mounting automatically. The following sections will provide a guide to the use of persistent storage devices with the Knoppix GUI for:
When the Knoppix CD boots into GUI mode several icons can be seen, depending on the system configuration of the computer. There will be several storage icons present (on Windows systems there will be at least one hard drive icon (Hard Drive Partition hda1) and possibly other partitions (eg Hard Drive Partition hda5 etc). There will also be CDROM and Floppy icons. Now, although the hard drive partitions have been detected and mounted (by clicking on the icons the content of the hard partition can be seen) they will only be mounted in read-only mode - the only devices accessible for writing are the floppy drive and the CDROM.
Now! At last we get the the point!
Using a terminal, it is possible to copy a file somefile.txt in the current directory to the floppy with the following command:
cp ./somefile.txt /mnt/floppy/somefile.txtor if it was desired to copy a file lesson1.tar to the floppy the following command would be appropriate:
cp lesson1.tar /mnt/floppyAnother alternative might be to declare /mnt/floppy as the home directory using a boot parameter (this will be covered later) and the default directory will then be the floppy drive. Two issues with floppy drives is that saving too them is slow and their capacity is small. Further, if there is no formatted disk in the drive the system may object.
su rootand then enter
k3bto start the burning software. The default home directory for the Knoppix disk is /ramdisk/home/knoppix - that is where saved files will be found for burning. It is not advisable to declare /mnt/CDROM (or /mnt/CDROM1) as a home directory as saving files to it is not just a simple write operation. Using the CD burner for storage is probably the least flexible of all the methods described in this document and may not be the most favoured solution.
NOTE: If the system hard drive or some network enabled partition is to be used for storage, please ensure that such a use of resources does not operate counter to any IT policy in place ... make sure you are authorised to use the system in this way. Remember the old saying "Hell hath no fury like a sysadmin scorned".
The reason that the use of hard drives and memory keys is very similar is because the system actually "sees" a memory key as a SCSI hard drive and it is mounted on the /dev/sda1 mount point (or something very similar). When a USB memory key is plugged into a USB socket a new icon will appear on the screen indicating that the device has been detected and mounted on the sda1 mount point. The major difference between setting up a floppy, using a CD burner and using hard drives/memory keys is that the two former are write enabled but the two latter are not write enabled.
This means that a new method has to be used to write to the chosen device. Fortunately, Knoppix has a built in script for accomplishing this task. The script can be found in the program menu in the KNOPPIX group. Clicking Knoppix and then Configure brings up a sub-menu which includes an entry
Create a Persistent Knoppix Home DirectoryClick on that entry and follow the prompts (read the message boxes because there is good information in there that will allow you to reboot to a system using the newly created directory as the home directory). The first message box asks if you want to establish persistent storage, the second message box asks where and the third box asks whether to use the full partition or establish an image file. If you are using a home directory on removable media, such as a memory key, the memory key must be plugged in, otherwise errors will occur. When you reboot the system or start it again anytime after establishing a persistent storage device, a parameter must be passed at boot time indicating where the home directory can be found.
The very first screen when Knoppix boots shows the boot: prompt and waits a period of time to see if boot parameters are provided. There are two options - the first is to pass an boot parameter indicating where the home directory can be found:- eg
boot: home=\dev\sda1 (for a memory key)or
boot: home=\dev\hda1 (for a hard drive)or
boot: home=scanThe scan parameter will cause the system to search for the new home directory. After this, when files are saved to the default home directory they will be saved to the new location and , since the new location will persist even if the system powered down, the save will be permanent.
References:
1) site
containing links about Knoppix CDs
2) site where inexpensive copies of Knoppix CD's can be purchased
3) book on Knoppix CD. Knoppix Hacks by O'Reilly ISBN 0-596-00787-6
Special thanks to Frank B. for his many contributions to this HowTo page.