Living without Windows!by Jos Visser
Part 2: Installing Linux
So, Saturday 21st would be the first day of my new existence. After the welcoming of Sinterklaas I retreated to my study in order to save my valuable data, ritually remove Windows NT from my laptop's hard disk and install Linux.
Now installing an operating system usually is a very drastic affair, especially if the new OS uses a different native file system format. Microsoft takes care to allow its operating systems (Windows 95 and Windows NT) to interoperate in the same disk space, but to really run Linux (or any other UNIX for that matter) requires a fresh, dedicated, disk partition. My laptop's hard disk is not big enough to comfortably support both Windows and Linux (it is only 1GB), and anyways, I had decided to make a clean break. So I had to remove all existing partitions and create two new ones to hold a Linux file system and a Linux swap space. In my old life, my laptop contained three disk partitions: 1 FAT file system (C:), 1 NTFS file system (D:) and a FreeBSD partition holding a minumum FreeBSD system. Each of these held valuable data that I did not want to lose. So the first step would be to save my data.
For reasons like these I always have a free gigabyte floating around somewhere on my desktop computer and I decided to use it to hold a complete copy of my laptop C: and D: drives. I booted my desktop in Windows NT, hooked up my laptop to the home LAN (which currently does not stretch beyond my study) and copied all the files on C: and D: across the network to the free hard disk in my desktop (with the XCOPY command). Just to be sure, I found a few hundred free megabytes of disk space on another hard disk and decided to duplicate the main data directories of my laptop (C:\WORK and C:\XFER) onto this hard disk as well. The copying itself was uneventful, but took some time.
After having saved my Windows data, I also had to save some data files that lived in the FreeBSD partition. I could not use network copying in this case because I had never taken the effort to get FreeBSD to recognise and use my PCMCIA Ethernet card. Instead, I booted FreeBSD, created a "tar" archive of the few data files I wanted to save, mounted the C: partition from FreeBSD and copied the tar archive to /C/tmp (which is the C:\TMP directory in Windows). After that I rebooted into Windows NT and copied the tar archive (across the network) to my desktop machine.
My data was safe, time to sink Windows NT.
I sometimes teach a "Fundamentals of UNIX" course in which I try to explain UNIX basics such as "ls", "vi" and "chmod" to UNIX newbies who are on some track to become a UNIX user, administrator or programmer. Just the week before SANE (see Part 1) I taught a 2-day UNIX introduction course in Zoetermeer to a bunch of folks who were being trained in Netware and Windows NT. For most of the "Where do you want to click today?" generation, UNIX is very hard because it requires some imagination and a structured thinking process before you can achieve something useful. To prevent the ritual abuse of the UNIX fundamentals teacher, I decided to try something different this time.
Usually when I start a course I have a standard introduction about who I am and what we are going to do in the next couple of days. This time I started off by explaining:"Hi everybody, my name is Jos Visser and in the next two days I am going to introduce you to the wonderful world of UNIX. In these next two days you will be complaining a lot and swearing at me wholeheartedly because you will find UNIX too complex, with too many commands having strange names and too many different options. This is perfectly allright though and I am fully prepared for this. I encounter this behaviour all the time and it is completely reasonable, because UNIX is only for EXPERTS."At that point I turned around and wrote "EXPERTS" in large, friendly, letters on the white board. As you can imagine, after this introduction nobody dared to complain about UNIX's complexity because of fear of immediately qualifying oneself as a non-expert!
In the coffee break of the second day, one of my students was moaning about long download times. So I inquired what had taken such a long time to download. "Service Pack 4" he answered. I immediately began a lenghty explanation about that you should not download SP4 in the first place. To really make a difference you should upload Windows NT with an attachment saying: "Look, here it is, we tried it but it is completely useless. Please take it back so that we can move on with something more productive".
Now, only 2 weeks later, I was about to do so myself.
My laptop does not contain a CD-ROM drive, so the installation of Linux had to be done over the network. Fortunately this is something that Linux (like FreeBSD) understands pretty well. The CD contains images of install floppies and some tools to copy these images to a floppy disk. Using one of these commands I created an install floppy that I could use to bootstrap the installation procedure on my laptop. I kind of hoped that the network install could be done using FTP as well as NFS. My desktop computer (called Belana) was still booted in Windows NT and I happen to run the Microsoft IIS FTP server software and I decided to perform the Linux network install with the CD-ROM being accessible through FTP from Belana.
You might appreciate the irony, me removing Windows NT from my laptop and installing Linux with the help of a Windows NT FTP server! I could just as well have rebooted Belana in Linux and used that as an FTP server, but hey, why bother! I inserted the install floppy in my laptop (which is called Jadzia) and rebooted.
One of the beautiful things about Linux is that its installation procedure runs under Linux! The install floppies of the various distributions contain a bootable Linux kernel and a small set of programs that is used to partition the hard disk(s), create the file systems and install one or more Linux packages. SuSE's install disk is not different. The Linux kernel booted and the install program started.
In general, UNIX installation programs are hard. Diffcult, and hard. As a veteran UNIX installer (having installed various flavours of UNIX more than a 1,000 times over the years) I can install UNIX almost with my eyes closed. I can however imagine that the installation of Linux (or any other PC based UNIX) is beyond most users. You have to do all kinds of magic things like creating partitions, assigning mount points, creating file systems, marking partitions active, modifying the hard disk boot sector, selecting packages to install and, in case of Linux, configuring the Linux OS loader (LILO). In this specific case, I also had to configure the system for networking and point it to Belana as the FTP server where the SuSE Linux CD-ROM was available.
If Linux is ever to become a serious threat to Windows, we need a much more friendly install procedure.
However, the complexity of the Linux installation procedure does not bother me at all. I started off by creating two partitions: one 128 MB partition for swap space and the rest (900 MB) to hold one big Linux file system (/). As I pressed OK in the partitioning tool I went passed the point of no return. My hard disk was completely reconfigured! Moving back now involved at least as much work as moving forward. In any case, I have never been a person for looking (or going) back, so: Forza Linux (this is Italian)!
In the next step, I get to select additional device drivers to get Jadzia going for the rest of the installation. To save resources, the install kernel does not load too many drivers and if you have a network or a SCSIcard, now is the time to load the device drivers for them. Since my network card is PCMCIA based I worried a bit whether Linux would recognise it. Remember I had never been successful in getting it to work under FreeBSD! From the "Device" menu I selected the PCMCIA option and crossed my fingers. My fear proved entirely unjustified, the Linux PCMCIA card manager flawlessly recognised both my PCMCIA Ethernet card and my PCMCIA modem card! Three cheers for Linux!
Now the Linux installation could really start. The SuSE folks have written an interactive tool for this called Yet Another Setup Tool (YAST). It works quite nice (for me) and I have used it regularly since then to update the system with extra software. For the not so knowledgable, YAST can also assist you in performing basic Linux system configuration. In a menu I got to choose where the Linux CD-ROM lived: a local CD-ROM driver, at an NFS server or available through an FTP server. I chose the FTP server option and was subsequently invited to enter TCP/IP networking details for Jadzia and for the FTP server (Belana). YAST made an FTP connection to Belana and retrieved information about which packages where available for installation.
Now, if there is one flaw in Linux, it is that there are too many packages available for installation (arguably much less of a problem than too little, but still.....). The SuSE Linux 5.3 Evaluation CD contains only a subset of the full distribution, but it is still way to much for my little laptop. In addition, I have this built-in aversion against installing software that I do not need and will probably never use. So, my next task was the careful selection of the packages I wanted: the basic stuff, the C and C++ compilers, most networking stuff (including UUCP but exclusing INN), TeX (definitely), no games (sorry, no room for that) and the X Windows System. YAST provides a few standard sets of packages that you can choose and modify. During the package selection, YAST constantly reminds you of the amount of free space that remains after your selection has been installed.
Fortunately, you do not need to be too careful when selecting packages. YAST keeps track of the inter-package dependencies and you can always add and remove packages later. After the initial selection I chose "Start Installation", and the Big Copy began. For each package, YAST downloaded the it from the Linux CD (via FTP from Belana) and installed it on the local hard disk.
This Takes Time! It was already late, so I went to bed.
Our 4 year old daughter Merel rises well before first light and seems intent on letting her beloved parents share the beauty of the early morning. So at 6.45 AM the next morning (Sunday!) I got up, expecting to be able to quickly finish the installation. Isn't it funny how things never turn out the way you expect them to?
After the package installation, YAST only needs to put a Linux kernel in place, modify the hard disk boot records and configure the Linux Loader (LILO). The first sign of trouble was that YAST complained that it could not find any installable kernels. This is not good! Without a kernel, Linux has severe problems booting! I did not entirely understand this error message. Normally I ignore errors that I do not know how to handle, so why not continue as if nothing had happened? Next, the LILO configuration generated errors as well. Hmm, what next? Ever optimistic I decided to reboot from the freshly installed hard disk. LILO came up and, ....... refused to boot Linux. Well, that's a missing kernel for you!
OK. Had I forgotten to install a kernel package? I had changed the default package selections and removed a few that I thought I did not want or need. Better try a complete installation then. I rebooted from the install floppy, redid the entire installation but this time with a complete install of all packages. This took even longer (because more packages were selected), but did not solve the problem. Well, obviously a bug in the SuSE evaluation CD. Maybe the bug was related to using FTP for the installation? I rebooted Belana into Red Hat Linux, set it up as an NFS server and redid the entire Linux install for Jadzia, but now over NFS. It still did not work.
Time for some hacking!
So the installation procedure forgets to place a kernel in the root directory of the freshly installed system? Better place it there manually then. As you might be aware of, the Linux console driver which operates the PC screen and keyboard has built-in capabilities for multiple virtual consoles. When operating in text mode, one can switch between the consoles with ALT-F1, ALT-F2 and so forth. The installation procedure runs on VT0 (virtual terminal 0) and starts a few command shells on the other virtual terminals). These command shells can be used to perform UNIX commands while the installation runs! Pretty powerful he? FreeBSD does the same and I have spent many a dull moment waiting for the installation to finish by running some UNIX text game like "quiz" or "adventure" on one of the other virtual terminals. This time I needed this capability for somewhat more serious work: manually copying a kernel to my hard disk.
After some looking around I discovered that YAST makes the file system onto which Linux is being installed available as "/mnt". So basically the "/" root directory of the Linux installation corresponds to "/mnt" during the installation (this is because the installation procedure runs with its "/" mounted on a RAM disk containing essential installation utilities). I seemed to remember that in a running system, the Linux kernel is called "/vmlinuz", so all I needed to do is find a kernel and copy it to "/mnt/vmlinuz". However, where does one find a kernel these days? I studied the CD-ROM, the SuSE web site and some other places and then it dawned on me that I might be able to copy the kernel from the install floppy! I mounted the install floppy on "/mnt2" and perused its contents. Hmmm, no "/mnt2/vmlinuz" there. However, there was a file called "/mnt2/linux". Could this be a kernel?
Well, you never know unless you try, so I copied "/mnt2/linux" to "/mnt/vmlinuz", finished the installation (mainly LILO configuration) and rebooted. The system came up like a charm!
Yippeh! Guru 1, Bugs 0!