...making Linux just a little more fun!
By Edgar Howell
Given the fact that I started this article quite some time ago, at this writing -- early November 2006 -- events of the last week or so might make it appear I had uncanny knowledge of the future. (If you believe that, go to W@hotmail.info and give me your credit card number and I will tell you what horse to bet on next Saturday.)
Well, I was extremely unhappy when Novell took over SuSE, but decided to take a wait-and-see attitude. Novell, in my assessment, back in the heyday of Netware was as arrogant and expensive as Microsoft. Hmmm... maybe it's not surprising that they're sharing a bed these days.
Then there is the behavior of -- as someone here put it -- "Oracle's Chief Eccentric". If people are stupid enough to fall for his ploy, that could be the demise of Red Hat.
Admittedly an extremely pessimistic outlook (but pessimists aren't disapointed as much as optimists), what is plan B if the major GNU/Linux distributions on their respective sides of the Atlantic effectively go belly up?
Recently for some reason I thought about trying to get some more use out of an ancient notebook. Almost 8 years old, it had served me well for many years, has crossed the Atlantic with me on numerous occasions. Still, with only 64 MB of memory and 4 GB of hard drive and a slow CPU -- in this day and age, anyhow: AMD-K6 475 -- it hasn't seen much use of late.
On the other hand, Knoppix has been really impressive the last couple of years, including excellent hardware-recognition. Ought to be a snap to install it, particularly on something this old.
Well, maybe not. Notebooks, proprietary as they are, can be very difficult to install software on. This one gave me considerable grief early on with SuSE because there was a problem with PCMCIA on initial boot after installation.
Lest anyone think what is described in the following worked like this off the starting blocks - this was my 3rd attempt. For me, it's always the 3rd attempt that works: the first time, I learn what is going on; the second time, I figure out what really makes sense; and the third time is pretty much what I really wanted in the first place.
Category: Security
Blindfolded by people who (maybe) think they are helping to make passwords secure, I am normally forced to use very weak passwords to ensure the ability to enter them correctly again. Believe me, if you can touch-type, you can re-enter the same sequence twice and not know what it was! |
Since this machine had been in use at one time, the partitioning was irrelevant and so it was time to re-partition. And because it has far too little memory for current software, I gave it a swap partition of 256 MB. The remainder of the 4 GB was available for Knoppix. All this, of course, happened after a successful boot from the Knoppix 5.0 CD.
By the way, if the combination of main memory and disk storage is not adequate, Knoppix complains at length, sounding as if booting will fail. Same thing booting from the CD with the parameter NOSWAP.
But Knoppix boots fine -- it just doesn't boot into KDE. It announces TWM, which reminds me of FVWM (I think) -- as in "focus follows cursor" -- and I don't know when last I saw that! Perfectly usable, if you are comfortable with the command line.
Also, don't just allocate a partition for swap and expect it to be used. It must have partition ID 82 and, equally important, must have been initialized by something like: /sbin/mkswap /dev/hda1.
After that, installation was pretty much a piece of cake, other than a couple of problems discussed below. First, boot Knoppix from CD or DVD and start the installation process with "sudo knoppix-installer". All the pretty pictures aren't really justified, but just to make clear how straight-forward the process is, here they are:
After the introductory screen we select 'Install' since we haven't yet had Knoppix on this machine.
But before starting the installation, there might be a decision or two needed:
Initially I had tried to choose 'Knoppix' since I knew it from CD - but ran into problems. Debian worked fine, despite being the so-called "unstable" version.
Other than the swap partition there wasn't much choice.
I really wanted ext2 but that not being an option we (temporarily) live with ext3.
Your full name is, of course, up to you.
As is, ahh, your user name...
...and password.
Note the option not to hide the password as you enter it. In my book that is a sign of professionalism. This is quality software. Leave it up to me to decide whether it is safe to show what I am typing. No one can know in advance whether I am in a place where it is safe for me to look at the password as I enter it. Blindfolded by people who (maybe) think they are helping to make passwords secure, I am normally forced to use very weak passwords to ensure the ability to enter them correctly again. Believe me, if you can touch-type, you can re-enter the same sequence twice and not know what it was!
Now, we choose the root password...
...and the host name.
No need to worry about whether to tromp on the MBR - we're overwriting the entire thing, Master Boot Record included.
OK - we have now reached the critical point! Take a deep breath, and start the installation.
Yes, do save the configuration (otherwise, Knoppix bails out.)
Here is one last chance to review things.
And now a couple of informative windows to which no response was needed (I did reject creation of a boot floppy at one point).
There were many more such informative windows but that essentially was the entire installation. Pretty tame, right?
By today's standards this machine with 64 MB is so short of memory that almost no current OS could run on it. Even Knoppix can't, without help. Giving it a large (factor of 4) swap partition makes it possible for the system to install and function. But this has consequences that make doing it a judgement call: slow may be better than dead in the water, but how useful is it?
For example, OpenOffice is barely marginally useful. I used it to start this article because it gave me an HTML framework. Unlikely that I could have used it beyond that because of the "swapping" -- from hard drive to memory, which isn't there -- and thus to swap, which is on the hard drive...
And I wasn't particularly happy with the file system options. At least on this old hardware, which is never going to be run as a multi-user system, there is absolutely no need for journaling (besides, ":!sync" is powerful enough for me). So I turned it off. That, however, required adjusting the entry in /etc/fstab as well.
root@1[knoppix]# tune2fs -o ^has_journal /dev/hda2 tune2fs 1.39-wip (09-apr-2006) root@1[knoppix]# mount /dev/hda2 /mnt root@1[knoppix]# vi /mnt/etc/fstab root@1[knoppix]# head /mnt/etc/fstab # /etc/fstab: filesystem table. # # filesystem mountpoint type options dump pass #/dev/hda2 / ext3 defaults,errors=remount-ro 0 1 /dev/hda2 / ext2 defaults,errors=remount-ro 0 1 <<=== here proc /proc proc defaults 0 0 /dev/fd0 /floppy vfat defaults,user,noauto,showexec,umask=022 0 0 usbfs /proc/bus/usb usbfs devmode=0666 0 0 sysfs /sys sysfs defaults 0 0 root@1[knoppix]#
On boot, there were problems with lost IRQs. I tried several other boot parameters but they made no difference. In any case, it didn't matter: the default boot paragraph in the Grub configuration file is perfectly functional.
Some versions of Linux mount external devices automatically. This is not the case with Knoppix. I like to do "tail /etc/fstab" to find out what has just been made available and then mount whatever it is. Alternatively, you can just wait for hotplug to open a window asking about it and let it mount the device.
But the entries in /etc/fstab are not always appropriate. For example, if the entry for /floppy includes vfat, it may be necessary to mount it as "mount -t ext2 /dev/fd0 /floppy".
I also had considerable trouble with the UID/GID inserted into /etc/fstab by Knoppix on hotplug. Since there is no user or group "knoppix", I had to remove them to be able to mount as other than root:
web@lohgoamd:~$ tail -3 /etc/fstab /dev/hda1 /media/hda1 auto noauto,users,exec 0 0 # added by knoppix /dev/sda1 /media/sda1 vfat noauto,users,exec,umask=000,shortname=winnt,uid=knoppix,gid=knoppix 0 0 web@lohgoamd:~$ su password: root@lohgoamd:/home/web# vi /etc/fstab root@lohgoamd:/home/web# exit web@lohgoamd:~$ tail -3 /etc/fstab /dev/hda1 /media/hda1 auto noauto,users,exec 0 0 # added by knoppix /dev/sda1 /media/sda1 vfat noauto,users,exec,umask=000,shortname=winnt 0 0 web@lohgoamd:~$ mount /media/sda1/ web@lohgoamd:~$
Category: Old hardware
So what should we do, long-term, with old -- really old -- hardware? With a notebook likely there isn't much that can be done. But perhaps for an old PC it would be possible to obtain appropriate memory chips -- the most important consideration in improving performance -- such that it becomes responsive enough for use with OpenOffice and Co. |
Linux is supposed to be able to deal well with "old" hardware. True? I certainly think so. This test was unfair in the sense that it involved a notebook. They are notorious for creating problems... proprietary stuff is like that.
In booting this now-ancient notebook, Knoppix had far less trouble than my favorite distribution at the time. PCMCIA was a significant problem then. With Knoppix -- ho, hum... all my notes about "noacpi" and "nopcmcia" as kernel boot parameters were suddenly irrelevant.
But when is this a reasonable thing to do? I already mentioned that in my estimation, in this environment OpenOffice is effectively unusable because it's egregiously slow. Perhaps OK for collecting e-mail? Learning how to use OpenOffice? With only a serial interface available, this machine won't be used to access the Internet anymore.
I still haven't decided whether/how to use this newly available resource. Somehow, it seems inherently unreasonable to expect up-to-date desktop performance from old hardware, regardless of how recent the software release may be.
Perhaps I should have tried Damn Small Linux -- I didn't. Knoppix is BIG. Their 5.0 version on CD belongs in your tool-box but it isn't a server, and it wants X and KDE. That's a bit too rich for a basic system.
So, what should we do, long-term, with old -- really old -- hardware? With a notebook likely there isn't much that can be done. But perhaps for an old PC it would be possible to obtain appropriate memory chips -- the most important consideration in improving performance -- such that it becomes responsive enough for use with OpenOffice and Co.
Nonetheless, I had no trouble using it -- appropriately -- to write this article. As so often in life, a matter of picking and choosing one's tools (in this case Opera and Firefox and vi) and how one uses them.
The procedure in this situation is almost identical, so I won't bother with screen-shots that are the same. More important are the preparations beforehand and what might have to happen afterwards.
In this case, Knoppix is not supposed to take over the entire hard drive but just occupy one partition. If you don't have a partition available, likely it is best to first re-partition with familiar tools before starting the installation process. At least that's what I chose to do.
One of the nice things about using Knoppix is that installation does not take place in an unfamiliar and restricted environment; it is done through a script that runs after having booted Knoppix. In other words we have a familiar Linux environment, multiple windows and virtual terminals, and should the need arise, can do something that wasn't anticipated without having to cancel the installation and start over.
The installation script shows available partitions and asks you to select one. Any partitions that are too small for Knoppix won't be included in the list, so if you want a particular partition to be used and it isn't offered, you will have to cancel installation and increase the size of that partition (very often, that requires re-booting to get the system to use the new partition table). Unfortunately, Knoppix doesn't tell you this magic number. The DVD version of Knoppix 5.0.1 required about 11.5 GB.
Since this machine already has a couple of installations, it wouldn't be appropriate to replace the MBR - but that doesn't seem to be an option. So, let's back it up to a memory stick for later re-installation (thanks to Kyle Rankin):
sudo dd if=/dev/hda of=/media/sdb1/mbr_pc2 bs=512 count=1
After installation, restore the MBR (with a block size to omit the partition table) with something like this:
sudo dd if=/media/sdb1/mbr_pc2 of=/dev/hda bs=446 count=1
By the way, having to do it this way isn't necessarily a bug but can be considered a feature: you don't have to figure out what Grub needs in order to boot Knoppix. After installation, I copied /boot/grub/menu.lst to /media/sdb1/knoppix_grub and later copied the relevant sections from it to the file menu.lst in the partition normally used for booting.
Although this worked, it was Debian and I was still interested in having Knoppix as I know it. And as it turned out, this wasn't particularly difficult: when given the option to do so, save the configuration file somewhere convenient, then make modifications as desired. Here is what I used.
Having done that, you will need to load the configuration when given the opportunity before starting installation.
The screen where you can review the installation options then reflects these changes.
Strangely enough, booting failed with an error message from Grub. The command "savedefault" was followed by "Error 15: File not found". I didn't want to change the default anyhow and just commented out that command. Here is what I added to menu.lst. Since making that change, there have been no problems booting.
By today's standards this PC is getting on in age -- it's almost 3 years old. Something newer would definitely boot a bit faster: it takes some 5 minutes from the point in time that Grub is told which partition to boot. No surprise, considering that Knoppix goes through its usual check of available hardware. Maybe Debian would be better?
Quite some time ago, I was playing with a system that had an option to write status information to the swap space when the system was shut down. This could then be used on boot to speed the process up. I haven't looked for this with Knoppix, but it seems like a worthwhile idea.
One of the reasons that installation is so easy is that there are no confusing questions about what software to install. The downside is that an installation is way over 4 times the size of what I typically install with SuSE. Well, today hard drives are huge and cheap.
Worth note is that both SuSE and Knoppix start user IDs with 1000 -- I wonder if that has to do with conformance to LSB? Well, maybe not: just checked and Fedora Core 6 uses 500 as did SuSE a couple of releases back. Heck, I dunno. At least on a SuSE machine making an existing /home available should be possible (a task for another day.) The name change of the first user from whatever to knoppix, I could live with. Yeah, I know, that's not useful for a big environment -- but this is a small home office.
Before connecting to a network, you ought to consider following the advice of Klaus Knopper and modify /etc/sudoers. I did what he suggested and you can see that here.
The use of virtual terminals is different from that of SuSE or Red Hat; X runs on 5 rather than 7. Not a problem, but I did have to go looking the first time I wanted to return to KDE after having used a command line in a VT.
Although Knoppix belongs in everybody's tool box, it may not be your choice for a desktop environment. However, it is interesting having essentially the same system (5.0 vs 5.0.1) on both my notebook and my PC. I am looking forward to gaining more experience with this configuration once networking is set up and it is possible to do things like using X11 forwarding to start OpenOffice on the PC and use it from the notebook.
Talkback: Discuss this article with The Answer Gang
Edgar is a consultant in the Cologne/Bonn area in Germany.
His day job involves helping a customer with payroll, maintaining
ancient IBM Assembler programs, some occasional COBOL, and
otherwise using QMF, PL/1 and DB/2 under MVS.
(Note: mail that does not contain "linuxgazette" in the subject will be
rejected.)