Return to General UNIX Home Page.


ISO 9660 CDROM Images

by Jeff Hunter, Sr. Database Administrator


History of ISO 9660

The original ISO 9660 CD format is very restrictive. It allows only 8.3 style filenames, all uppercase, very shallow directory trees, etc. Many years ago the Unix folks came up with a backward compatible set of extensions (known as "Rock Ridge") to work around these restrictions. Years later, the Windows folks ignored their work and came up with their own set of extensions ("Joliet"). Being the stubborn beasts that they are, both Sun & Windows have apparently refused to support the other guy's format (Linux does support both, by the way).

So, to create a single CD that supports long filenames on both Windows & Solaris requires that you burn a hybrid CD that contains two separate directory structures that share the same data. None of the pretty, chock-full-o-bells-and-whistles Windows software I looked at (Easy CD Creator, CDRWin, & Nero) support the creation of such a hybrid CD. But the Linux people have command-line software, which can do this pretty easily. And it has been ported to both Solaris & Windows.

The main program you need (mkisofs) comes with Solaris & Red Hat Linux. A Windows version is available at ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/alpha/win32/. The version at the time of this writing is: 1.11a12.

Creating a Windows / UNIX Hybrid CD

Create an ISO CD image

If you have the directory tree you wish to burn at /tmp/ts35, you would use a command like

  # mkisofs -o ts30.iso -J -R -V TRUESOURCE_3.5 /tmp/ts35
This creates a disk image named "ts35.iso" which supports both Joliet (-J) and Rock Ridge (-R) and has a volume label of "TRUESOURCE_3.5". In my case, using a Cygwin executable on Windows (and with the source tree unpacked at D:\3.5), my source directory was "/d/3.5".

Burn the CD

This can be done using any program that can burn a raw ISO CD image, and I believe they all can. I used Nero with the command "File / Burn Image...".

For maximum compatibility, you do want to make sure that you burn "Disk At Once" (not "Track At Once") and "Finalize" the disk.

Mounting an ISO Image to a File System

The next step is to mount the ISO image file. Let's create a directory under /mnt to place the mounted file.
  # cd /mnt
  # mkdir iso
  # cd iso
  # mkdir mndrk71
Now mount the ISO image file to this newly created directory
  # mount -o loop -t iso9660 -r /home/image/mndrk71.iso /mnt/iso/mndrk71
NOTE: The "-o loop" means use the option that mounts a file as a block device. The "-t iso9660" means that the file is in the iso9660 CD-ROM format. The "-r" means to mount read-only.

Now you can:

  # cd mndrk71
  # ls -al
You should see a listing (ls) of the files and directories that are on the actual CD (only now they're inside the ISO image file, and that's what you're currently looking at!)

Mounting the Image upon System Restart

Now that we've manually mounted the image, and made sure it works, an entry needs to made in the /etc/fstab file for Linux and /etc/vfstab file for Solaris so that the image is remounted on the next system startup. It's important to make the entry AFTER the entry for the parent filesystem, e.g. /home:
  # vi /etc/fstab
After the line that looks like the following (or whichever filesystem you've placed your images):
/dev/hda8 /home ext2 defaults 1 2
Insert the following line with your text editor:
/home/image/mndrk71.iso /mnt/iso/mndrk71 iso9660 ro,loop,auto 0 0

Sharing is on a Windows Network using Samba

You'll need to have Samba installed and working to perform the next steps.

To share your mounted CD's on a windows network, simply create a stanza in the /etc/smb.conf file similar to the following:

[cdimages]
  comment = All Shared CD Images
  path = /mnt/iso
  public = yes
  writable = no
This will share all the subdirectories under the /mnt/iso directory on the network. To mount the share to a local drive (in this case the I: drive), bring up an MS-DOS Prompt on the Windows machine and type the following:
  C:\> net use I: \\yourlinuxmachine\cdimages
Each CD image will now appear as a subdirectory on the I: drive of your Windows machine.

To mount ONLY the Mandrake CD image to a drive letter (we'll use M:, the root drive of which, will correspond exactly to the CD as if it was just inserted in the CD-ROM drive), create the following stanza in the /etc/smb.conf file.

[mndrk71]
  comment = Mandrake Linux 7.1
  path = /mnt/iso/mndrk71
  public = yes
  writable = no
Then, at your MS-DOS Prompt, mount it with the following command:
  C:\> net use m: \\yourlinuxmachine\mndrk71
NOTE: The Samba smb.conf file stanzas presented here are simplified, and not entirely secure. Many more options exist for a Samba share, which limit who can mount the shares, control how user authentication is performed, whether the share is even browseable through Network Neighborhood on the Windows machines.

Sharing the Images on a UNIX Network using NFS

Make sure that NFS is running and configured correctly on your Linux machine, then add the following to the /etc/exports file using your own preferred options:

sample /etc/exports file

/mnt/iso            (ro,insecure,all_squash)
Now, when typing "showmount -e yourlinuxmachine" you should see that the /mnt/iso is included in the exports list.



Last modified on: Saturday, 18-Sep-2010 18:21:00 EDT
Page Count: 59876