Dave Cater

Linux Red Hat

 
Home Page
Career outline
Java
Linux
Linux references
Linux Mandrake
Linux Red Hat
Linux kernel upgrade
Linux Internet connection
Linux firewall
Linux projects
Security
Perl
System management
Testing
Musical notes
Armed with a CD containing Red Hat Linux 5.2, courtesy of the excellent PC Plus magazine (May 1999), I was ready to start planning my installation.

I realised that I had two choices when installing Linux alongside Windows - to re-partition the disk and re-install Windows and Linux in the new partitions, or to create partitions on the live Windows system. I decided to do the latter, since the thought of re-installing Windows 98 was not a pleasant one.

Again I faced two choices - the installation instructions in PC Plus described a disk partitioning tool being included as part of Linux. I had also learnt about a highly recommended product PartitionMagic from PowerQuest. I decided to use PartitionMagic, on the grounds that it was available in a Windows-friendly form. I was comfortable with the idea of creating disk partitions within Windows first, then attempting the Linux installation as a second stage.

PartitionMagic was also said to include a boot manager process called BootMagic, with a point-and-click interface for boot choices. My wife, who shares the system, prefered to be hidden from anything to do with Linux. It seemed better to install BootMagic, in preference to the Linux Lilo software, and configure it to make Windows the default.

With these decisions made and a rough plan of attack, I set forth to install PartitionMagic, BootMagic and finally Linux. The actual installations were all remarkably smooth, and are not described in detail.

X Window System

Having installed the system and logged in as root, one of my first jobs was to check out the configuration of the X Window System. I typed startx and was pleased to see the familiar diagonal cross mid-screen, followed by the Linux desktop (which I gather is called Gnome in Red Hat Linux). There was a start menu, Control Panel and a single terminal window. I could use the start menu to create new terminal windows. The only problem I encountered at this early stage was - the screen seemed to be shifted off the right edge of my monitor.

During installation, I had selected the option "HF SVGA 1024x768@70Hz". For no very good reason, other than a suspicion that I might be pushing the limits of my monitor, I decided to try another option - "Non-interlaced SVGA 1024x768@60Hz". Re-running startx was now much more successful - I saw the clock and various menus bottom right of my monitor. Aware of the complexities of the X Window System (I managed Unisoft's project to produce an X11R5 test suite for MIT between 1990-1992) I decided not to "probe" further (ha ha).

Printer configuration

During installation, I pretended my HP Deskjet 895Cxi printer was a generic HP Deskjet. I now attempted to print a simple text file using the lpr command. The file emerged, but the printer settings had failed to map the linefeed characters to linefeed-carriage return on output. As a result, it had the "stair-stepping" effect mentioned as an option in the printer installation notes. Using the printer configuration tool accessed from the Control Panel, and setting the appropriate option, the problem was quickly solved. During the course of this experiment, I changed the printer type to HP Deskjet 550 - which so far seems to have made absolutely no difference to anything.

Many years ago, I was involved in the development of a printer control package at ROOT Computers (later Unisoft). I remember the standard UNIX printcap(5) database included an attribute which could be used to specify that printers did not map linefeed on output (and so the printer software emulated this). I assumed that if I looked in the file /etc/printcap that I would see an attribute (named CR or something). I looked but did not see anything of the sort. The only change made by the configuration tool seemed to be to change the {} characters to 1. Most odd. Obviously the warnings about only editing the file if you know what you are doing are very apt.

Mounting Windows file systems

I was interested to know whether I could mount the Windows file system on device /dev/hda1 from within Linux. I had been told this was possible, but given no specific instructions.

I decided to start in a small way and mount Windows read-only. I created a new empty directory to act as the mount point:

mkdir /windows

My first attempt

mount -r /dev/hda1 /windows

succeeded immediately. I could change to the /windows directory and lo and behold, DOS files appeared before my very eyes.

I then became somewhat more confident and tried to mount the device read-writeable. The command

mount /dev/hda1 /windows

also had the desired effect. Now I am no longer obliged to use Frontpage Express or notepad if I don't want to. I am editing this file using vi though it resides in C:. Neat.

I decided to make the Windows file system mount automatically on reboot. I toyed with the idea of putting an entry in /etc/mnttab, until I found that there is no such file on my version of Linux. I chanced on a note in the March 1999 issue of PC Plus, describing the file /etc/fstab. How could I have forgotton that, I wondered. From the manual page for fstab(5), I realised I should probably have been using the mount option "-t vfat" for Windows. I tried the command

mount -t vfat /dev/hda1 /windows

and found the file system mounted with subtle differences. Spaces in Windows file names were now apparent; before they had not been. This made for some fun trying to change into the directory "My Documents" ! Finally to ensure the desired mount on reboot, I added the line

/dev/hda1 /windows vfat defaults 0 0

into /etc/fstab, exactly as recommended by PC Plus, and everything worked fine.

I discovered that the vi editor within Red Hat Linux understands that Windows files with carriage returns on every line are reported as being in DOS format, and the carriage returns are preserved. In order to remove them from a file, you can use the vi command ":set fileformat unix". When the file is written, it is then written in UNIX format (i.e. without carriage returns). If a file has carriage returns on only some of the lines, the file is NOT reported as a DOS format file, and the carriage returns are explicitly displayed as ^M.

I also discovered that Windows file systems created on floppy devices can be mounted easily under Linux. For example, the following command mounted a floppy formatted under Windows and makes the Windows files appear in the directory /mnt/floppy:

mount -t vfat /dev/fd0 /mnt/floppy

Similarly the following command can be used to make the Red Hat Linux files from the original Windows CD appear in the directory /mnt/cdrom:

mount /dev/cdrom /mnt/cdrom

I could then change to the directory /mnt/cdrom/doc/rhmanual/manual and view the Red Hat installation guide from within Linux using the command:

netscape index.html

Some months later, I noticed many of these issues of Windows and Linux co-existence were covered in the July 2000 issue of PC Plus.

Linux Internet connection

In the months after I installed Red Hat Linux 5.2, further articles in PC Plus magazine discussed the stages involved in connecting a Linux system to the Internet.

In December 1998, the utility EzPPP was mentioned. This claimed to simplify the configuration of dial-up connections to just a few simple steps - such as specifying the phone number, user name and password used with an existing Internet connection. This sounded promising. Apparently EzPPP included the "chat" program which also mentioned in the May 1999 issue. The article mentioned different protocols for sending packets from my PC to the Internet (PPP, SLIP, and so on). Which one to use ? I rebooted Windows, and found amongst the Control panel settings evidence that PPP was used, so, I decided to try that first.

Establishing PPP connections

The next problem was finding EzPPP. It was not on the December 1998 Super CD as claimed. I found it on the January 1999 Super CD instead. Better late than never. Also, the GUI front end was not found - I found just a single source file eznet.c, together with a document which included installation and usage instructions.

I compiled the source file using gcc as specified and installed the eznet binary file in /usr/bin, making setuid root as required. I ran the command I hoped would configure my ISP (Global Internet):

eznet add service=global user=cater password=***** phone=08450807777

(Of course I'm not telling you my password, stupid!)

Then I bravely tried the command I hoped would dial in and create an Internet connection:

eznet up global

This failed with a usage error. Prompted by the documentation, I looked in the directory /var/eznet and found various log files. One of these included error messages from pppd (which eznet attempts to start). These refered to a problem with the first argument to pppd, the device file /dev/modem. I checked - and found this did not exist. I knew the COM1 port on Windows was used for the modem. So I created a symlink to /dev/ttyS0 (as mentioned in the June 2000 PC Plus). I then saw different error messages from pppd - claiming that kernel support for PPP was absent. This was serious - I had visions of compiling and installing new kernels.

Check the documentation

I consulted the document PPP-HOWTO in doc/HOWTO on the Red Hat distribution. I also came across the README files in the directory /usr/doc/ppp-2.3.5. In the end I was led to examine the syslog file for any evidence of kernel messages which refer to PPP. I first had to look in /etc/syslog.conf to work out that my syslog file is located in /var/log/messages. I was glad I looked. I found that the kernel had indeed dynamically loaded the PPP module when I ran eznet.

As a desperate last try, I removed the file /dev/modem and added an entry to the file /var/eznet/eznet.conf specifying tty as ttyS0. Running eznet again - to my amazement - started my modem dialling and created what looked like a connection!

In the course of this I looked more at the log files in /var/eznet, and ran the eznet log command. This seemed to just concatenate various of the log files. The log output includes a full transcript of the login conversation with the ISP, which would be useful in case of problems. There were also messages logged by pppd outlining the PPP connection set up.

Nameservers

I ran netscape in another terminal window and entered a URL. More error messages occurred. These were connected with something I had read about but chosen to ignore until now - DNS entries. I had not set up a nameserver. Not surprisingly, there was no way to resolve www.reuters.com into the actual IP address for my browser to connect to. In the Red Hat installation manual I discovered sections previously skipped over concerning setup of Network connections. Soon I came across the section on nameservers. Although the screens listed were for gnome-linuxconf (which I don't seem to have installed yet) the equivalent screens were easily found in the Control Panel (under Network Configuration->Names). I added the IP addresses of the two nameservers listed at the Global Internet site. I saved the results, and out of curiosity looked in the file /etc/resolv.conf, mentioned in several of the articles on PPP. To my delight, the file had been created, and the contents looked believable. I restarted netscape, entered www.reuters.com - and was immediately connected to the Internet. Soon I was checking my email account, bookmarking sites in Netscape, and so on. Connected at last.