Teaching System Administration with Linux

by R. Robert Adams

System administration is a vital necessity of any computer system. However, most universities don't teach system administration. So where do people learn how to become system administrators? Basically, they have to learn it on their own. The next logical question is: what enables someone to learn how to do system administration? Our answer: system administration requires a fundamental understanding of how operating systems (OS) and networks operate. However, unlike a traditional computer science operating system or networking course, which teaches low-level (i.e., programming) details, system administration requires only an understanding of theory and fundamentals. For example, you don't have to know about page table layouts to understand how to install and configure swap space.

Here at Grand Valley State University we've developed a course that teaches operating system and networking fundamentals while using system administration as an underlying theme. Our students are information systems majors who would otherwise never learn about the principles of OSes and networking. In the course we cover OS topics such as users, groups, file sharing and processes, along with networking topics such as application layer protocols, the transport layer and network device configuration.

The course has two components: traditional lecture where we teach the concepts and principles of OS and networking, and a lab where the students are able to apply the concepts learned in lecture to a “real-world” environment. Other papers of ours (see Resources) discuss the organization of the course. Our purpose here is to show how Linux is used to support the lab for the course.

The EOS Linux Lab

The Exploratory Operating System (EOS) lab consists of 24 Pentium IIIs with 128MB RAM, 10GB HD, a floppy and a Zip disk. Each machine is running Red Hat 6.2. The lab is a production environment—it serves as the primary account of most CS and IS majors as well as several faculty. Thus, the lab is not a pure research lab. Real people use the lab every day. Because our lab isn't a dedicated research lab, giving root access to a group of 24 students every semester is out of the question. However, the students require superuser access to perform even the most basic system administration duties.

Our solution is to take advantage of the 100MB Zip disk on each machine to provide a dedicated Linux distribution to each student. Each student creates a boot floppy and a root file system on a Zip disk. With this setup, the student can insert both disks and reboot the machine. The student then has a working Linux distribution all to themselves, and one they are able to administer for themselves. In this environment the student can perform the experiments for the lab that day. When they're finished, they simply shut down the machine, remove their floppy and Zip disks and reboot. The system then comes up in the normal EOS lab configuration.

Floppy Boot Disk Creation

Currently, the floppy boot disk kernel is based on the 2.2.13 kernel, and no special kernel source modification is required. However, we do configure the kernel (using make xconfig) in two special ways. First, we configure the kernel with SCSI emulation (CONFIG_CHR_DEV_SG and CONFIG_SCSI are set to true). We have IDE Zip disks and run them under SCSI emulation because it seems that the IDE driver doesn't handle large files well.

Our second configuration modification is to disable all access to the hard disk. Remember, we normally run a standard, multiuser Red Hat system in the lab. If we didn't disable access to the hard disk, the student could boot their Zip disk, mount the hard disk and have carte-blanche to make changes (like changing root's password). We disable hard disk access by setting two configuration variables to false, CONFIG_BLK_DEV_IDE and CONFIG_BLK_DEV_HD_IDE.

Other kernel configuration options enable the network device, enable SysV init, etc. Once the kernel is configured, we simply compile it. See the Kernel how-to for more information.

Installing the kernel on a floppy disk is done by creating a new ext2 file system on the floppy (using mke2fs) and copying the kernel to the root of the floppy. The floppy disk also requires a boot block (cp /boot/boot.b /mnt/floppy) and a special LILO configuration shown below:

boot=/dev/fd0 map=/mnt/floppy/map
install=/mnt/floppy/boot.b
prompt
compact
timeout=50
image=/mnt/floppy/vmlinuz
   label=linux
   root=/dev/sda1
   read-only

Our LILO configuration makes the floppy bootable and specifies the /dev/sda1 to be the root disk. Recall that we will be running SCSI emulation, so /dev/sda1 is the Zip disk.

We then run /sbin/lilo -C /mnt/floppy/lilo.conf to install the new LILO image.

Zip Root Disk Creation

The root disk is based on Slackware v7.0. We chose Slackware primarily because it gives fine control over what packages are installed, which enables us to easily fit a distribution on a 100MB Zip disk. For our system administration course, we installed the following packages: a, ap and n. Here are the commands:

# fdisk /dev/sda        create a single ext2
                            partition that
                            covers the entire
                            Zip disk
# mke2fs /dev/sda1          make a file system on
                            the Zip disk
# mount /dev/sda1 /mnt/zip  mount the Zip disk
# cd /mnt/zip
# tar -zxvf /tmp/slackware/a1/aaa_base.tgz
# sh install/doinst.sh
# rm -rf install

Repeat the last three steps for each desired package.

Unfortunately, we had to leave out certain packages for lack of space. Most notably, the d package that provides C/C++ and the k package that provides kernel source were excluded. We would like to remedy this in the future with a larger removable disk. Lineo, a company specializing in embedded Linux, provides an alternative to trimming down a standard Linux distribution in order to get standard UNIX utilities into a small space. BusyBox, an open-source project, combines tiny versions of many common UNIX utilities into a single small executable (see Resources).

Automating the Process

Students create their own boot and root disks in the first lab of the semester. However, they don't have enough knowledge of Linux to do this without a lot of hand-holding. Therefore, we've created a process whereby students can create the boot and root disks by running just a few commands. Specifically, we create images of a working boot and root disk. Creating the images is done with the following commands:

dd if=/dev/fd0  of=floppyimage
dd if=/dev/sda1 of=zipimage

Using this approach, students only have to use dd to dump the images to the appropriate device with these two commands:

dd if=floppyimage of=/dev/fd0
dd if=zipimage    of=/dev/sda1
Conclusions

Using Linux to teach system administration has worked very well for us. Using the Zip disk allows each student to get hands-on experience administering their own system without interfering with the “real” system on the hard drive and without interfering with other students. Although the Zip drive is only 100MB, it has proven adequate for creating a working system with all the necessary components.

We strongly feel that our lab would not have been possible without Linux. Because of its open-source nature, we were able to customize the distribution so a complete system would fit on one Zip disk. Furthermore, we were able to customize the kernel to make our production system safe from student tampering.

The only remaining problem with our approach of using a production laboratory environment as a dedicated system administration lab is with the necessary reboots interrupting remote users of the machines. We've addressed this problem by clearly identifying machines that are not subject to these reboots and encouraging remote access users to avoid lab machines with Zip disks.

You may find lecture notes, lab assignments and other software at the course web site (see Resources).

Resources

Teaching System Administration with Linux
D. Robert Adams is an assistant professor at GVSU. His research and teaching interests include object-oriented programming, Palm-based computing and programming languages. An associate professor at GVSU,

Teaching System Administration with Linux
Carl Erickson is currently on leave of absence working on the software architecture team of XiphNet, Inc. His research and teaching interests are in distributed and object-oriented computing.
Load Disqus comments

Firstwave Cloud