Installing Red Hat Linux 7.1 on an IBM A21m Laptop

The following is an outline of the important steps in installing Red Hat Linux 7.1on an IBM A21m laptop computer as supplied to the faculty and students at Wake Forest University. Much of what you will find below will also apply to other version of Red Hat Linux as well as to other pre-packaged versions of Linux.

Partitioning your hard drive:

The hardest (and most dangerous) part of installing Linux on your Thinkpad is repartitioning your hard drive. There a many ways that you can repartition your drive. I have chosen to use PartitionMagic, which allows for in-place repartitioning. That is, you can repartition your drive without loosing the data that is currently on it. There are other method for performing the repartition, some of which are free and some of which will not save your data on your hard drive, so be very careful with your choice of repartitioning tool. FIPS is a commonly used, free tool that comes with some Linux distributions

With recent versions of Red Hat Linux (6.2 or later), it is no longer necessary to repartition your disk drive. But, installing Linux without repartitioning will result in a system with slower performance and is really only recommended for those wishing to see what Linux has to offer. So, creating dedicated Linux partitions is really the only way to go if you are interested in really using Linux. However, there are lots of ways to set up the partitions and there is really no best way to do it. I recommend that you do a good bit of research on this before you commit to a partitioning scheme since it is a pain if you have to go back and change it later.

I created two primary partitions on my hard drive. The first is the main DOS partition containing the C: drive. It is formatted as FAT32. The second is set to Extended type and sub-partitioned into several Linux partitions, three of type Linux ext2 and one of type Linux swap.

My partitioning scheme for a 6Gb internal disk
[OS] device name Partition type Size in Mb
[DOS] C: — [Linux] /dev/hda1 FAT32 10,978.2
Extended* 8,098.9
*Extended partition subpartitioned into several Logical partitions. [Linux] /dev/hda5 Linux ext2 22.1
[Linux] /dev/hda6 Linux swap 391.3
[Linux] /dev/hda7 Linux ext2 3,588.0
[Linux] /dev/hda8 Linux ext2 4,097.4

I tend to prefer separate partitions for /and /home. The / partition contains the operating system programs and configuration files needed to boot the system. The /boot partition contains versions of the Linux kernel that you can boot, as well as other files important to the boot process. Keeping the /boot partition separate is a bit of a holdover from older versions of Linux, but I think it is still a good idea. Again, you can combine this space with the / partition if you want. The /home partition contains your personal files. By keeping this in a separate file system, you can save yourself some headaches when it is time to upgrade your system since you can elect to reformat all of the partitions except /home if you decide you need to reformat the primary partitions for the operating system.

If you need a swap space for your installation (and you probably do), this must be a separate partition and it must be formatted as Linux swap.

Starting the installation

Boot from the RedHat 7.1 CD and choose the graphical installation. To boot from the CD drive on the IBM A21m, you need to insert the RedHat CD into the drive and shutdown your machine. When you restart it, press the F12 key to allow you to boot from an alternative drive, then choose the ATAPI CD-ROM drive.

After choosing the graphical installation method, you will soon be presented with a series of choices. I chose the default settings in most cases. I am going to attempt to outline all of the non-default choices I made:

  1. Install Options: I chose a Custom System.
  2. Disk Partitioning: I chose Manually partition with Disk Druid. If you do not use PartitionMagic to repartition your drive, you may have to use fdisk instead of Disk Druid if your linux /boot partition is beyond the 1024th disk cylinder.
  3. Partitions: Within Disk Druid, you must assign Mount points for all of the Linux partitions. Just select each partition and Edit it. You do not need to set a mount point for the swap space (hda6) and I did not set a mount point for the Win95 FAT32 partition as I will add this later. I made the following assignments:
    Mount point
  4. Choose partitions to format: I also chose to format /home since this was a new installation and not an upgrade.
  5. LILO Configuration: You need to decide where to install LILO. This is an important decission. Since I am using BootMagic, I installed LILO on the first sector of the boot partition. For more information, see the section below on Multiple OS booting and LILO.
  6. Account Configuration: You must enter a root password. It is also helpful to create a standard user account for yourself. Here at WFU, it is best to enter your WFU userid as the Account Name. This will make it easier to connect later to other WFU resources. Once you have entered your Account Name, Password, and Full Name, press the Add button.
    Note: when your account is created, it will have a userid number associated with it that is different from the one used on the WFU system. It may be worth your while to change this. You can get your WFU userid number by loggin onto and typing id. If you do want to change your userid number on your Linux laptop, you need to edit the file /etc/passwd. Find the line that starts with your Account name. You want to change the number in the 3rd field to match your WFU userid number. After editing the file, if you are using shadow passwords, you need to run the comand pwconv. You will also need to change the ownership of you home directory and any files in it after changing your userid number since they will be owned by the old number. You must do this as root.
  7. Selecting Package Groups: I chose to include most of the packages except the various sever packages and the Network Management Workstation package. Be sure you include the laptop package. I also checked the option to Select individual packages so that I could review the automated choices and add any packages that I wanted and were not installed already selected. The most important changes I made were:
  8. Unresolved Dependencies: If there were any unresolve dependencies, you should select Install packages to satisfy dependencies.
  9. Finally, during the X Configuration, on the Custom Configuration screen, I chose the Color Depth to be 32 Bit. I then reset the Screen Resolution to 1024x768 and tested the settings.

Post-Installation Configuration

You may want to visit the RedHat web site and download and install any relevant updates!


OpenSSH will create a directory called .ssh in your home directory that contains useful information. Make sure that only you can read the contents of this directory. You can create a filed called config in this directory with both global and host specific options for ssh to use. For example, you can have aliases to machines in this file and you can specify what user name to use with each host. My config contains lines like

Host wfusp2
User cookgb

# Global defaults
Host *
ForwardX11 yes

If you want to use public key authentication, then you should read the man pages for ssh, ssh-agent, and ssh-keygen. You can use the following commands to generate rsa and dsa keys:

ssh-keygen -t rsa
ssh-keygen -t dsa

These commands create both public and private keys. Make sure only you can read your private keys! You can transfer the public keys to other hosts and use them together with an ssh-agent to keep from having to type in your password. How this works depends on whether the remote host is running SSH2 or OpenSSH.

On an OpenSSH host, you add your public key the the authorized_keys2 file in the .ssh directory. (If you decide to use protocol 1, then you also need to create an rsa1 key and put it in a separate file called authorized_keys.

On an SSH2 machine, things are different. First, you need to create a SSH2 style public key from your dsa private key. You do that with the following command:

ssh-keygen -x -f id_dsa >

Copy this file to the .ssh2 directory of your remote host and edit/create the file authorization so that it contains a line for this key. For example, the line might look like:


Note: Most installations using SSH2 will need to use the dsa key, not the rsa key.

If you set up an ssh-agent, then you can use ssh-add to automatically use your private key. For example, to read in your dsa private key, you would use the following command:

ssh-add ~/.ssh/id_dsa

You can set up your ssh-agent to be running underneath your entire X11 session. In the GNOME environment, you need to edit the file .xsession in your home directory so that it contains the lines:

ssh-agent gnome-session



Additional Software:

There are several additional software packages that I have installed. Since I do Motif and OpenGL programming, I have install Lesstif and Mesa. I describe my installation of these and a few other software packages below.

Multiple OS booting and LILO

There are several tools that allow you to boot into either Windows or Linux (or any of a number of other operating systems). LILO (Linux Loader) is a simple tool that comes with Linux and should serve as to your needs. BootMagic came with my version of PartitionMagic, so I use it. It provides a configurable graphical interface for selecting which OS you want to use at boot time. If you use LILO as the primary tool for selecting which OS to boot, then you should install LILO in the master boot record (MBR). However, if you use another boot loader (such as BootMagic), then you must install LILO into the first sector of your linux /boot partition. If you install it in the MBR, you will overwrite any existing boot loader. If you later install another boot loader, you will overwrite LILO and you will have to figure out how to get it back onto your system.


Additional Software:

openMotif: (openmotif-2.1.30)

I obtained the files

from the online binary distributions at the MotifZone and installed them using rpm.

Mesa: (MesaLib-3.4.2)

Mesa is included with the RedHat 7.1 distribution, however, since it does not include the Motif and OpenGL widgets, I decided to compile the source myself.

I obtained the source code using CVS using the following commands:

cvs login
cvs -z3 co mesa3d
cvs update -r mesa_3_4_2

This creates a directory called Mesa in your current directory. I compiled the source as follows

    setenv CFLAGS "-g -O2"
    (only need the first time you check out the CVS repository)
    ./configure --prefix=/usr --enable-x86 --without-glide
    umask 002
    make install

If you also want the Motif and OpenGL widgets, then you need to cd into the widgets-mesa subdirectory and execute the following commands:

    setenv CFLAGS "-g -O2"
    ./configure --prefix=/usr --enable-x86 --with-motif
    cd man
    vi Makefile
    (change mandir = $(prefix)/man/man3 to mandir = $(prefix)/share/man/man3)
    cd ..
    umask 002
    make install

    (the following steps are optional)
    cd /usr/lib
    ln -s libMesaGLwM.a libGLw.a

OpenDX: (opendx-4.1.3)

I obtained the files

from the online binary distributions at the OpenDX web site and installed them using rpm. There will likely be one or two unresolved dependencies that rpm will complain about. One will be for You may also have a problem with The latter will occur if you do not use the Mesa rpm. However, if you have compiled and installed Mesa yourself, this is not a problem. To avoid problems with libGLcore, you simply need to link this file to libGL. You should do the following:

cd /usr/lib
ls -l (Note what this link points to, on my system it is
ln -s /usr/lib/ /usr/lib/
ln -s /usr/lib/ /usr/lib/

(Replace with what is appropriate for your machine.)

You can now use rpm (gnorpm) to install the two opendx rpms and ignore the dependency warnings.

RevTeX: (revtex.3.1.tar.gz,revtex4.tar.gz)

I like to keep new LaTeX packages in a separate location, so I created the following directories (the default packages are found in /usr/share/texmf):

      1. cp *.sty revtex.cls reftest.tex /usr/share/texmf.local/tex/latex/revtex-3.1
      2. cp *.bib /usr/share/texmf.local/bibtex/bib/revtex-3.1
      3. cp *.bst /usr/share/texmf.local/bibtex/bst/revtex-3.1

For compatibility with version 4, install revtex-4:

Create a subdirectory called revtex-4 in the /usr/share/texmf.local/tex/latex and in /usr/share/texmf.local/bibtex/bst. Then unpack the revtex package and cd into the subdirectory it creates.

Now, run the following commands from the revtex 3.1 source directory:

      1. cp *.sty *.cls *.rtx /usr/share/texmf.local/tex/latex/revtex-4
      2. cp *.bst /usr/share/texmf.local/bibtex/bst/revtex-4

You now need to edit the file /usr/share/texmf/web2c/texmf.cnf to change the default list of locations to search for packages. Locate the following variables and make sure they are set as shown (you don't have to set the HOMETEXMF variable):

Now, run texconfig. Run the CONF command fromt he main menu. The Kpathsea variable TEXMF should include the new texmf.local directroy. If it does, then run the REHASH command from the main menu to rebuild the ls-R database.

Writing CDs on the builtin CD-RW drive:

The buildin CD-RW drive on WFU A21m Thinkpads is supported in the RedHat7.1 Linux release. If you have installed the RPMs that contain mkiosfs and cdrecord, then you can write CDs. I created an executable script called dumpCD that contains

echo $*
IMG_SIZE=`mkisofs -R -q -print-size $* 2>&1 | sed -e "s/.* = //"`
echo Preparing to write ${IMG_SIZE} bytes to CD...
[ "0$IMG_SIZE" -ne 0 ] && mkisofs -R $* | \
cdrecord speed=4 dev=0,0,0 tsize=${IMG_SIZE}s -data -

This command takes a list of directories and files and writes them to the CD. The process involves two steps. First, mkisofs creates the filesystem that will be written to disk. Second, cdrecord actually writes the data to the disk. In the scriptdumpCD, mkisofs is first called to determine the size of the filesystem that will be created. This size is stored in IMG_SIZE. Second, mkisofs actually creates the filesystem and pipes it to cdrecord. The -R option causes mkisofs t create a "RockRidge" file system that is appropriate the Linux. An alternative is to use -r on second call to mkisofs to cause the userid and group numbers to be set to zero on the CD. This is appropriate for a CD that will be shared with others. The -R option is appropriate for creating private backups. The options for cdrecord should work for all WFU A21m Thinkpads. The only option that might need to be changed is dev. This tells cdrecord where the CD-RW drive is. You can use the command:

cdrecord -scanbus

to find the appropriate values for your machine. For more information on recording onto CDs, look at the man pages for mkisofs and cdrecord.

Files and directories to backup off of / prior to upgrade:

Linux File Systems

Device name Mount point Linux fs type Options
/dev/hda7 / ext2
/dev/hda5 /boot ext2
/dev/hda10 /home ext2
/dev/hda1 /DOS vfat rw,noexec,nosuid,nodev,conv=auto,uid=24310,gid=300*
* The uid and gid settings are set to my user and group settings and will be different on other systems.