THE OPEN PITT What's cooking in Linux and Open Source in Western Pennsylvania =========================================================================== Issue 23 April 2006 www.wplug.org =========================================================================== In this issue: Hacking Knoppix, Part 1 March Roundup Links of the Month --------------------------------------------------------------------------- Coming Events Apr. 1: General User Meeting, Topic: Linux on PowerPC. 10am to 2pm, 3002 Newell-Simon Hall, CMU Apr. 29: Special Presentation, Topic: Virtualization with Bob Good of VMware. 10am to 2pm, 3305 Newell-Simon Hall, CMU The public is welcome at all events --------------------------------------------------------------------------- Hacking Knoppix, Part 1 by Sean Parsons In Part 1 of this article, Sean Parsons shares some tricks he picked up from the book _Knoppix Hacks: 100 Industrial-Strength Tips and Tools_ by Kyle Rankin, published by O'Reilly Media . Knoppix is a bootable live system on CD or DVD, consisting of a representative collection of GNU/Linux software with automatic hardware detection. It can be used as a productive Linux system for the desktop, educational CD, rescue system, or adapted and used as a platform for software demos. It is not necessary to install anything on a hard disk. On-the-fly decompression allows the CD to have up to 2 GB of software installed on it (over 8GB on the DVD "Maxi" edition). _Knoppix Hacks_ comes with a copy of Knoppix 3.4 on CD. There are actually 100 well-written high-quality hacks in this book (and if you do much technical reading you'll know that is an amazing accomplishment in and of itself), and I recommend playing with them all. But I will concentrate on a few of my favorite hacks included within its pages to help provide you with an overview of its usefulness. Hack #5: Free Your CD to Make Knoppix Run Faster This hack mentions three commands at the boot prompt that can make Knoppix run faster. If you use the "toram" command at the boot prompt it will load the entire OS into memory so you can eject the CD and use your drive for music CDs or other discs. This requires that you have at least 1 GB of RAM. Knoppix will take up approximately 700 MB and the other 300 MB will be used for running applications. The "tohd" code copies the CD to a partition on your hard drive. This partition can be any filesystem that Knoppix supports, including some Windows filesystems such as FAT and FAT32. Here is an example: knoppix tohd=/dev/hda1 This would write Knoppix to the first partition on your first hard drive. On subsequent boots you can use the saved partition with: knoppix fromhd=/dev/hda1 A variation on this theme, the "bootfrom" command lets you boot an ISO file on your hard drive (the boot disc and the ISO must use the same kernel version), as in the following: knoppix bootfrom=/dev/hda1/Knoppix.iso All of these options free up your CD drive and generally make the system more responsive than running from the CD. What I used Hack #5 for: I used "bootfrom" on one of the PCs at work so I could happily use Linux myself without getting in trouble with IT for reconfiguring the machine. I also used this hack at home when remastering Knoppix (as we'll see later). Hack #21: Create Persistent Knoppix Settings Knoppix has the ability to save onto floppies, USB drives, or other removable media the changes made during your session, such as: * Personal configuration (desktop, programs) * Desktop files * Network settings * Graphics settings * Other system configuration (printers, etc.) * Your entire home directory You can save your settings by running "KNOPPIX -> Configure -> Save KNOPPIX configuration" from the menu or with the following command in a terminal: $ /usr/sbin/saveconfig A dialog box will appear allowing you to choose which settings to save. To use these on a subsequent boot, enter this at the boot prompt: knoppix myconfig=scan To create a persistent home directory you can use the menu item "KNOPPIX -> Configure -> Create a persistent KNOPPIX home directory" or run the command: $ /usr/sbin/mkpersistenthome You will be prompted where to save your home directory. This file can then be accessed from the boot prompt with the command: knoppix home=scan Instead of using scan, you can also type in the file name manually, such as "home=/mnt/sda1/knoppix.img". What I used Hack #21 for: I've been saving a persistent home directory on my USB drive for a workstation at work. This in combination with Hack #5 has kept me happy and productive. Hacks #32, #33, and #34: Installation These three hacks deal with putting Linux onto your hard drive. Hack #32: Explore The Knoppix Installer teaches the ins and outs of the installer. At a minimum, you will need at least 2.5 GB of hard drive space. If you have less than 512 MB of RAM, you'll need a swap partition of at least 128 MB. You can launch the installer from a terminal with: $ sudo knoppix-installer It provides the following options: * Create a new configuration * Start the installation * Partition the hard disk * Load an existing configuration * Save the configuration Hack #33: Install Knoppix as a Single-Boot System provides directions to install Linux to your hard drive on its own. Once the Knoppix installer has been launched, choose the option to partition the disk. QTParted will start and you'll need to create two partitions. The standard theory for your "swap" partition is for it to be somewhere between one and two times the size of your machine's RAM. The rest of your hard drive should be made a single "ext3" partition. Keep in mind that it needs to be at least 2.2 GB in size. (If instead of the Beginner mode you use the Debian install type, you can pick either the "ReiserFS" or "ext3" filesystems.) To start the configuration process, select the option to create a new configuration and click OK. Select the Beginner mode. From here the choices should be obvious, except where to install the boot loader. Since this will be the only operating system on the hard drive, pick Master Boot Record. Once the configuration is done, choose Start Installation and click OK. Read over the list of configuration options and select Next to start installing to the drive. Hack #34: Install Knoppix on a Multiboot System provides instructions on sharing your hard drive between Microsoft Windows and Knoppix. You'll need to defragment your disk from within Windows before you get started, then reboot with your Knoppix disc and launch the installer. Then use QTParted to resize your Windows partition (most likely located at "/dev/hda1"). You'll want to make at least 2.5 GB of free space available. This will give you room for a 2.2 GB root partition and a swap partition. To start the configuration process, select Configure Installation and click OK. From here use the Beginner mode. Again, the choices should be obvious, except where to install the boot loader. If you have some experience with dual booting you can use your own judgment, but personally I would still select MBR. Once the configuration is done, select Start Installation and click OK. Review the list of configuration options and click Next to start the installation. Your Windows partitions will be automatically detected and get added to the boot choices. When you reboot, remove the CD and you should now be able to boot into either Windows or Knoppix. What I used the installation hacks for: I used a modified version of Hack #34 to multiboot Knoppix alongside another GNU/Linux distribution. Coming Next Month In Part 2, we'll look at securely wiping clean a hard drive, repairing a damaged bootloader, and creating your own customized version of Knoppix. Sean Parsons has been happily hacking on GNU/Linux for over four years and is very excited to give back to the community through WPLUG. --------------------------------------------------------------------------- March Roundup Mar. 11 General User Meeting: A database doubleheader led off with David Ostroske giving an introduction to Structured Query Language (SQL). He showed off some of the basic types of queries that can be performed using the MySQL query browser. Bill Moran followed with a demonstration of writing client applications in PHP to access a PostgreSQL database. Included were tips on using stored procedures and variations encountered when using different database servers. --------------------------------------------------------------------------- Links of the Month by Michael P. O'Connor We'll take it easy this month, and look into some games for Linux. It should not be much of a surprise that tracks the latest news on the Linux gaming scene. A dozen projects are also hosted on the site. You can find more news about fun stuff at the Linux Game Tome at . It includes an extensive search and rating system for over 1800 games. If you are interested in eye candy, offers a repository of some 3-D games for Linux. Answers to some frequently asked questions about finding, installing and running games on Linux can be found at the Linux Gamers' FAQ at . Keep sending in your suggestions to me at . Till next month, enjoy these links! =========================================================================== The Open Pitt is published by the Western Pennsylvania Linux Users Group Editors: Elwin Green, Vance Kochenderfer Copyright 2006 Western Pennsylvania Linux Users Group. Any article in this newsletter may be reprinted elsewhere in any medium, provided it is not changed and attribution is given to the author and WPLUG.