gearsGadget Freak!
gears

Contents

Home

Gadgets I want

Who I am

Documentation

My résumé

This site is perpetually under construction!!

gears  

Using Solaris 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 Solaris - the Linux version of this 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. I'm also assuming that you know how to create .iso image files.  I 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, you can also use the mkisofs command that comes as part of Jörg Schilling's excellent cdrecord package to do it as well.  I know that under linux you can assign the command dd if=/dev/cdrom of=discname.iso, but I don't know for sure that this dd command will work under Solaris too.

Mounting the images:

lofi (the loopback file driver) and lofiadm (the administration tool for lofi)

Under some older versions of Linux, sometimes you'd have to recompile the kernel in order to have the ability to mount .iso image files though newer versions appear to have this already built in.  Fortunately under Solaris, the ability to mount .iso files also comes built-in, using the lofiadm command. 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 your mileage may vary:

Basically, it's a two step process to make this work:

  1. Assign an .iso disc image to a device (effectively making it kind of a separate drive) like so:

    lofiadm -a /mnt/iso/disc1.iso /dev/lofi/1
  2. Then mount the disc image to a directory:

    mount -F hsfs -o ro /dev/lofi/1 /mnt/cdmounts/disc1

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

    the lofiadm -a (add) indicates that you want to add disc1.iso that's located under /mnt/iso to the loopback device name /dev/lofi/1.

    mount -F hsfs -o ro specifies that you want to mount the -F (filesystem type) hsfs and the -o (filetype options) as ro (read only) under the directory /mnt/cdmounts/disc1

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.  Some info from the Linux 'mount' man pages.

    Normal iso9600 filenames appear in an 8.3 format (i.e., DOS-like restrictions on filename 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/rc2.d under the name of S99lofimount.  This allows me to mount the images automatically on reboot as such:

    lofiadm -a /mnt/iso/disc1.iso /dev/lofi/1
    lofiadm -a /mnt/iso/disc2.iso /dev/lofi/2
    lofiadm -a /mnt/iso/disc3.iso /dev/lofi/3
    lofiadm -a /mnt/iso/disc4.iso /dev/lofi/4
    lofiadm -a /mnt/iso/disc5.iso /dev/lofi/5


    mount -F hsfs -o ro /dev/lofi/1 /mnt/cdmounts/disc1
    mount -F hsfs -o ro /dev/lofi/2 /mnt/cdmounts/disc2
    mount -F hsfs -o ro /dev/lofi/3 /mnt/cdmounts/disc3
    mount -F hsfs -o ro /dev/lofi/4 /mnt/cdmounts/disc4
    mount -F hsfs -o ro /dev/lofi/5 /mnt/cdmounts/disc5


    You can also set it to automatically mount the images under the /etc/vfstab file, but I personally prefer to do it with this script.

 

Top

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

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