Build a Virtual CD-ROM Jukebox
If our VCDJ has a lot of ISO 9660 images, it won't be possible to mount all of them statically. The next step is to configure the automounter. The automounter will mount an ISO 9660 image only when it is accessed. It will unmount it after a time of inactivity. We need this because there is a limit to how many filesystems can be mounted via the loopback device at one time. It's unlikely that all of the CD-ROMs will be in use simultaneously, so it's the automounter to our rescue. (See “Tux Knows It's Nice to Share, Part 4” by Marcel Gagné at /article/5298 for instructions to install and initially set up the automounter.)
First, edit /etc/auto.master, and append to it the following line:
/mnt/isosrv_auto /etc/auto.isosrv --timeout=60
Make sure the directory /mnt/isosrv_auto exists. Restart the automounter for this change to take effect.
Create the file /etc/auto.isosrv, and append to it the following line:
image1 -fstype=iso9660,ro,loop :/mnt/images/image1.iso
Create a similar line for every ISO 9660 CD-ROM image that is to be automounted.
If you mount on your VCDJ, you should see a line like this:
automount(pid782) on /mnt/isosrv_auto type autofs (rw,fd=5,pgrp=782,minproto=2,maxproto=3)
(The various numeric values will likely be different on your system.)
The automounter does not have to be restarted when changes are made to /etc/auto.isosrv. So far we've told the automounter that when some process tries to access a file or directory somewhere in /mnt/isosrv_auto/image1/, it will mount image1.iso. After a period of time of no access to the directory, the image will be unmounted.
There's one last problem. List the contents of /mnt/isosrv_auto/
If nothing has accessed the contents of the CD-ROM image recently, this directory will appear to be empty.
If you explicitly list the contents of the CD-ROM,
you will see the contents. Now go back and list the contents of /mnt/isosrv_auto/ again, and you will see image1. Eventually, the automounter will unmount the image, and once again the directory will be empty.
This is a problem because it means the users will have to know the names of all the CD-ROMs that they want to access. Directory browsing won't work, which is clearly not acceptable.
The solution is to create another directory called /mnt/isosrv/. Enter that directory and perform the following commands:
mkdir image1 cd image1 ln -s ../../isosrv_auto/image1 disc
Repeat this for every ISO 9660 CD-ROM image.
Listing the contents of /mnt/isosrv/ will show all the available images, regardless of whether the automounter has mounted them.
See “Tux Knows It's Nice to Share, Part 5” by Marcel Gagné (/article/5297) for instructions on installation and initial setup of Samba. Be sure that you have authentication set up to protect the CD-ROM contents properly, according to their licensing agreements. (Not a problem if everything is open source!)
Recall that one goal is to provide access to the ISO 9660 images and their contents simultaneously via Samba. To do this, edit /etc/smb.conf (or maybe /etc/samba/smb.conf), and append the following lines:
[isoimages] comment = ISO9660 CD ROM images path = /mnt/images/ [cdroms] comment = Contents of CD ROMs path = /mnt/isosrv/
Restart Samba. Now go to a Windows client (or any other computer that can be an SMB client) and browse your VCDJ. You should see two new shares: isoimages and cdroms. In the isoimages share are all the ISO 9660 images, and in the cdroms share are the contents of the images. Browse the contents of the directory image1 in the cdroms share. If you mount on your VCDJ, you should see a line like this:
/mnt/images/image1.iso on /mnt/isosrv_auto/image1 type iso9660 (ro,loop=/dev/loop0)
Figure 1 shows a diagram of the order of things when a network client accesses data in the cdroms share. Note that if the client accessed an ISO 9660 image directly, the Samba process would directly read from /mnt/images/, bypassing all symlinks and the automounter.
As you add more ISO 9660 images, you'll come to appreciate the value of a VCDJ. You're only limited by available disk space, and the cost and degree of effort to add more capacity is much less than trying to add more physical CD-ROM drives. Now you can make all your CD-ROMs available across your enterprise, whether in your office or in your home, and you'll never have to worry about people not returning borrowed CD-ROM disks.
Jeremy Impson (email@example.com) is a senior associate research scientist at Lockheed Martin Systems Integration in Owego, New York. There he's a member of The Center for Mobile Communications and Nomadic Computing, where he uses open-source software to develop mobile computing systems.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- ServersCheck's Thermal Imaging Camera Sensor
- The Italian Army Switches to LibreOffice
- Linux Mint 18
- Petros Koutoupis' RapidDisk
- Oracle vs. Google: Round 2
- The FBI and the Mozilla Foundation Lock Horns over Known Security Hole
- Privacy and the New Math
- Ben Rady's Serverless Single Page Apps (The Pragmatic Programmers)
Until recently, IBM’s Power Platform was looked upon as being the system that hosted IBM’s flavor of UNIX and proprietary operating system called IBM i. These servers often are found in medium-size businesses running ERP, CRM and financials for on-premise customers. By enabling the Power platform to run the Linux OS, IBM now has positioned Power to be the platform of choice for those already running Linux that are facing scalability issues, especially customers looking at analytics, big data or cloud computing.
￼Running Linux on IBM’s Power hardware offers some obvious benefits, including improved processing speed and memory bandwidth, inherent security, and simpler deployment and management. But if you look beyond the impressive architecture, you’ll also find an open ecosystem that has given rise to a strong, innovative community, as well as an inventory of system and network management applications that really help leverage the benefits offered by running Linux on Power.Get the Guide