Maragda: Running Linux from CD

An overview of one man's DIY adventure in putting Linux on a bootable CD-ROM.

The project described here is further proof that Linux is a powerful and versatile system.

My college has several trolleys that carry a computer (PC) and a VCR, and both are connected to a video projector. They have so many users that it's difficult to keep them working properly. This is especially true in the case of the computer; you can't ever be sure what software you will find on the hard disk.

I decided to use the projectors in the introductory programming course to show my students source C programs and how to run them step-by-step. I, of course, wanted to use Linux and its programming tools so that my students learn that Windows is not the only choice.

In this situation, I came to the conclusion that I needed some sort of portable Linux system, and I didn't want to use my notebook in the classroom.

My first idea was to try installing Linux on an Iomega Zip 250MB drive for parallel ports. After a few days of work I achieved it. It needs a floppy to boot the system, and the run speed is not too bad. Then I repeated the task, this time installing Linux on an IDE hard disk contained in the IDE box adapter for parallel ports. This configuration removes the limitation of 250MB disk space and speeds up the running of Linux.

From the lessons learned from these tasks, I asked myself, why not run Linux from a CD-ROM? That would be convenient and easier to use. In addition, students could use it to start learning Linux without having to install it on their computers. And so Maragda was born.

How to Use Maragda

The final product is a bootable CD-ROM, so you must configure your BIOS to boot from the CD drive. If your BIOS doesn't support this, there is a solution: a bootable floppy that will also boot Linux from the CD. In fact, a raw image of the floppy is what the CD contains to boot itself.

The Linux software on the CD is installed from the Red Hat 6.2 distribution, and I prepared two arrangements. The first one is a full installation. It contains the base system, printer support, the X Window System, the VGA16 and framebuffer X servers, GNOME (or you can edit .xinitrc and uncomment the line for the window manager you like the most), network server workstation, authoring and publishing tools (LaTeX, etc.), Emacs, development tools (make, egcs, etc.), DOS/Windows connectivity, mail, WWW and news tools, and other packages such as rhide, ssh support and the JDK 1.2.

The second arrangement, which I call Maragda Teaching, is only equipped with part of the packages of the base system and X (to use fvwm2), with the complete development tools and other tools such as gv and rhide.

Full Maragda requires at least 64MB of RAM, while Maragda Teaching (and its tools) runs with only 32MB. There's a second arrangement of full Maragda that runs with 32MB but does not include room for tools such as Emacs or Netscape, which require more memory.

In both cases, the same kernel is used. It is version 2.2.14, and it supports (among other things) the network, the framebuffer device, the loop-back device, RAM disk and initial RAM disk.

Configuration

One of the problems of any system intended for portability is how to adapt to different hardware. At the very least, the mouse and video (X) must be configured, and then the passwords, network identity and others. In the case of Maragda, it should be remembered that no change survives one session because the files on the CD are read-only.

Full Maragda is configured by default to support a PS2 mouse and the framebuffer device for video with a depth of 32. Network uses the driver 3c59x (a 3Com card) with identity maragda.gnd.upv.es (192.168.0.1).

However, full Maragda has an open door that allows you to decide on the configuration yourself. Just after the main file systems are mounted, the boot process stops and asks for an ext2 formatted floppy. Every file on the floppy will be merged into the system before the programs and d<\#230>mons are started.

Which files should be on the floppy? Consider the following list as a guide:

/etc/passwd/etc/shadow/etc/hosts/etc/hosts.allow/etc/hosts.deny/etc/resolv.conf/etc/HOSTNAME/etc/sysconfig/network-scripts/ifcfg-eth0/etc/sysconfig/network/etc/X11/XF86Config/etc/X11/X/etc/conf.modules

If you know nothing about these files or other configuration files, there is still hope for you. You must continue the boot and log in as root (I hope this will always be possible). The CD will be mounted in /mnt/cdrom. In /mnt/cdrom/system/config-touch you will find two scripts. Running Touch_all will touch all the files in the system. Then run the configuration tool you need (setup, xconfigurator or control-panel in X). Finally, run Find_newer. It will find the files updated by the configuration, and it will copy them to a directory named config in the current directory. Put the files on a floppy and you are done.

The configuration of Maragda Teaching is restricted. It does not ask for a floppy, and prompts you to choose one of four configurations already on the system:

  1. PS2 mouse and frame buffer

  2. serial mouse and frame buffer

  3. PS2 mouse and vga

  4. serial mouse and vga

In future versions of Maragda, I plan to detect the environment where Maragda is booting and auto configure it.

______________________

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