The magazine of the Melbourne PC User Group

Knoppix Linux — A Three Way Winner
Morrison Hoyle
 


Morrison Hoyle describes how to set up and use Knoppix in RAM from a CD-ROM including opening files on a Windows partition without running Windows itself


Melb PC has recently made available to members a CD-ROM of Knoppix version 3.4 for just $2. I have demonstrated a few uses of Knoppix to two SIGs with other demonstrations arranged. The interest has been so great and there have been so many questions asked that have given rise to this article -which should help some of those interested.

Before going further, it should be made clear that Knoppix and all the programs on the CD are totally free to be used and copied in accordance with the GNU/GPL license which is displayed there.

So what are these three ways in which Knoppix is a winner?

1. Klaus Knopper developed his own Linux compilation to provide a means of troubleshooting, rescuing and repairing a PC which, for various reasons does not boot. Or, it may boot but the operating system does not recognise all the devices such as the floppy or CD-ROM drives. Another failure recently reported which stumped the "guru" on the ABC Melbourne Computer Help program was that only some directories were found by Explorer so that the owner had no means of accessing vitally important documents and files. By setting the BIOS to boot first from the CD-ROM, Knoppix will automatically create a ramdisk, detect the PC hardware and enable the running of programs from the CD without loading or in any way affecting the hard disk. This provides the ability to overcome some of these problems.

2. The second attraction of Knoppix is to those for whom Microsoft Windows has lost its appeal. I do not intend to embark upon a long criticism of Windows. In addition to their own experiences, those who read the computer magazines and listen to the computer talk back shows on radio are well aware of the range of problems as well as costs involved in using that particular operating system. But for many, the idea of testing an alternative can be extremely daunting.

How to gain some insight into another operating system without abandoning or damaging their existing programs and files has deterred many PC users from looking beyond Windows. Booting Knoppix from the CD-ROM provides a complete desktop operating system with a huge array of programs and tools to give the user a valuable insight to Linux. In fact, there is almost 2 GB of executable software on the CD-ROM in compressed form - which is decompressed and run from the ramdisk as required. The inset on the next page shows the summary of contents as described by Klaus Knopper. Armed with this information and the ability to use the OpenOffice suite, browse the Web, use e-mails and many other things using Knoppix, users might wonder if they would not prefer to have this system on part of their hard disk as an alternative OS. You can even virus scan the Windows partition from Knoppix.

3. This leads to the third winner from Knoppix. Having explored the system thoroughly using it as a "live CD", the time comes when many would like to be presented on booting the PC with a simple menu to select whether to boot Windows or Linux. This can be done without damaging the Windows partition/s in any way. By reading some of the text files on the Knoppix CD-ROM and by following information on and linked from http://www.knoppix.net one can find how to do this and later in this article, the essential steps are described.

System Requirements
  • Intel-compatible CPU (i486 or better),
  • 20 MB RAM for text mode, and at least 82 MB for graphic mode with KDE. (To run various Office applications, at least 128 MB is recommended),
  • a bootable CD-ROM/DVD drive (IDE/ATAPI, Firewire, USB or SCSI),
  • a standard SVGA-compatible graphics card,
  • and a standard serial or PS/2 mouse, or IMPS/2-compatible USB Mouse.
If you later choose to install Knoppix to a hard disk and you do not have a spare disk, make sure there is some empty space on the hard drive so you can create at least 2 Linux partitions, one for the System (for Knoppix, the minimum is 3 GB and 5 GB is recommended) and between 200 and 400 MB for a swap file.
 
You should get the latest Knoppix version which at the time of writing is 3.6. and is made available this month as an extra disc to the Melb PC monthly CD-ROM.
 
Booting From the CD-ROM for the First Time

As a long time Linux user, I have experienced problems in the past due to some distributions failing to detect and set up the hardware - video, mouse, modem etc. I know that some people have given up on Linux because of similar experiences. Knoppix however, has first class hardware detection. So at the boot prompt, just pressing Enter is all most of us will have to do. There are dozens of options that can be inserted at that point if you wish to take control of some aspects of your system. Read the file knoppix-cheatcodes.txt in the CD Knoppix directory which lists these options. I recommend typing knoppix26 at the prompt and that will load the latest version 2.6 kernel with support for the most recent hardware and peripheral devices.

Then just observe as Knoppix detects and sets up your devices, turns on DMA etc. In less than three minutes the graphical interface is loaded and you are ready to go. Figure 1 shows the working screen, one of four available.
 



Figure 1. The Linux desktop using the KDE environment running from the Knoppix CD-ROM.

You are probably now tempted to explore the menus and look at the almost bewildering array of programs available to you. More on these later.

Retrieving Files from the Windows Partitions

Knoppix will have automatically found all the partitions on the hard disk. The disk on the first IDE connector is assigned hda, the second hdb and partitions numbered hda1 and so on. If hda1 is the first and bootable Windows partition, clicking on the icon will not produce a response because the partition is not, in Linux terminology, "mounted" or connected. To mount it, right click on the icon and select Mount. (The default in Linux is a single click) The icon then changes to show a small green add-on. Now click the icon and you can access all the Windows directories and files using Konqueror, a Linux file explorer and browser. Click on documents and OpenOffice will open and show the files but you cannot yet edit or remove them. Image and text files and Web pages stored on the Windows partition can all be viewed without using any Windows software. You cannot yet copy and paste files as the OS is still working from a read only CD-ROM. You could insert a blank floppy, mount it and copy to that but floppy disks are going out of fashion because they have such a small capacity. Here is where you are saved if you have both a CD-ROM or burner and DVD ROM. Knoppix includes under Multimedia/K3B CD & DVD Burning which will burn CDs and works much the same as Nero under Windows.

Another option is to e-mail the document or file. Go to
Internet/KPPP/Configure/Accounts and enter the details for your ISP. Selecting Device may default to /dev/modem but using KPPP/Modem/Query Modem will soon clarify where one is connected if you are not sure. Note that Linux knows COM1 as ttyS0, COM2 as ttyS1 etc. And no, you do not need modem drivers for Knoppix and you never need to reboot after setting up a modem, printer, scanner and the like. e-mail clients provided are Kmail and Mozilla Mail which are easy to set up.

Never overlook the help information available from the Help/Info and /Man menu items. To print documents you need to go to Knoppix/Configure/Configure Printers and use the wizard. Very few printers will present a problem although some manufacturers are only slowly becoming Linux aware.

Editing/Modifying Files on the Windows Partitions


Until now, this has not been possible because the partition has been in the default Read Only mode. Click on the partition icon and under Properties/Device uncheck the Read Only box - see Figure 2. You now have free rein over Windows. In this mode you can also run Wine (Wine Is Not an Emulator!) which will enable you to run some programs on the Windows partition without using Windows -but this is another subject beyond the scope of this article. Go to http://www.winehq.com for more on this useful tool.

Exploring the Knoppix Linux Operating System

This probably needs little explanation as this is largely intuitive. If it all works rather slowly, remember that each program is being run from the ramdisk after uncompressing from the CD-ROM. The smaller the amount of RAM, the more noticeable this will be.



Figure 2. Changing the Windows partition from Read Only to access it from Knoppix.

It is interesting to explore every main and secondary item on the menu but even then you will not be aware of several hundred executable programs such as those in the /usr/bin and /user/sbin directories. From a console (click on the screen in the taskbar), type mc and press Enter and explore the system using the wonderful Midnight Commander - reminiscent of the Xtree that we old DOS users remember so well. You can get there via Utilities/Tools/mc. Of all the software, I admit to being amazed by KStars -Edutainment/Science/KStars which is a planetarium program to fascinate anyone interested in the skies above.

As an aside, for those of us fortunate to have 1 GB of RAM, an option on booting is to type Knoppix toram so that everything is copied and operated from there. This leaves the CD drive free for burning files you have rescued from Windows.

Installing Knoppix To a Hard Drive

Linux has a regime of permissions. As "root" or administrator, you can do anything including wreck the system. Normally, it is better to work as an ordinary "user". Passwords control access as a defined user or as root and Knoppix assumes that you do not have root privileges to prevent you from inadvertent damage to the system. Installing to a hard drive requires root privileges so open a terminal or console and at the default prompt
    
      knoppix@0$

     type
su and press Enter   (su meaning superuser) and the prompt changes to

      root@)[Knoppix]# or similar

Initiate the installation process by typing
knoppix-installer and press Enter and a 5-step wizard will begin which includes the use of the clever partitioning tool qtparted. Figure 3 shows a typical display when interrogating the first hard disk hda with two existing FAT32 formatted partitions. It is too late to check whether or not you defragmented your hard disk before you began all this, preferably with a program like Norton's Speeddisk or Vopt by Golden Bow Systems, which do a much better job than Microsoft Defrag.

I have cheerfully partitioned drives on a number of PCs like this, and to date have not lost any data on the Windows partition. However, you would be well advised to copy all critical data elsewhere first.

First, create a Linux swap partition of about the size of twice your system RAM. Then create a root partition mounted as "/" which
qtparted will format as the default type ext3. You can change your preferences at will because nothing will be changed on the disk until you select File/Commit.



Figure 3. Using QTPARTED to partition a hard disk from the Knoppix Linux Operating System

The next step will be Configure Installation and of the three choices, "Beginner System" is advisable. You will be asked to set up accounts for a normal User and for Root with passwords for each. You can uncheck "Hide typing" if you have a really bad memory!

The rest is all quite straightforward but when you are asked where to install the boot loader, choose MBR. Later, when you boot the PC, a simple menu in the Master Boot Record will give you the choice of Linux or Windows.

Finally you will see a list of the configuration options you have chosen and if you are happy to proceed, click Next. It is a good idea to accept the option of producing a boot floppy when that is presented to you.

About twenty minutes later, all will be done and you can reboot the PC after the CD has been ejected on completion of the installation.

Strangely, you now actually have a Debian Linux installation so that you can use all the Debian tools to update and expand the system from the local mirror sites. For help look at http://www.debian.org.

If you would like to go over this from another perspective, there is a useful tutorial at http://www.eleli.de/knoppix/docs/tutorial.

For information on how to make maximum use of Knoppix, a new book from the O'Reilly publishers is "Knoppix Hacks - 100 Industrial Strength Tips and Tools" by Kyle Rankin. ISBN 0-596-00787-6 with a list price of US$29.95. Some examples can be found at http://www.oreilly.com.

What software is on the KNOPPIX-CD?

In addition to a standard Debian based GNU/Linux distribution http://www.debian.org the following “highlights” are available on the CD:

• KDE V3.x as the standard desktop, with KOffice and the Konqueror WWW browser.
• X Multimedia System (xmms) with MPEG video and MP3 support as well as the
    Ogg Vorbis Audio Player
• Internet-access software kppp and isdn-utilities
• Mozilla browser, Mozilla Mail, Mozilla News
• Scribus desktop publishing program
• Gnu Image Manipulation Program (GIMP) Version 2.0
• Tools for data rescue and system repair
• Network analysis and administration tools
• OpenOffice(TM) 1.1.x, the GPL version of the well-known StarOffice(TM)
     office suite
• Many programming languages, development tools, as well as libraries for
     software developers.
• Altogether, over 900 installed software packages, comprising over 2000
     executable user programs, utilities, and games.

Reprinted from the December 2004 issue of PC Update, the magazine of Melbourne PC User Group, Australia

[ About Melbourne PC User Group ]