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.
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.
[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.
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:
Device
|
Mount point
|
/dev/hda5
|
/boot
|
/dev/hda7
|
/
|
/dev/hda8
|
/home
|
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
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:
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 > somefilename.pub
Key somefilename.pub
Note: Most installations using SSH2 will need to use the dsa key, not the rsa key.
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:
#!/bin/sh
ssh-agent gnome-sessionPrinters:
Printers can be set up using the "Printer Configuration" tool in the GNOME environment. Printers should be set up as remote lpd printers.
In the Physics department at WFU, an for the settings would be:
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.
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.
openMotif: (openmotif-2.1.30)
I obtained the files
- openmotif-2.1.30-5_ICS.i386.rpm
- openmotif-devel-2.1.30-5_ICS.i386.rpm
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 -d:pserver:anonymous@cvs.mesa3d.sourceforge.net:/cvsroot/mesa3d login
cvs -z3 -d:pserver:anonymous@cvs.mesa3d.sourceforge.net:/cvsroot/mesa3d co mesa3d
cvs update -r mesa_3_4_2This creates a directory called Mesa in your current directory. I compiled the source as follows
setenv CFLAGS "-g -O2"
./bootstrap (only need the first time you check out the CVS repository)
./configure --prefix=/usr --enable-x86 --without-glide
make
su
umask 002
make installIf 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
make
cd man
vi Makefile
(change mandir = $(prefix)/man/man3 to mandir = $(prefix)/share/man/man3)
cd ..
su
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
- opendx-4.1.3-1.i386.rpm
- opendx-samples-4.1.3-1.noarch.rpm
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 libGLcore.so.1. You may also have a problem with libGL.so. 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 libGL.so (Note what this link points to, on my system it is libGL.so.1.2.030402.)
ln -s /usr/lib/libGL.so.1.2.030402 /usr/lib/libGLcore.so.1
ln -s /usr/lib/libGL.so.1.2.030402 /usr/lib/libGLcore.so
(Replace libGL.so.1.2.030402 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):
- /usr/share/texmf.local/tex/latex/
- /usr/share/texmf.local/bibtex/bib/
- /usr/share/texmf.local/bibtex/bst/
For compatibility with version 3, install revtex-3.1:
In each of the three directories mentioned above, create a subdirectory called revtex-3.1. Then unpack the revtex package and cd into the subdirectory it creates. Before installing the files, we need to create a patch file to fix a problem with LaTeX2e. Following the directions in the README file, create a file called revtex.cls that contains:
%%
%% This file allows REVTeX v3.1 to function correctly under
%% the 12/94 release of LaTeX 2e. Put this file wherever
%% revtex.sty is. Continue to use \documentstyle{revtex}
%% (with the correct options) and REVTeX will run normally
%% in compatibility mode. Thanks to David Carlisle for
%% pointing out this fix.
\ifx\every@math@size\undefined\else
\let\old@expast\@expast
\def\@expast#1{\old@expast{#1}\let\@tempa\reserved@a}
\fi
\input{revtex.sty}Now, run the following commands from the revtex 3.1 source directory:
- cp *.sty revtex.cls reftest.tex /usr/share/texmf.local/tex/latex/revtex-3.1
- cp *.bib /usr/share/texmf.local/bibtex/bib/revtex-3.1
- 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:
- cp *.sty *.cls *.rtx /usr/share/texmf.local/tex/latex/revtex-4
- 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):
- TEXMFLOCAL = /usr/share/texmf.local
- HOMETEXMF = $HOME/texmf
- TEXMF = {$HOMETEXMF,!!$TEXMFLOCAL,!!$TEXMFMAIN}
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.
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
#!/bin/sh
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.
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* |