Table of Contents |
STARTING WITH THE SOLARIS 2.2 SYSTEM SOFTWARE, VOLUME MANAGEMENT AUTO-mates the mounting of CD-ROMs and diskettes; users no longer need to have superuser permissions to mount a CD-ROM or a diskette.
NOTE: The Solaris 2.0 and 2.1 procedures for mounting CD-ROMs and diskettes do not work for Solaris 2.2 and later releases. Volume management controls the /dev/dsk/c0t6d0s0 path to a CD-ROM drive and the /dev/diskette path to the diskette drive. If you try to access a CD-ROM or diskette using these paths, an error message is displayed.
Volume management provides users with a standard interface for dealing with diskettes and CD-ROMs. It provides three major benefits:
Without volume management, you mount devices manually by following these steps:
With volume management, you mount devices automatically by following these steps:
Volume management consists of the following elements:
The default /etc/vold.conf file is shown below:
# @(#)vold.conf 1.21 96/05/10 SMI # # Volume Daemon Configuration file # # Database to use (must be first) db db_mem.so # Labels supported label dos label_dos.so floppy rmscsi pcmem label cdrom label_cdrom.so cdrom label sun label_sun.so floppy rmscsi pcmem # Devices to use use cdrom drive /dev/rdsk/c*s2 dev_cdrom.so cdrom%d use floppy drive /dev/rdiskette[0-9] dev_floppy.so floppy%d use pcmem drive /dev/rdsk/c*s2 dev_pcmem.so pcmem%d forceload=true # use rmscsi drive /dev/rdsk/c*s2 dev_rmscsi.so rmscsi%d # Actions insert dev/diskette[0-9]/* user=root /usr/sbin/rmmount insert dev/dsk/* user=root /usr/sbin/rmmount eject dev/diskette[0-9]/* user=root /usr/sbin/rmmount eject dev/dsk/* user=root /usr/sbin/rmmount notify rdsk/* group=tty user=root /usr/lib/vold/volmissing -p # List of file system types unsafe to eject unsafe ufs hsfs pcfs
If a system has additional diskette drives, volume management automatically creates two subdirectories in /vol/dev for each additional drive--one to provide access to the file systems and the other to provide access to the raw device. For a second diskette drive, volume management creates directories named diskette1 and rdiskette1. For a third diskette drive, it creates directories named diskette2 and rdiskette2. And so on for additional drives.
If you want additional CD-ROM drives on a system, you must edit the /etc/vold.conf file and add the new devices to the Devices to use list. The syntax for a Devices to use entry is shown as follows:
use device type special shared-object symname options
Table A-1 describes each of the fields for the Devices to use syntax.
Field | Supported Default Values | Description |
---|---|---|
device | cdrom, floppy | The removable media device. |
type | drive | The type of device--multiple or single media support. |
special | /dev/dsk/c0t6/, dev/diskette | Pathname of the device to be used in the /dev directory. |
shared-object | /usr/lib/vold/shared-object-name | Location of the code that manages the device. |
symname | cdrom0, floppy0 | The symbolic name that refers to this device. The symname is placed in the device directory (either /cdrom or /floppy). |
options | user=nobody group=nobody mode=0666 | The user, group, and mode permissions for the inserted media. |
The /etc/rmmount.conf file is as follows:
# @(#)rmmount.conf 1.3 96/05/10 SMI # # Removable Media Mounter configuration file. # # File system identification ident hsfs ident_hsfs.so cdrom ident ufs ident_ufs.so cdrom floppy rmscsi pcmem ident pcfs ident_pcfs.so floppy rmscsi pcmem # Actions action cdrom action_filemgr.so action floppy action_filemgr.so action rmscsi action_filemgr.so
The files in the /usr/lib/vold directory are listed as follows:
castle% ls -1 /usr/lib/vold db_mem.so.1 db_nis.so.1 dev_cdrom.so.1 dev_floppy.so.1 dev_pcmem.so.1 dev_rmscsi.so.1 dev_test.so.1 eject_popup label_cdrom.so.1 label_dos.so.1 label_sun.so.1 label_test.so.1 volcancel volmissing volmissing_popup volstat castle%
The files in the /usr/lib/rmmount directory are listed as:
oak% ls -1 /usr/lib/rmmount action_filemgr.so.1 action_workman.so.1 oak%
If you encounter problems with volume management, check the /var/adm/vold.log file for information. An example of this file follows:
oak% more /var/adm/vold.log Tue Jun 1 17:34:24 1993 warning: dev_use: couldn't find a driver for drive cdrom at /dev/dsk/cØt6 Tue Jun 1 17:39:12 1993 warning: dev_use: couldn't find a driver for drive cdrom at /dev/dsk/cØt6 Tue Jun 1 18:24:24 1993 warning: dev_use: couldn't find a driver for drive cdrom at /dev/dsk/cØt6 Wed Jun 23 15:Ø8:47 1993 warning: check device 36.2: device not managed Wed Jun 23 15:Ø9:58 1993 warning: check device 36.2: device not managed Wed Jun 23 15:11:Ø8 1993 warning: check device 36.2: device not managed Thu Jul 15 13:51:23 1993 warning: check device 36.2: device not managed Thu Jul 15 13:52:53 1993 warning: check device 36.2: device not managed Thu Jul 15 14:Ø4:37 1993 warning: check device 36.2: device not managed Thu Jul 15 14:Ø5:52 1993 warning: check device 36.2: device not managed Thu Jul 15 14:Ø6:16 1993 warning: check device 36.2: device not managed Wed Jul 21 16:33:33 1993 fatal: svc_tli_create: Cannot create server handleThu Jul 22 16:32:28 1993 warning: cdrom: /dev/rdsk/cØt6dØs2; Device busy castle%
If you want to display debugging messages from the volume daemon, you can start the daemon by typing /usr/sbin/vold -v -L 10. With these flags set, the volume daemon logs quite a bit of information in /var/adm/vold.log.
Another way to gather debugging information is to run the rmmount command with the debug flag. To do so, edit /etc/vold.conf and change the lines that have /usr/sbin/rmmount to include the -D flag, as shown in the following example:
insert /vol*/dev/diskette[Ø-9]/* user=root /usr/sbin/rmmount -D
Volume management automatically mounts CD-ROM file systems on the /cdrom mount point when you insert the media into the drive.
When you insert a diskette in the diskette drive, you must ask the system to check the diskette drive. You can check for a disk in any one of the following ways:
When you use any one of these methods, the files are mounted on the /floppy mount point. Table A-2 describes the mount points and how volume management uses them.
Media | Mount Point | State of Media |
---|---|---|
Diskette | /floppy/floppy0 | Symbolic link to mounted diskette in local diskette drive |
/floppy/floppy-name | Mounted named diskette | |
/floppy/unnamed_ floppy | Mounted unnamed diskette | |
CD-ROM | /cdrom/cdrom0 | Symbolic link to mounted CD-ROM in local CD-ROM drive |
/cdrom/CD-ROM-name | Mounted named CD-ROM | |
/cdrom/CD-ROM-name/partition | Mounted named CD-ROM with partitioned file system | |
/cdrom/unnamed_ cdrom | Mounted unnamed CD-ROM | |
If the media does not contain a file system, volume management provides block and character devices in the /vol file system, as shown in Table A-3.
Media | Device Location | State of Media |
---|---|---|
Diskette | /vol/dev/diskette0/ unnamed_floppy | Formatted unnamed diskette-block device access |
/vol/dev/rdiskette0/ unnamed_floppy | Formatted unnamed diskette--raw device access | |
/vol/dev/diskette0/unlabeled | Unlabeled diskette--block diskette-raw device access | |
CD-ROM | /vol/dev/dsk/c0t6/unnamed_cdrom | CD-ROM--block device access |
/vol/dev/rdsk/c0t6/unnamed_cdrom | CD-ROM--raw device access | |
The following sections describe how to access files from local and remote CD-ROM drives.
Use the following procedure to mount a CD-ROM from a local drive:
Figure A-1 The File Manager CD-ROM window.
NOTE: You can use the File Manager CD-ROM window and the command line interchangeably. For example, you can eject a CD-ROM either from a command line by typing eject cdrom or by clicking SELECT on the Eject button in the File Manager CD-ROM window.
Before you can share CD-ROM files from a command line, the mountd daemon must be running. On the system with the CD-ROM drive attached, type ps -ef | grep mountd and press Return.
If the mountd daemon is running, other systems can access shared files. If the mountd daemon is not running, you need to stop NFS services and restart them. Be sure to notify any users of the system that NFS services will be interrupted momentarily when you use the following procedure to start the mountd daemon:
oak% ps -ef | grep mountd root 4571 4473 5 12:53:51 pts/3 Ø:ØØ grep mountd oak% su Password: # /etc/rc3.d/S15nfs.server stop # /etc/rc3.d/S15nfs.server start
Use the following steps to share CD files from a remote CD-ROM drive:
oak% su Password: # share -F nfs -o ro /cdrom/cdromØ # ps -ef | grep mountd root 4655 4473 6 12:56:Ø5 pts/3 Ø:ØØ grep mountd root 4649 1 47 12:55:25 ? Ø:ØØ /usr/lib/nfs/mountd #
NOTE: Volume management does not recognize entries in the /etc/dfs/dfstab file. With Solaris 2.3 and later releases of volume management, you can set up remote CD-ROM mounts to be automatically shared by editing the /etc/rmmount.conf file. Refer to the rmmount.conf manual page for more information.
You can use the /mnt directory as the mount point for the CD-ROM files or create another directory.
CAUTION: Do not use the /cdrom mount point to mount local files. Volume management may interfere with accessing files on the volume management /cdrom mount point.
Once the CD-ROM is in the remote drive and the files are shared, follow these steps to access the shared files on a local system:
In the following example, the files from the remote system castle are mounted on the /mnt mount point.
oak% su Password: # mount castle:/cdrom/cdrom0 /mnt # cd /mnt # ls SUNWssser SUNWsssra SUNWsssrb SUNWsssrc SUNWsssrd SUNWssstr #
When you are through using the CD-ROM files, use the following steps to unmount the remote CD-ROM:
When you insert a diskette into the diskette drive, volume manager does not mount the diskette automatically; this prevents excessive reads, which can quickly wear out the diskette drive. You must use a command that checks for the presence of a diskette in the diskette drive.
Follow these steps to format a diskette from a command line:
Follow these steps to access files on a formatted diskette:
In the following example, the diskette is not mounted, so the only directory in /floppy is ms-dos_5. After volcheck mounts the diskette, the directory with the name of the diskette is displayed. The diskette in this example contains only a lost+found directory.
oak% cd/floppy oak% ls ms-dos_5 oak% volcheck oak% ls ms-dos_5 unnamed_floppy oak% cd unnamed_floppy oak% ls lost+found oak% cp /home/winsor/Appx/appxA.doc . oak% ls appxA.doc lost+found oak%
You cannot unmount a file system when that file system is in use by any process. If you get the message Device busy, a process may have its current working directory on the diskette, or some process has opened a file on the diskette. Use the fuser command to find out what processes are using the diskette. See the fuser(1M) manual page for information.
Use the following steps to eject the diskette:
If you are running File Manager, you can use it to format a diskette, display the contents, and copy files to and from the diskette. Follow these steps to format a diskette, display its contents, and eject it:
Figure A-2 Choose Check for Floppy from the File menu.
Figure A-3 The File Manager floppy format.
When the diskette is formatted and contains the file system, the File Manager Floppy window displays the contents of the diskette, as shown in Figure A-4.
Figure A-4 The File Manager Floppy window.
NOTE: You can drag and drop files to and from the Floppy window in the same way that you manipulate other files using the File Manager.
To eject the diskette, click SELECT on the Eject Disk button. After a few seconds, the diskette is ejected and the File Manager Floppy window is dismissed.
If you are running CDE, you can use the Folders menu on the front panel to display the contents of a floppy. Follow these steps to open a floppy from the front panel:
Figure A-5 The Front Panel Folders menu.
Figure A-6 The CDE File Manager floppy window.
If you are running CDE File Manager, you can use it to format a diskette, display the contents, and copy files to and from the diskette. Follow these steps to open a diskette from the CDE File Manager:
Figure A-7 The CDE File Manager menu.
If a diskette contains tar or cpio files instead of a file system, volume management does not mount it. You cannot access files on the diskette from the old /dev/rdiskette device name because volume management provides access to the file system (if present), not to the device.
You can access tar and cpio files on a diskette using the symbolic link to the character cdevice for the media that is in floppy drive 0, as in the following:
/vol/dev/aliases/floppy0
Use the following steps to copy a file to a formatted diskette using the tar command:
Use the following steps to copy all tar files from a diskette:
Alternatively, with Solaris 2.2 (and later) systems, you can access tar or cpio files using the following device name syntax:
/vol/dev/rfd0/media-name
The most common media-name is unlabeled.
With Solaris 2.3, the device name syntax is changed. You access tar or cpio files using the following device name syntax:
/vol/dev/rdiskette0/media-name
The most frequent media-name for media without a file system is unlabeled.
For example, to copy a tar file to a diskette, type tar cvf/vol/dev/rdiskette0/unlabeled filename and press Return. To retrieve all tar files from a diskette, type tar xvf /vol/dev/rdiskette0/unlabeled and press Return.
From time to time, you may encounter problems with mounting diskettes (or, less frequently, a CD-ROM). If you encounter a problem, first check to find out if volume management knows about the diskette. The best way to check is to look in /vol/dev/rdiskette0 to see if something is there. If the files are not mounted, you may have forgotten to run the volcheck command, or you may have a hardware problem. If references to /vol hang, the /usr/sbin/vold daemon has probably died, and you should restart it.
cIf you find a name in /vol/dev/rdiskette0 and nothing is mounted in /floppy/media-name, it is likely that the data on the media is not a recognized file system. It may be a tar, cpio, or Macintosh file system. You can access these media through the block or character devices found in /vol/dev/rdiskette0 or /vol/dev/diskette0 and use your own tools to interpret the data on them.
Many people use the workman program to play music from their CD-ROM drive. Workman is not a Sun product, but it is in wide use. To use workman with volume management, add the line shown in bold to the /etc/rmmount.conf file. Be sure the line comes before the action_filemgr line.
# @(#)rmmount.conf 1.2 92/Ø9/23 SMI # # Removable Media Mounter configuration file. # # File system identification ident hsfs ident_hsfs.so cdrom ident ufs ident_ufs.so cdrom floppy ident pcfs ident_pcfs.so floppy # Actions action cdrom action_workman.so pathname action cdrom action_filemgr.so action floppy action_filemgr.so
The pathname is the name of the path where users access the workman program--for example, /usr/apps/pkgs/exe/workman.
When you have made this change, audio CD-ROMs are automatically detected and the workman program is started when the CD-ROM is inserted into the CD-ROM drive.
NOTE: When you set up workman in the way described in this chapter, users should not try to start workman from the application because volume management may become confused. In addition, with Solaris 2.2 (and later) volume management, if you are using workman, you must eject the CD-ROM from the workman application. If you eject the CD-ROM from another window, workman hangs. This problem has been fixed in Solaris 2.3 system software.
With Solaris 2.2, you cannot automatically export CD-ROM and diskette drives or use the /etc/vfstab file. You must use the share command to export the file system after every reboot.
NOTE: You cannot share a pcfs file system (MS-DOS formatted diskettes) with Solaris 2.2 system software.
With Solaris 2.3 system software, a share cdrom* instruction is provided in the /etc/rmmount.conf file so that a CD-ROM is automatically shared when you insert it into the CD-ROM drive. You can specify flags in the same way as you do for the share command. You can also use the name of a particular piece of media, if desired. Refer to the rmmount.conf manual page for more details.
With Solaris 2.3, the device names for the physical device were changed to be consistent with /dev. In Solaris 2.2 system software, the device names are /vol/dev/rfd0 and /vol/dev/fd0. With Solaris 2.3 system software, the device names are /vol/dev/rdiskette0 and /vol/dev/diskette0. The symbolic link in /vol/dev/aliases always points to the correct device.
You may want to disable volume management for some users. To do so, use the following steps:
You can disable part of volume management and leave other parts functional. You may, for example, want to automatically mount CD-ROMs, but use the Solaris 2.0 method for accessing files on a diskette. You can do so by commenting out the lines for diskettes in the /etc/vold.conf file, as shown:
# @(#)vold.conf 1.21 96/05/10 SMI # # Volume Daemon Configuration file # # Database to use (must be first) db db_mem.so # Labels supported label dos label_dos.so floppy rmscsi pcmem label cdrom label_cdrom.so cdrom label sun label_sun.so floppy rmscsi pcmem # Devices to use use cdrom drive /dev/rdsk/c*s2 dev_cdrom.so cdrom%d # use floppy drive /dev/rdiskette[0-9] dev_floppy.so floppy%d use pcmem drive /dev/rdsk/c*s2 dev_pcmem.so pcmem%d forceload=true # use rmscsi drive /dev/rdsk/c*s2 dev_rmscsi.so rmscsi%d # Actions insert dev/diskette[0-9]/* user=root /usr/sbin/rmmount insert dev/dsk/* user=root /usr/sbin/rmmount eject dev/diskette[0-9]/* user=root /usr/sbin/rmmount eject dev/dsk/* user=root /usr/sbin/rmmount notify rdsk/* group=tty user=root /usr/lib/vold/volmissing -p # List of file system types unsafe to eject unsafe ufs hsfs pcfs
Table of Contents |