Getting Started with Linux
This document is not supported by Computing Services. Please do not contact the Help Center with questions on this document.
What is Linux?
Linux is a free UNIX-type operating system that was originally created by Linus Torvalds with the assistance of developers all over the world. Linux is developed under the GNU General Public License and the source code for Linux is freely available to everyone. Linux runs successfully on most computers, laptops, and platforms, including most PC based CPUs, Sun Sparc, Digital Alpha, and Macintosh.
There are several different "distributions" of Linux. Distribution refers to the compiled source code, usually bundled with a few extras or modifications. Some distributions are free and can be downloaded, while others are available at a low cost.
Installing and Configuring Andrew-Linux
If you choose to run Linux, we recommend that you use our Andrew-Linux distribution. The Andrew-Linux distribution along with some DOS utilities can be found in:
- /afs/andrew/data/db/download/linux
This section contains information about the installation requirements for Andrew-Linux, instructions for installing Andrew-Linux to your machine, and instructions for configuring an X server.
Note: These instructions assume that you are familiar with UNIX and the Andrew system.
Requirements
To install Andrew-Linux, your system should:
- offer at least 40 MB for / and 150 for /usr
- have some swap space
- be an Intel-based desktop PC, Andrew-Linux is currently not supported for the Macintosh, Sparc, Alpha, etc. or for laptop machines of any kind
- already be connected to the network
- have 32MB of memory
- have a PCI Ethernet card installed
Installing Andrew-Linux
We recommend that you install Andrew-Linux using the boot disk image found at /afs/andrew/data/db/download/linux.
Using the Andrew Boot Disk
To install Andrew-Linux using the Andrew boot disk, follow these instructions:
Note: Step 1 is optional, but it will make the installation easier.
- Setup a package file for your machine. To set up a package file:
- Create a text only file using the name of your machine as the filename. (For example, if your machine is named, unix.andrew.cmu.edu , name your file, unix.andrew.cmu.edu .)
- The default package file should contain the line:
%include /afs/andrew.cmu.edu/wsadmin/public/src/public.proto
- Save the file in /afs/andrew/wsadmin/workstations/depot/proto/local/i386_rh80
or in /afs/andrew/wsadmin/workstations/depot/proto/contributed/i386_rh80
Note: depot.pref.proto files may also be initialized this way.
- Follow these steps to create a boot disk.
- To create the boot disk from DOS or Windows, you'll need to obtain an aboot-6.1.img and dosutils/rawrite.exe from /afs/andrew/data/db/download/linux via AFS, and use:
RAWRITE -F aboot-6.1.img -D A -N
Note: If you don't have this utility on your machine, you'll find it in the dosutils directory.
- To create the boot disk from a linux machine, obtain the aboot-6.1.img file. Then type the following as root:
dd if=aboot-6.1.img of=/dev/fdo
- Make sure you have some available disk space (at least 40 MB for / and 150 for /usr). You may also want some swap space. Three times the size of your RAM is recommended, but not necessary.
Note: If you don't have the space, you can use FIPS (in the dosutils directory) to resize an existing DOS (but not NT or 2000) partition. Linux needs one "Primary" partition for / in order to boot.
All other partitions may be "logical drives" in an extended partition.
- Boot the installation floppy.
Note: Unless you have relatively old hardware, you shouldn't need to specify any kernel command line options. The default "us" keymap (in the third dialog box) is fine. If you want to swap control and caps lock, use emacs2.
- If your network card is registered, verify your network information. If your card is not registered, configure networking. When using the Andrew boot disk, bootp is automatically attempted. To register your network card with datacomm, use the On-Line registration web page at http://netreg.net.cmu.edu/.
If bootp succeeds, you will be asked to verify the IP address that bootp returned. In general, you should select Yes. However, if the address doesn't match what you think it should be, say no , correct it, and contact the Help Center via e-mail at Advisor or via phone at 268-HELP. The next screen will display your hostname. You may want to verify it as well. Don't worry about downcasing it, that will be handled later.
If bootp didn't succeed, specify your IP address. For 128.2 addresses, the default gateway and nameserver will be specified automatically.
Note: If you are on campus, the IP address MUST be in 128.2.
- If your machine has a SCSI card, setup the SCSI adapters. If not, you may skip this step. To setup the SCSI adapters, select yes and identify the card.
Note: Zip drives are listed as Iomega PPA. For more information about Zip drives and ports see Ports and Devices, Disks, Partitions, and Drives.
- Partition the disks and assign mountpoints.
There are two different mechanisms provided for disk partitioning. The built in "simple" method is relatively easy to use, but is unable to allocate NT partitions and gives you no control over how the partitions are laid out on the disk. The older method is harder to use and more error prone, but it works better with unusual disk layouts. You can use whichever method you are more comfortable with.
Note: For more information about disk partitioning see Ports and Devices, Disks, Partitions, and Drives.
- Activate your swap space.
If you allocated any swap partitions, you will be asked if the defined swap partition should be formatted. Select yes . The swap partitions are formatted and activated.
Note: Swap isn't absolutely necessary if you have more than 32MB of memory.
- Select the partitions to be formatted.
Everything should be formatted during an initial install. Upgrades from other Linux systems to Andrew are not supported. The directories that should always be formatted are:
/
/usr
/usr/vice/cache
Note: The initial install will take a while to run.
- Configure LILO.
LILO should be installed in the MBR or on a floppy. This floppy should be used to boot Linux from then on, and should not be removed from the floppy drive until a login prompt appears. You should only install lilo in the root partition if you are using a boot manager that is capable of easily switching between OS's (os/2 boot manager, GRUB, etc). Computing Services supports only LILO.
- Reboot your machine.
- Set a local root password. To set the local root password:
- At the login: prompt, press Alt-F2 to change to the second virtual consol and then login at the new prompt with your Andrew ID and password.
Note: If you try to login at the first prompt, Andrew Linux will try to start X. However, because X has not yet been set up, you will get an error. The second virtual console will not try to start X when you login.
- At the prompt, type:
/usr/local/etc/rootpass > /tmp/passwd.change
This program prompts you for a new password. Choose something that is easy to remember but is difficult to guess.
- Logout and reboot your machine. When your machine gets to the LILO: prompt, you can proceed to the next step.
- Put your machine into single user mode. To do that, enter the following at the LILO: prompt:
linux init=/bin/sh
A # prompt will appear.
- At the # prompt, type:
/sbin/fsck
then press Return.
- When the prompt returns, type:
mount -n -o remount /
This will put you into single user mode.
- Copy the new root password to /etc by typing:
cp /tmp/passwd.change /etc/passwd.change
- Add the following lines to the /etc/package.proto file:
%define haspasswd.change
F /etc/passwd.change
With these lines, your machine will use the local root password rather than the global Andrew root password, which is not given out.
- At the prompt, type:
/bin/sync
- Reboot your machine.
You will now be able to login as root.
- Specify the package and depot configuration.
Assuming you completed step 1, this is relatively easy. Otherwise the default package.proto file should be used. The default package.proto is /etc/package.proto and should contain the same information as defined in step 1. If you have depot questions, send an email.
You should now have a working Andrew-Linux workstation. The only thing that won't work at this point is the X server. To set up an X server, see Configuring an X server.
Configuring an X server
Once you have installed Andrew-Linux, using either the Andrew boot disk or the RedHat boot disk, you will have a running Andrew-Linux workstation. However, you will not have an X server. You need to configure that separately. Use the following instructions to configure the X server.
- Log in as root.
- Type xf86cfg and wait for X to start.
Note: On a slower machine, this may take a minute or two.
- Two windows will appear.
- An xf86cfg window with pictures of the monitor, video card, PC, keyboard and perhaps a few other components.
- An accessX window with a list of keyboard shortcuts to use if your mouse doesn’t yet work.
- If your mouse doesn’t work:
- Use the keyboard shortcut keys listed in the accessX window to move the mouse pointer to the picture of the mouse in the xf86cfg window.
- Use the button 3 shortcut key to click on the picture, then choose configure.
- Select your mouse from the list with the button 1 shortcut key, then select OK with the button 1 shortcut key.
- If you’re using an old video card or monitor (older than 1998) that doesn’t use DDC to automatically report its refresh rate:
- Find your monitor’s refresh rate by looking in the manual, on the back of the monitor, or at the manufacturer’s web site.
- Move the mouse pointer to the picture of the monitor in the xf86cfg window.
- Use button 3 (usually the rightmost mouse button) to click on the picture, then select Configure.
- Select your monitor’s refresh rate (or the closest refresh rate that is EQUAL TO or LESS than your actual refresh rate) from the list with mouse button 1 (usually the leftmost mouse button) or enter the minimum and maximum vertical and horizontal refresh rate manually, then select OK with button 1.
- Using button 1 (left) select Configure Layout at the top of the xf86cfg window.
- A drop-down menu will appear. Select Configure Screen from this menu.
- Click on the picture of your monitor with button 3 (right) and select Configure from the drop-down menu.
- Select your color depth at the top of the screen. The color depth is specified in bits, therefore, the number of colors will be 2 to this power (e.g., 8 bits 2^8, or 256 colors). If you’re uncertain, select 8 or 16.
- Possible resolutions are listed in the window at the center left. Selected resolutions are listed in the window at the center right.
When X is started, the topmost selected resolution is used by default.
- To select a resolution, click on it with button 1 (left) on the left hand side of the window. Then click on the arrow that points to the right.
- To move a resolution up or down, click on it with button 1 (left) to highlight it, then click on the up or down arrows to move the resolution up or down in the selected resolution list.
- After you’ve selected a color depth and resolution, click OK on the bottom right corner of the window to return to the main xf86cfg window.
- Click Quit on the bottom right corner of the xf86cfg window.
- A box displays the message: “xf86Config Write configuration to”. Click No.
- The program will exit.
- Type startx to start the X Window System.
Upgrade from Andrew Linux Version 6 to Version 8
If you are not running version 8 of Andrew Linux, we encourage you to upgrade at this time. Computing Services has discontinued development for Andrew Linux version 6. A few problems with version 6, including minor security issues, also justify an upgrade.
How do I determine whether or not I'm already running version 8?
When you run the "sys" command, if you don't see i386_rh8, you're not running the latest version of Andrew Linux. Follow the instructions below to upgrade at this time.
Andrew Linux Version 6 to 8 Upgrade Instructions
- Back up any unique or critical data on the machine.
- Ensure that package and depot run without problems. Check
/var/log/package and /var/log/*.depot.log to ensure that there are no errors.
- Remove the /etc/NoDepotOnBoot file and any references to it in
/etc/package.proto (or files included from /etc/package.proto)
- Simplify your /etc/package.proto file (any files that it calls) as
much as possible. Remove any extra features that you don't need.
If possible, remove all %include lines except the last include for
the standard Andrew configuration
(%include /afs/andrew.cmu.edu/wsadmin/public/src/public.proto).
- Reboot your machine to re-package and re-depot it.
- Again, ensure that package and depot run without problems by checking
/var/log/package and /var/log/*.depot.log
- Add the line
%define convert8me
to the beginning of your /etc/package.proto file.
- Reboot twice. At least one of the reboots will take a while.
- After the upgrade, ensure that you're running the new version by typing
sys at the prompt. You should see i386_rh80.
- If you removed a custom root password, you can "break in" to the machine
in single-user mode by following the instructions in step 12 of Installing Andrew Linux.
- If you removed any features or included files from your /etc/package.proto
file, you can add them again now. This is a good time to evaluate whether
you really need those features.
Ports and Devices, Disks, Partitions, and Drives
In Linux (and most flavors of unix), everything looks like a file, even things like keyboards and disks. To help you set up Linux, this sections contains some helpful information about ports and devices, disks, partitions, and drives. The information included here is not complete. It is simply an overview of the basic information needed to configure Andrew-Linux.
Ports and Devices
Some of the more important devices:
/dev/psaux The PS/2 port. If you have a newer machine that uses a PS/2 mouse (it will have a small, round connector on the end), this will be the name of your mouse device when you set up X.
/dev/cua0 The first serial port (usually IRQ 4, Address 0x3f8). Known as COM1 in DOS and Windows. Note: Sometimes this port is called /dev/ttyS0
/dev/cua1 The second serial port (usually IRQ 3, Address 0x2f8). Known as COM2 in DOS and Windows. Note: Sometimes this port is called /dev/ttyS1
/dev/lp0 The first parallel (printer) port. (usually address 0x3bc). Known as LPT1 in DOS and Windows.
/dev/audio A sound card output that's mostly compatible with Sun's /dev/audio device. It uses 8 m encoding. Better sound output is possible, but it is not a simple subject. See the Sound-HOWTO at http://metalab.unc.edu/pub/Linux/docs/HOWTO/Sound-HOWTO for more details.
Disks
Here are the disk names:
/dev/hda The primary IDE disk on the primary controller
/dev/hdb The secondary IDE disk on the primary controller
/dev/hdc The primary IDE disk on the secondary controller
/dev/hdd The secondary IDE disk on the secondary controller
Note: Usually, the disk where you'll be installing Linux will be
/dev/hda and your CD-ROM drive will be /dev/hdc.
/dev/sda The lowest numbered SCSI device
/dev/sdb The second-lowest numbered SCSI device
/dev/sdc ..etc.
Note: This naming scheme can cause problems if you are using SCSI IDs 3 and 4, and you add a new device with SCSI ID 1 or 2.
Partitions
Linux uses Microsoft-compatible partitioning by default. This partitioning method allows for only four primary partitions. You can get around this limit by declaring one of your partitions an extended partition, then placing logical ("fake") partitions inside of the extended one. Both DOS/Windows and Linux recognize logical partitions, but FDISK (the DOS disk partitioning tool) does not know how to do anything with Linux logical partitions, including deleting them. If you create Linux partitions, you MUST delete them with a Linux utility. It is conventional to only have one primary partition, with the extended partition taking the remainder of the disk, although you can have multiple primary partitions.
Linux accesses the partitions by using the disk name followed by the partition number. For example, the first partition on the first IDE disk would be /dev/hda1. It's convention to use 4 as the number for the extended partition. Logical partitions inside of the extended partition are numbered beginning with 5.
Often, a Linux machine will boot to /dev/hda5 (first logical partition on the first IDE disk), and will use /dev/hda6 as swap space.
Zip Drives
Zip drives for the PC come in four flavors:
- Internal IDE Zip drives. These drives work just like any other IDE device.
- SCSI Zip drives that plug into a SCSI card. These drives work like any other removable SCSI device. Mac Zip drives are SCSI drives, and if you have a SCSI card and the appropriate cable, these drives will work with Linux without problems.
- External parallel Zip drives. Probably the most common type, these drives connect to the parallel port on the back of the machine, or if you have a parallel printer, it plugs into the Zip drive. Linux can use these drives, but not at the same time as the printer. If you don't have a printer, you can select "Iomega PPA" as your SCSI device when you install Andrew-Linux. If you have a printer, installation is more difficult.
- The Zip plus. Introduced by Iomega, these drives can be used as either a SCSI drive or a parallel drive. This device requires a special driver that is not part of the standard Andrew-Linux distribution. If you wish to use it, see the above HOWTO for hints.
Other Linux Resources
For additional help using Linux, see, the following web pages:
Or, read the following bboards:
- cmu.comp.os.linux
- cmu.cs.linux
- cmu.cs.linux.forum
- netnews.comp.linux
- netnews.comp.os.linux
- netnews.comp.os.linux.help