School Laboratory Management Blues

Creating an archive of boot images can save time and effort in busy, high-turnover classroom environments.

One of the main challenges in running a school computer laboratory is managing the software running on the different PCs allocated for use by students. System administrators face various scenarios, all stemming from the nature of a learning environment in which users all have superuser access to their machines. For example:

  • Essential system programs might be inadvertently or maliciously deleted, thus bringing down an application or the operating system itself; or

  • Installation of new applications might necessitate a change in some system libraries, thereby creating conflict with existing applications; or

  • Classes that require scratch installations of an operating system may disrupt subsequent classes dealing with databases or web servers.

In addition, there are several variations of the scenarios depicted above. Compounding the problem are scheduling pressures, as school computer laboratories frequently must accommodate a variety of classes, each one having its own unique requirements. Even administrators who manage a laboratory dedicated to one class per week still have to reinstall their systems for subsequent classes.

System management tools designed for the enterprise generally are inappropriate for a school computer laboratory environment. They were meant to manage a more-or-less consistent profile of computer systems across a company, one that changes less frequently and one with stricter usage policies than a learning environment. The cost of a commercial system management suite also can be prohibitive for a school.

Scripted installation tools, such as Red Hat's Kickstart program, can automate the installation of the operating system, but external and customized applications must be packaged separately by administrators. While this is a straightforward process for some applications, it can be quite complex for larger applications, especially those requiring interactive user input for configuration.

A Proposed Solution

One solution that addresses these issues is to maintain an archive of system images required for every class that is run in the laboratory. A system image can be restored to a personal computer as needed, typically in under half an hour. Far more efficient than a scratch OS installation, the system image does not need to be configured or loaded with additional required applications: configuration files and programs are stored as part of the image itself.

Thus, if an operating system is crippled because of a deleted system file, the administrator can simply restore the computer with the image pertaining to a certain class. Software with conflicting library requirements or even different operating system flavors can be installed in different system images and restored as needed. Classes with pre-established software requirements no longer need to go through the whole installation process to set up their systems.

Additionally, system images can be built on one master machine and re-used on machines with the same or similar configurations. This is a significant time saver for system administrators, as they can now build the image once and deploy it to several machines simultaneously.

Several commercial system image utilities are on the market, Ghost and DriveImage being the most popular ones, and on the whole they don't cost too much. However, school system administrators on severe budget constraints can do away with the purchases altogether and achieve greater flexibility by using basic utilities that ship with almost all Linux distributions.

General Implementation Strategy

Typically, an operating system, along with its configuration files and all the installed applications, resides in an entire partition of a computer's hard disk. When the computer boots up, the bootloader points to this partition as the source of all the required programs for normal operation. So at the heart of it all, you need a utility to back up an entire hard-disk partition to a file and, conversely, to restore it from a file to a partition.

The dd utility suits this purpose. dd's documentation modestly claims that it copies and converts files. In reality, it is a powerful utility because Linux and other UNIXes treat everything as files. For example, if you wanted to write an image of the second partition of your first hard drive (/dev/hda2) to a file, you would issue the command

        dd if=/dev/hda2 of=myimage.img

A 2GB-sized partition would result correspondingly in a 2GB file, so you would need to make sure the directory you are copying the image to has sufficient capacity. Also, make sure the partition you are cloning is not mounted or being used for any other activity.

Restoring an image to a partition is as easy a process.

   
        dd if=myimage.img of=/dev/hda2

Because the image backup and restore utility can't run by itself, you need to run it off an operating system. The same operating system must have access to all the partitions you are modifying, as well as the area where the image files are located. Other required components are the bootloader and a file partition utility.

The way this would work in practice, then, is:

  1. Boot from the master operating system.

  2. Use dd to restore a saved image to a preset partition.

  3. Reboot the system and use the bootloader to select the partition from which the machine should boot.

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

SystemImager helps me manage my clusters just fine

clusteradmin.blogspot.com's picture

(pretty old article, but I think SI is worth replying to the previous post)

I think SystemImager(SI) is a solid tool for managing software/OS installations in a PC cluster. With the more sophisticated transport methods (e.g. flamethrower) it can be quite efficient and scalable, too.
True, it's build around well-known components such as rsync, PXE + Linux kernel and Perl/shell scripts, but this is why it's so flexible and runs on a variety of hardware and software configurations.

My blog at clusteradmin.blogspot.com has a general overview of how the SI works and why it is a great tool, for more details I strongly recommend going through the official SystemImager manual which is a great read.

Thanks,
-marek

Re: School Laboratory Management Blues

Anonymous's picture

You might want to look in to the CVMS project at sourceforge. I made it on contract for an educational institution to do all this.

It requires VMWare licences for the machines, but it maintains images with rsync. It was designed for a Linux lab where students get root and regularly blow their machines up. Because of rsync and local caching, image reload times were kept below 30 seconds.

And it's all written in bash. I think there are only three users of it, though -- the school I wrote it for, me, and the USMC graduade school, who uses it for making virtual security labs or something.

Re: School Laboratory Management Blues

Anonymous's picture

Well, your article is nice but I think it would still require too much manual intervention each time you need to download an image. I suggest you visit a site called www.bpbatch.org. They provide software which allows you to script the download process.

Using their software, one can download either Linux or various versions of Windows. The client workstations boot off the network card using PXE, then connect to the boot server using DHCP, download a Bpbatch command interpreter, which runs the scripts. The scripting language supports VESA graphics, interactive menus and conditional branching. It also supports user authentification with various authentification servers. This is independent of the authentification provided for by the final OS downloaded to the client workstations.

The client workstations can display a menu on boot, or be directed to boot off any partition on the hard drive(s), or boot disklessly.

Downloading images to an entire group of PCs can be as simple as re-booting them when a class has ended.

Additionally, individual PCs can be identified for special treatment, even to the point of editing the Windows registry on re-boot.

I highly recommend you visit this excellent site.

Regards,

Seth Brown

handarn at yahoo dot com

Re: School Laboratory Management Blues

Anonymous's picture

I've been using IBM's Enterprise Volume Management System (http://evms.sf.net) in one of our labs for the last few months - although in a way that it was never really intended to work ;-), and it's been working out great for us.

Basically the lab machines run their root filesystem off of a snapshot volume that gets deleted and re-created every boot (unless bypassed).

This allows the students to log in as root, do their system config stuff, and then when the machine is rebooted all of the changes are rolled back.

If any of you are familliar with the GoBack product from Roxio, it functions in a similar manner.

This isn't a perfect solution, as a well-versed linux user can still "wreck" the system, but it keeps re-imaging the lab down to a minimum.

Re: School Laboratory Management Blues

Anonymous's picture

Well, your article is nice but I think it would still require too much manual intervention each time you need to download an image. I suggest you visit a site called www.bpbatch.org. They provide software which allows you to script the download process.

Using their software, one can download either Linux or various versions of Windows. The client workstations boot off the network card using PXE, then connect to the boot server using DHCP, download a Bpbatch command interpreter, which runs the scripts. The scripting language supports VESA graphics, interactive menus and conditional branching. It also supports user authentification with various authentification servers. This is independent of the authentification provided for by the final OS downloaded to the client workstations.

The client workstations can display a menu on boot, or be directed to boot off any partition on the hard drive(s), or boot disklessly.

Downloading images to an entire group of PCs can be as simple as re-booting them when a class has ended.

Additionally, individual PCs can be identified for special treatment, even to the point of editing the Windows registry on re-boot.

I highly recommend you visit this excellent site.

Regards,

Seth Brown

handarn at yahoo dot com

Re: School Laboratory Management Blues

Anonymous's picture

Uhm, This is also what Vmware workstation is designed to do. I know it costs about $300 a machine, but it would save you a whole lot of trouble and works really well. You can set the entire filesystem to write to a log and then simply roll back when the class is over. You can also save and store multiple system images that you can choose from and copy between the different computers. It's very simple and doesn't require any deep techinical knowledge.

Re: School Laboratory Management Blues

Anonymous's picture

This sounds all fine and dandy and overly complex. Why not use one of the free clones to Ghost already available? Ghost 4 Unix http://www.feyrer.de/g4u/ All you need is an FTP server and you can boot up off the network to retrieve images.

Why not use tar?

Anonymous's picture

Why not use tar? Then you aren't stuck with the same
partition size. Depending on vagaries of disk geometry,
partitions may have slightly different sizes, and you can't
dd a bigger image to a smaller hd partition.

Just boot from floppy, partition, mke2fs, tar xvf (yes, the devices and fifos will be created too), mount, lilo -R, set the hostname (and ip address if you're not using DHCP)
you're done.

We do this with a script off an NFS server, the only thing I haven't
automated yet is the fdisk step.

-- ac at work

Re: School Laboratory Management Blues

Anonymous's picture

You can also use gzip to compress the image while it is being created, thus saving disk space. Also different block sizes can improve performance. I've found 4096 to be a good size to start with.

dd if=/dev/hda bs=4096 | gzip > backup.img

another good tool

Anonymous's picture

SystemImager looks great.

I've used PartImage (http://partimage.org), which compresses images when they are created. It optionally uses a simple client/server setup to allow you to do over-the-network backup and restores so that you don't need to have a free local partition or NFS partition mounted.

It works great with both client and server systems running off of KNOPPIX boot CDs.

Another vote for Partimage

Anonymous's picture

Tastes great, less filling.

I plug my USB hard drive into my laptop, and start up partimaged. Then I boot the computer I want to image from a slightly modified LNX-BBC CD, run trivial-net-setup, and point partimage client at the server. Then I use dd to back up the mbr, and sfdisk to back up the partition table.

Backup images anywhere, anytime.

SystemInstaller

Anonymous's picture

May of these steps can be automated by an open source package called SystemImager. It is part of the System Installer Suite and can easily store multiple images and uses rsync to update machines, thereby saving a lot of time for smaller changes.

Kickstart

Anonymous's picture

IMHO, Kickstart is underrated.

I've seen an entire computer lab kickstarted from a Red Hat bootnet.img floppy in less than a half hour.

In the post installation section of the file you can fire off all kinds of customization scripts. It's truely something to behold!

Nice article. dd is the single most powerful command ever. :)

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix