System Administration Guide, Volume I

How to Make Local CDs Available to Other Systems

You can configure your system to share its CD-ROM drives; in other words, make any CDs in those drives available to other systems. (This does not apply to musical CDs.) Once your CD-ROM drives are shared, other systems can access the CDs they contain simply by mounting them, as described in "How to Access CDs on Other Systems".

  1. Become superuser.

  2. Find out whether the NFS daemon (nfsd) is running.


    # ps -ef | grep nfsd
    root 14533    1 17 10:46:55 ?     0:00 /usr/lib/nfs/nfsd -a 16
    root 14656  289  7 14:06:02 pts/3 0:00 grep nfsd

    If the daemon is running, a line for /usr/lib/nfs/nfsd will appear, as shown above. If the daemon is not running, only the grep nfsd line will appear.

  3. Select an option from the following table.

    If ... 

    Then ... 

    nfsd is running

    Go to Step 8

    nfsd is not running

    Continue with Step 4

  4. Create a dummy directory for nfsd to share.


    # mkdir /dummy-dir
    

    dummy-dir

    Can be any directory name; for example, dummy. This directory will not contain any files. Its only purpose is to "wake up" the NFS daemon so that it notices your shared CD-ROM.

  5. Add the following entry into /etc/dfs/dfstab.


    share -F nfs -o ro [-d comment] /dummy-dir
    

    When you start the NFS daemon, it will see this entry, "wake up," and notice the shared CD-ROM drive. Note that the comment (preceded by -d) is optional.

  6. Start the NFS daemon.


    # /etc/init.d/nfs.server start
    
  7. Verify that the NFS daemon is indeed running.


    # ps -ef | grep nfsd
    root 14533    1 17 10:46:55 ?     0:00 /usr/lib/nfs/nfsd -a 16
    root 14656  289  7 14:06:02 pts/3 0:00 /grep nfsd
  8. Eject any CD currently in the drive.


    # eject cdrom0
    
  9. Assign root write permissions to /etc/rmmount.conf.


    # chmod 644 /etc/rmmount.conf
    
  10. Add the following lines to /etc/rmmount.conf.


    # File System Sharing
    share cdrom*

    These lines share any CD loaded into your system's CD-ROM drive. You can, however, limit sharing to a particular CD or series of CDs, as described in share(1M).

  11. Remove write permissions from /etc/rmmount.conf.


    # chmod 444 /etc/rmmount.conf
    

    This step returns the file to its default permissions.

  12. Load a CD.

    The CD you now load, and all subsequent CDs, will be available to other systems. Remember to wait until the light on the drive stops blinking before you verify this task.

    To access the CD, the remote user must mount it by name, according to the instructions in "How to Access CDs on Other Systems".

  13. Verify that the CD is indeed available to other systems by using the share command.

    If the CD is available, its share configuration will be displayed. (The shared dummy directory will also be displayed.)


    # share
    -    /dummy  ro "dummy dir to wake up NFS daemon"
    -    /Solaris_2.7_sparc  ro  ""

Example--Making Local CDs Available to Other Systems

The following example makes any CD loaded into the local system's CD-ROM drive available to other systems on the network.


# ps -ef | grep nfsd
    root 10127  9986  0 08:25:01 pts/2    0:00 grep nfsd
    root 10118     1  0 08:24:39 ?        0:00 /usr/lib/nfs/nfsd -a
# mkdir /dummy
# vi /etc/dfs/dfstab
(Add the following line:)
share -F nfs -o ro  /dummy
# eject cdrom0
# chmod 644 /etc/rmmount.conf
# vi /etc/rmmount
(Add the following line to the File System Sharing section.)
share cdrom*
# chmod 444 /etc/rmmount.conf
(Load a CD.)
# share
-					  /dummy ro ""
-               /cdrom/solaris_2_6_sparc/s5   ro   ""  
-               /cdrom/solaris_2_6_sparc/s4   ro   ""  
-               /cdrom/solaris_2_6_sparc/s3   ro   ""  
-               /cdrom/solaris_2_6_sparc/s2   ro   ""  
-               /cdrom/solaris_2_6_sparc/s1   ro   ""  
-               /cdrom/solaris_2_6_sparc/s0   ro   ""