|
How to build a Linux system
What we have here is a discussion about how to build a Linux system using
Debian Linux for use here at the AHPCC (although the instructions
could easily be modified for any site).
This document was take from notes I made while installing various Debian
Linux systems here at the AHPCC. Any updates or suggestions welcome. For
generic instructions on setting up a Debian Linux system, see the Debian Linux Installation &
Getting Started guide.
For instructions on how to use our spiffy CD-R writer under Linux, see
How to cut a CD at the
AHPCC.
Here is a list
of packages included in a standard AHPCC setup.
This is a step by step process. Follow these instructions and I guarantee
you that you might come up with something that resembles what I came up
with. So there.
Contents
Part 0: Getting it all together.
First of all, you will need the installation diskettes or an installation
CD. They are available from Ken Summers or you can download the images.
Following is an excerpt from the Debian Linux Installation &
Getting Started guide:
Preparing the floppies:
Next step is to prepare the floppies for the installation by copying
the images into disks. Hence those files are disk images, they should
be copied block-by-block. In Dos you can use the RAWRITE utility for
that purpose located at ftp://ftp.debian.org/pub/debian/tools/rawrite2.exe.
Here is a brief explanation on how to use it:
C:\> RAWRITE2 <file> <drive>
By executing the RAWRITE2 command as stated above, you will accomplish
the following, the file "<file>" will be copied block-by-block
into the drive "<drive>".
On any Unix like operation systems you can use dd(1):
# dd if=file of=/dev/fd0 bs=10k
META: In some Unix systems the first floppy device maybe named differently.
When you finish rawriting don't forget to mark the floppies else you
will get confused later.
Next up is the system information you need to know before you get started.
I would strongly urge you to know this information before you start.
Those who have installed Linux before will know what I mean. If you haven't,
let's just say that guessing at some of this stuff can cause you no end
of grief and convert a RipSnorter 2000 super PC into a large boat anchor
in approximately one hour. Less if you try hard. So, with that said...
To set up X11 you need to know several things:
- The type of mouse (Mousman, MS bus mouse, etc.).
- The manufacturer, type, model number, and anything else you can
find out about the video card.
- How much memory is on the video card.
- The vertical and horizontal refresh rates, as well as resolution
your monitor is capable of. This is extremely important as damage
could result from bad values. Unfortunately this is typically very
hard information to get, unless you have the manual in hand.
Part 1: Installing the basic system.
- Boot and prep the system
- Insert the Rescue floppy and boot the machine, or boot the machine
with the CD in the CD-ROM drive.
- At the "boot:" prompt press Enter.
- Press "C" to select color display (presuming you have a
color display) then press Enter twice.
- Select "Next" (press Enter) to configure the keyboard.
NOTE that this is the default and will not be mentioned in the future.
- Select "US" as the keyboard type
- Initialize and Activate the Swap Disk Partition.
- If you want to repartition the disk, now is the time to do it.
- A discussion of repartitioning the hard drive(s) is far beyond
the scope of this document, but a couple of gotachas should
be noted:
- There is a hardware restriction which requires all bootable
disks to start in the first 1024 cylinders of the disk.
This means you must begin the Linux root partition and any
DOS or Windows partitions in the first 1024 cylinders.
- For large disks (> 1Gb) you may have to make a root
partition (generally quite small: 50-100 Mb or so) and a
/usr partition (the rest of the available space). The Debian
install understands this. Just be sure to initialize and
mount both partitions in the next step, Initialize
a Linux Disk Partition.
- I used /dev/hda2 as my swap partition. It should select
the correct one by default.
- Say "yes," you want to check for bad blocks. This doesn't take
too long.
- Yes, you are sure.
- Initialize a Linux Disk Partition
- Select a disk partition(normally /dev/hda1).
- Perform bad-block scan.
- Yes, you are sure. This will take quite a while on a large disk
(about 15-20 minutes/Gb).
- When it is done with the bad-block scan: Yes, mount the root filesystem.
- If you partitioned your disk with more than one Linux partition,
repeat this step for each of the other Linux partitions.
- Install the base system
- You will probably use /dev/fd0 or the CD drive (usually /dev/hdb
or /dev/hdc).
- If you are using the diskettes, use the "Base X" disks, inserting
as prompted.
- Install the OS Kernel
- You will probably use /dev/fd0 (or whatever you used
above).
- If you are using the diskettes, put the rescue floppy in the drive
when prompted.
- Install the device drivers
- Once again, whatever you used above. If you are using the CD it
may not prompt you for this but go ahead and use the cd anyway.
- Use the device driver diskette.
- Configure the device driver modules (These
instructions assume a deming class machine)
- Assume for all of these options that you will select install with
no command line options, unless specified otherwise.
- Select block.
- Select loop for the loopback device (a handy thing
to have around)
- Select cdrom.
- Select cdrom for the standard CDROM utilities.
- Select fs.
- Select bin_fmt_aout for a.out program support.
- Select bin_fmt_java to be able to run Java executables
from the command line.
- Select nfs to install the Network File System.
- Select smbfs to support Windows 95 disk sharing.
- Select umsdos to support Unix file system features
on MS-DOS file systems.
- Select vfat to support Windows 95 long filenames on
an MS-DOS file system.
- Select Misc.
- Select ftape if you have a Colorado or similar "floppy
tape" drive (a floppy tape is a drive that uses the floppy disk
controller for the tape drive).
- Select lp to control line printer ports.
- Select serial for serial port support.
- Select net.
- Select 3c509 for Etherlink card (NOTE: be sure
you have a 3c509 Ethernet card installed. If you have some other
card, select it, otherwise don't select anything here!).
- Select ppp if you want this machine to be able to act
as either a PPP client or server.
- Configure the base system
- Timezone Setup:
- Select America/.
- No, we use local time.
- Configure the network
- Supply the system name (e.g., "deming").
- Yes, we are connected to the network.
- The domain name for the AHPCC is "arc.unm.edu".
- Yes, the correct name is deming.arc.unm.edu (with your
system name instead of deming).
- The IP address of deming is "198.59.173.77". You need to
use the IP address assigned to the machine you are using. DON'T
GUESS ON THIS!
- The network address is "255.255.255.0".
- The network IP address is "198.59.173.0".
- The IP broadcast address is "198.59.173.255".
- Yes, we have a gateway: its address is "198.59.173.1" (cisco).
- Another system will be the DNS server. There are two:
- "198.59.173.3" (taos) and
- "198.59.173.6" (acoma).
- Verify that all of the information is correct.
- Answer "yes."
- Make Linux bootable directly from the hard drive
- Yes, install a master boot record on /dev/??? (typically
/dev/hda1).
- Yes, boot the Debian system as default.
- Make a boot floppy
- Put a blank floppy in /dev/fd0.
- Wait... approximately 2 minutes.
- Reboot the system
- Remove the floppy!
- Yes, reboot.
- Set the root password
- After reboot the system will ask you for a root password. Since
you will be installing the mail system you will have to pick a password
of unusual grace and futility (for hackers). I suggest you log in
to deming and run the command "pwgen 8" which will generate
an easy-to-remember password. Write it down and give it to John
Barnes.
- Create a user
- This part is a royal pain, since we will be using NIS and
AMD for user accounts, but there doesn't seem to be any way
around it. Create a username not actually in use by anybody (random
letters would probably work). You needn't enter any finger information
for them. And don't pick an easy password. This fake user could
be used to crack your system!
Part 2: Selecting and installing
packages.
- Running dselect
- Select Access. If you are on a fast network (ethernet)
you are probably best off using the ftp access method, as this information
is up to date. If, on the other hand, you are installing on a remote
or disconnected machine, you better access the CD. We will describe
only the ftp method here.
- Select ftp.
- The mirror site closest to us is "deming".
- Yes, you want passive mode.
- The username to use is "anonymous" (the default).
- The password to use is "root@xxx.arc.unm.edu" (the default).
- The Debian directory is "/pub/mirrors/debian"
- The distributions you want are stable, non-free, and contrib
(the default).
- The download directory is "debian" (the default).
- Select Update.
- Yes, clear the available list. The machine will go to the
ftp site you specified and download the latest list of available
packages.
- Select Select.
- The first thing you will see is a help screen. Press the space
bar to continue. dselect allows you to select which packages
you want installed on your machine. To that end it automatically
detects when dependencies and conflicts arise. To select a package,
scroll to the package and press "+". To deselect, press "-".
When the program detects a conflict or dependency it will bring
you to a conflict/dependency resolution screen. To exit that
screen press Enter. To exit the Select screen altogether press
enter. In order to search for a package (a very handy thing
to do in the next couple of steps) type "/" followed by the
search string. If you want more information RTfM
(or man dselect).
- Accept all defaults.
- Add the software listed here.
- Select Install.
- No, you don't want to select the files to get (get them all).
- Yes, you want to download the files.
- Wait... This takes from 45 minuets to about 2 hours when connected
to the Ethernet.
- Yes, install fetched files.
- You may get errors unpacking various packages. Sometimes
this can be fixed by merely running Install again. Other
times you must disable that package in Select, finish the
install, then re-enable it later.
- Configure smail for "Satellite system."
- Take the default visible mail name (e.g., deming.arc.unm.edu).
- Send all locally generated mail to "mail.arc.unm.edu".
- Yes, that's OK.
- No, don't send a test message. It gets clogged up in the
works. If you want to try it out, send a message to yourself
after the installation is finished.
From this point on I have documented various components that
asked for input when I configured several Linux systems. You may
not see all of these, or you may see additional questions. You
certainly won't see them in this order because they are alphabetical!
Some modules, like base-passwd try to reinstall critical files
like /etc/passwd. Unless you find an entry below telling
you to let it replace a specific file, it would be safest to forbid
all requests to change anything (the default). Also, at various
times you will be asked to decide a priority conflict for mime
types (usually between xv and xanim). This is a matter of personal
taste, since both will do the job. My preference is to let xv
deal with the picture formats (gif, jpeg, etc.) and let the other
programs deal with things they are more suited for (e.g., xanim
is a movie/audio viewer first, picture viewer second).
- amd:
- Yes, configure the automounter.
- amd messages should go to syslog.
- No, your site does not propagate amd maps through NIS.
- No, don't emulate Sun's hostmap.
- Yes, access home directories with automounter.
- No, do not add map entries for the RWHO spool.
- gpm: No, do not change anything.
- inewsinn:
- Yes, configure inews.
- Return mail name is "arc.unm.edu".
- Organization is "Albuquerque Resource Center".
- News server is "news.arc.unm.edu".
- Yes, these settings are correct.
- ispell: Use the American dictionary.
- lynx: Accept the default URL.
- Minicom: No, do not put usage of META key in config file.
- Netscape: Ignore error messages (we will take care of it later).
- nis: NIS domain is... a secret. Ask Ken Summers for the
NIS domain name. And Yes, add plus-entries
- Pine: mail name is "arc.unm.edu".
- tgif: Paper size is "Letter", Grid system is "English".
- wenglish: Yes, use English for the standard dictionary.
- xanim:
- Various messages. See note in the Install section.
- xbase: "N" keep your currently-installed version.
- xdm:
- Yes, allow replacement of /etc/init.d/xdm.
- Yes, start xdm at boot time.
- No, do not start xdm now.
- XFree86:
- Yes, create the XFree86 config file.
- The mouse (at least on deming) is a MouseMan type.
- No, do not enable ChordMiddle (this will cause very
strange behavior with the middle mouse button).
- No, do not Emulate3Buttons.
- Mouse device is /dev/ttyS0 (case is important).
- Yes, you want to use XKB.
- Use the Standard 101-key US encoding
- Select a horizontal sync range of 31.5-64.3. NOTE:
VERY IMPORTANT! you can literally smoke your monitor if this is set
wrong. Do NOT trust me on this. Find out what your
monitor can do. Accept no substitutes. This setting works
for a Mitsubishi Diamond Pro 17, a CMS1561 Multiscan, and
a Midwest Micro Low Radiation MPR II.
- Select a vertical sync range of 50-90. Same caution applies.
- Enter the default id/description strings (three of them)
(you can leave them blank if you wish).
- Yes, look at the video card database.
- The deming class machines use the "S3 86C764 (generic)"
entry. You need to find out what kind of video card you
have and select the appropriate one.
- Chose server option 5, choose server from card definition.
- The deming class machines have 2048KB of video memory.
- Enter the default id/description strings (three of them).
- Enter 'q' to not select a RAMDAC.
- Just press Enter to forgo a Clockchip setting.
- No, do not run "X-probeonly" now (this is based on the
fact that the S3 86C764 card recommends you not run this
probe. YMMV).
- At this point you may want to reorder the video modes
so that the screen comes up in the highest possible resolution
for each color style. If not, choose 5.
- Yes, write /etc/X11/XF86Config.
- Yes, run X using xdm.
- Yes, test it all out. If it doesn't work, get help.
- xserver-S3: Yes, make S3 the default.
- xv:
- Various messages. See note in the Install section.
When everything else is done:
- Yes, delete the installed package files (unless you feel you
still need them for some reason. If the install completed normally
there will be no reason to keep it, and if it didn't it won't
delete the ones that failed anyway).
- No, do not delete the debian directory.
- Run Install again to fix anything that didn't install due
to sequencing problems ("I won't install because I require Y and
Y isn't installed" types of things, where Y is installed later in
the process).
- Yes, you want to install files fetched (even though it didn't
fetch any).
- Yes, delete the installed package files.
- No, do not delete the debian directory.
- Select Config.
- This is much the same as the install. See the Install section
for details on specific packages.
- Select Quit.
Part 3: NFS.
NFS mount:
You must create the /nfs mount point. Add the following line
to the end of/etc/fstab:
laguna:/nfs /nfs nfs soft,intr,rw
Now create the /nfs directory locally:
From now on /nfs will mount when you boot, but to continue now
you must mount it manually:
Part 4: Various cleanup: Installing
Netscape, AMD, etc.
This section can be done either manually or it can be (mostly) automated
by typing (as root, again)
cd /nfs/setup
make -f Makefile basic
After the make finishes (it didn't have any errors, did it?) you will
have to do the Config part of the Netscape setup (below) and the Windows
or DOS setup by hand.
If you want to do this stuff manually, here's the procedure.
Shells:
Log in as root (if you are continuing from Part 2, you probably already
are). Enter the commands
ln -s /usr/bin/ksh /bin/ksh
mkdir /usr/local/bin
ln -s /usr/bin/tcsh /usr/local/bin/tcsh
to allow folks to boot using the korn shell and Tcsh.
Mail:
To configure Linux to receive AHPCC system mail you need to create a
new entry in the mount table. Edit /etc/fstab and add this line
at the bottom of the file:
laguna:/var/mail /var/spool/mail nfs soft,intr,rw
AMD:
Change directories to /etc/amd. FTP to laguna (you can
log in using your personal account). In FTP type these commands:
cd ~debian/misc
get amd_map_arc.mak
bye
You must create a cron job to update the table hourly to do this type
(as root)
It will put you into the vi editor (you do know the vi editor, don't
you?). Enter the following line and save the file:
This will copy the new user list every hour at 56 minutes past.
You must perform the same operation the cron will later, so type
cd /etc/amd
make -f amd_map_arc.mak
This should create the file /etc/amd/amd_map_arc which allows
the automount daemon to find your home directory.
Finally, edit /etc/amd/amd.master and replace the only line
there with:
This will prepare amd to use the system here at the AHPCC.
X:
In order to get xdm and XF86 to recognize the configuration files used
here at the AHPCC, some modifications must be made. Check the file /etc/X11/config
and make sure the following lines exist:
allow-user-xsession
allow-user-resources
allow-user-modmap
In the file /etc/X11/Xsession change the line that reads
to
In the file /etc/X11/XF86Config uncomment all lines beginning
with the word FontPath. There should be at about seven lines.
Remove any # from in front of each line to uncomment it.
Cool logo:
To get the cool AHPCC logo for the login screen: As root change
directory to /etc/X11/xdm; FTP to laguna, go to the directory
~debian/misc, and get the file ahpcc_corner.gif. Then
edit the file /etc/X11/xdm/Xsetup and add the following line
just before the line with exit 0 (or the last line, if there
is no exit):
In order to get the logo on your screen, as well as everybody elses,
you must add the same line to the file /etc/X11/xdm/Xsetup_0.
MWM:
In order for the default login script to work (.xsession) there must
be a mwm window manager. Linux doesn't come with such a thing so do the
following:
cd /usr/bin/X11
ln -s fvwm mwm
This will use fvwm instead of mwm. fvwm is a mwm lookalike that takes
a lot less memory.
Printers:
Change to the /etc directory. FTP to laguna and get the file ~debian/misc/printcap.
This will allow you to remote print to the various network printers.
Name resolution:
Finally, to fix domain name resolution, your /etc/resolv.conf
should look like this:
Netscape:
Change directories to /tmp. Enter the following command:
(Don't forget the trailing "."). This will download the public domain
version of Netscape 3.01 gold. Now run dselect again and select Configure.
Netscape will be unpacked and installed. Remove the downloaded file when
you have finished installing Netscape.
Windows or DOS:
If you want to be able to dual boot your machine using an existing DOS or
Windows partition you need to edit /etc/lilo.conf. Following
is the lilo configuration file used on artesia (Windows 95/Debian Linux
dual boot):
boot=/dev/hda3
root=/dev/hda3
compact
install=/boot/boot.b
map=/boot/map
vga=normal
delay=20
image=/vmlinuz
label=Linux
read-only
other = /dev/hda1
label = win95
table = /dev/hda
The information before the line other = /dev/hda1 was created
by the Debian install (if you are installing a later version, this section
may be slightly different). You do not have to (and in fact should NOT)
modify this section. The information on that and the following lines was
added to allow the machine to boot Windows 95 from partition/dev/hda1.
If you don't know what drive your other operating system lives on, use
the cfdisk command to see what partitions have been formatted
with what operating systems. When the other operating system is installed
you will have to run the command "lilo" to install the proper
boot record.
To boot the alternate OS, hold down the shift key while the machine is
booting. Lilo will prompt you with boot:, at which time you type
in the label for the OS you want followed by Enter.
Reboot (type "shutdown -r now" at the prompt).
Congratulations! You have a Linux system!
Return to the Albuquerque High Performance
Computing Center
Copyright 1998-2000, High Performance Computing Education
and Research Center
|