System Administration Guide: Devices and File Systems

Accessing Removable Media on a Remote System (Task Map)

The following table describes the tasks need to access removable media on a remote system.

Task 

Description 

For Instructions 

1. Make local media available to remote systems 

Add the removable media drive to your system, if necessary. 

How to Make Local Media Available to Other Systems

2. Access removable media on remote systems 

Insert the media into the drive.  

How to Access Information on Removable Media

ProcedureHow to Make Local Media Available to Other Systems

You can configure your system to share its media drives to make any media in those drives available to other systems. (This does not apply to musical CDs.) Once your media drives are shared, other systems can access the media they contain simply by mounting them, as described in How to Access Removable Media on Remote Systems.

Steps
  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. Identify the nfsd status and select one of the following:

    1. If nfsd is running, go to Step 8.

    2. If nfsd is not running, continue with Step 4.

  4. Create a dummy directory for nfsd to share.


    # mkdir / dummy-dir
    

    The dummy-dir mount point 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 media drive.

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


    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 media 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 media currently in the drive.


    # eject media
    
  9. Assign root write permissions to the /etc/rmmount.conf file.


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


    # File System Sharing
    share media*

    These lines share any media 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 the /etc/rmmount.conf file.


    # chmod 444 /etc/rmmount.conf
    

    This step returns the file to its default permissions.

  12. Load the media.

    The media you now load, and all subsequent media, 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 media, the remote user must mount it by name, according to the instructions in How to Access Removable Media on Remote Systems.

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

    If the media 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"
    -    /cdrom/sol_9_1202_sparc/s5   ro   ""  
    -    /cdrom/sol_9_1202_sparc/s4   ro   ""  
    -    /cdrom/sol_9_1202_sparc/s3   ro   ""  
    -    /cdrom/sol_9_1202_sparc/s2   ro   ""  
    -    /cdrom/sol_9_1202_sparc/s1   ro   ""  
    -    /cdrom/sol_9_1202_sparc/s0   ro   ""  

Example 2–3 Making Local CDs Available to Other Systems

The following example shows how to make any local CD 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.conf
(Add the following line to the File System Sharing section:)
 share cdrom*
# chmod 444 /etc/rmmount.conf
(Load a CD.)
# share
-               /dummy   ro   ""  
-               /cdrom/sol_9_1202_sparc/s5   ro   ""  
-               /cdrom/sol_9_1202_sparc/s4   ro   ""  
-               /cdrom/sol_9_1202_sparc/s3   ro   ""  
-               /cdrom/sol_9_1202_sparc/s2   ro   ""  
-               /cdrom/sol_9_1202_sparc/s1   ro   ""  
-               /cdrom/sol_9_1202_sparc/s0   ro   ""  


Example 2–4 Making Local Diskettes Available to Other Systems

The following example shows how to make any local diskette 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 floppy0
# chmod 644 /etc/rmmount.conf
# vi /etc/rmmount.conf
(Add the following line to the File System Sharing section.)
share floppy*
# chmod 444 /etc/rmmount.conf
(Load a diskette.)
# volcheck -v
media was found
# share
-               /dummy   ro   ""  
-               /floppy/myfiles   rw   ""  


Example 2–5 Making Local PCMCIA Memory Cards Available to Other Systems

The following example shows how to make any local PCMCIA memory card 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 pcmem0
# chmod 644 /etc/rmmount.conf
# vi /etc/rmmount.conf
(Add the following line to the File System Sharing section:)
share floppy*
# chmod 444 /etc/rmmount.conf
(Load a PCMCIA memory card.)
# volcheck -v
media was found
# share
-               /dummy   ro   ""  
-               /pcmem/myfiles   rw   ""  

ProcedureHow to Access Removable Media on Remote Systems

You can access media on a remote system by mounting it manually into your file system, provided the other system has shared its media according to the instructions in How to Make Local Media Available to Other Systems.

Steps
  1. Select an existing directory to serve as the mount point or create one.


    $ mkdir directory
    

    directory is the name of the directory that you create to serve as a mount point for the other system's CD.

  2. Find the name of the media you want to mount.


    $ showmount -e system-name
    

    For example:


    export list for starbug:
    /dummy                     (everyone)
    /cdrom/sol_9_1202_sparc/s5 (everyone)
    /cdrom/sol_9_1202_sparc/s4 (everyone)
    /cdrom/sol_9_1202_sparc/s3 (everyone)
    /cdrom/sol_9_1202_sparc/s2 (everyone)
    /cdrom/sol_9_1202_sparc/s1 (everyone)
    /cdrom/sol_9_1202_sparc/s0 (everyone)

    As superuser, mount the media.


    # mount -F nfs -o ro system-name:/media/media-name local-mount-point
    
    system-name

    The name of the system whose media you will mount.

    media-name

    The name of the media you want to mount.

    local-mount-point

    The local directory onto which you will mount the remote media.

  3. Log out as superuser.

  4. Verify that the media is mounted.


    $ ls /media
    

Example 2–6 Accessing CDs on Other Systems

The following example shows how to mount the CD named sol_9_1202_sparc from the remote system starbug onto the /mnt directory of the local system.


$ showmount -e starbug
export list for starbug:
/dummy                     (everyone)
/cdrom/sol_9_1202_sparc/s5 (everyone)
/cdrom/sol_9_1202_sparc/s4 (everyone)
/cdrom/sol_9_1202_sparc/s3 (everyone)
/cdrom/sol_9_1202_sparc/s2 (everyone)
/cdrom/sol_9_1202_sparc/s1 (everyone)
/cdrom/sol_9_1202_sparc/s0 (everyone)
$ su
Password: password
# mount -F nfs -o ro starbug:/cdrom/sol_9_1202_sparc/s0 /mnt
# exit
$ ls /mnt
Copyright  Solaris_9 


Example 2–7 Accessing Diskettes on Other Systems

The following example shows how to mount the diskette named myfiles from the remote system mars onto the /floppy directory of the local system.


$ cd /net/mars
$ ls /floppy
floppy0     myfiles
$ su
Password: password
# mount -F nfs mars:/floppy/myfiles /floppy
# exit
$ ls /floppy
myfiles


Example 2–8 Accessing PCMCIA Memory Cards on Other Systems

The following example shows how to mount the PCMCIA memory card named myfiles from the remote system mars onto the /pcmem directory of the local system.


$ cd /net/mars
$ ls /pcmem
pcmem0     myfiles
$ su
Password: password
# mount -F nfs mars:/pcmem/myfiles /pcmem
# exit
$ ls /pcmem
myfiles