gearsGadget Freak!
gears

Contents

Home

Gadgets I want

Who I am

Documentation

My résumé

This site is perpetually under construction!!

gears  

Using Linux as a CD-Rom server

by Ed Hagihara (created 3/22/03)

At my last job, having the MSDN library available for developers while keeping track of where the CDs actually were was a royal pain, and I can't tell you how many times I've had to go looking for installation CDs that someone's misplaced.  So far, I've found this to be a good solution to keeping valuable CDs locked up while still having them available on the network to allow people to install software.   This is for Linux - the Solaris version of the document is here

Two quick notes:

  1. I'm working under the assumption that samba has been installed on your computer and is working properly.  If not, check out my quick samba documentation here or confer with www.samba.org for more in-depth documentation.
  2. There's more detailed documentation and a step-by-step process on creating the CD-Rom server for Linux here at www.linuxdoc.org.

Creating the .iso images

I'm assuming that you know how to create .iso image files. I personally use an excellent program called WinImage on Windows to create mine and copy it to a samba share (and a number of cd recording programs can do it too), but under unix, at at very base level, you can also just assign the command:

dd if=/dev/cdrom of=discname.iso

dd is a disc copy command. "if=" stands for input file (or source), the "of=" is the output file (or destination). After the dd command completes, you should see a message that lists the number of records in and number of records out.

The mkisofs command that comes as part of Jörg Schilling's excellent cdrecord package has additional options that can accomplish this too.

Mounting the images:

Basically, it's a one step process to make this work, providing your kernel already has loop support (which it most likely does). Now on my home system, I'm actually using two directories that have been shared out with SAMBA under /mnt/iso (for your .iso images) and /mnt/cdmounts (for the mounted .iso images), so obviously your mileage may vary:

mount -o loop -t iso9660 -r /mnt/iso/disc1.iso /mnt/cdmounts/disc1

Here's a quick description of what's going on:

mount -o loop specifies that you want to mount the iso file from a loopback device. The -t (filesystem type) iso9660 specifies what kind of filesystem (like ext2, ext3, msdos, hfs, hpfs, ntfs, vfat, etc...) is going to be mounted and the -r (read only) says that directory /mnt/cdmounts/disc1 is considered read-only and can't be written to. Note that the filesystem support is dependent on the options in your Linux kernel. Issuing a 'man mount' command will allow you to see a full list of the filesystems supported.

A couple of additional notes:

  1. Unfortunately the Solaris CD-Rom server doesn't have Joliet filesystem support so long names are lost unless you use the ISO9660 format with Rock Ridge Extensions. At some point I tried to mount the MS SQL Server Enterprise CD so I could install the SQL client tools, but it barked at me saying that it needed Joliet support. Some info from the Linux 'mount' man pages:

    Normal iso9600 filenames appear in a 8.3 format (i.e., DOS-like restrictions on file name length), and in addition all characters are in upper case. Also there is no field for file ownership, protection, number of links, provision for block/character devices, etc.

    Rock Ridge is an extension to iso9660 that provides all of these unix like features. Basically there are extensions to each directory record that supply all of the additional information, and when Rock Ridge is in use, the filesystem is indistinguishable from a normal UNIX file system (except that it is read-only, of course).
  2. I've created a small script based off of this and placed it under /etc/rc.d/rc3.d under the name of S99lofimount. This allows me to mount the images automatically on reboot as such:

    mount -o loop -t iso9660 -r /mnt/iso/disc1.iso /mnt/cdmounts/disc1
    mount -o loop -t iso9660 -r /mnt/iso/disc2.iso /mnt/cdmounts/disc2
    mount -o loop -t iso9660 -r /mnt/iso/disc3.iso /mnt/cdmounts/disc3
    mount -o loop -t iso9660 -r /mnt/iso/disc4.iso /mnt/cdmounts/disc4
    mount -o loop -t iso9660 -r /mnt/iso/disc5.iso /mnt/cdmounts/disc5

    ... and so forth.

 

Top

Home  |  Gadgets  |  Who I Am  |  Documentation  |  My résumé

© 2002-2003 - Edward Hagihara and Ms. Phitt, Web Site Development by Ms. Phitt