Table of Contents


APPENDIX A
Volume Management

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:

  Automatically mounting diskettes and CDs simplifies their use.
  Users can access diskettes and CDs without having to become superuser.
  Users on the network can gain automatic access to diskettes and CDs mounted on remote systems.

Without volume management, you mount devices manually by following these steps:

1.  Insert media.
2.  Become superuser.
3.  Determine the location of the media device.
4.  Create a mount point.
5.  Make sure that you are not in the mount point directory.
6.  Mount the device using the proper mount options.
7.  Exit the superuser account.
8.  Work with files on media.
9.  Become superuser.
10.  Unmount the media device.
11.  Eject media.
12.  Exit the superuser account.

With volume management, you mount devices automatically by following these steps:

1.  Insert media.
2.  For diskettes, use the volcheck command.
3.  Work with files on media.
4.  Eject media.

Volume Management Files

Volume management consists of the following elements:

  The /usr/sbin/vold volume management daemon
  The /etc/vold.conf configuration file that is used by the vold daemon to determine which devices to manage
  The /etc/rmmount.conf file that is used to configure removable media mounts as well as actions in /usr/lib/rmmount
  The volume daemon logs messages in the /var/adm/vold.log file.

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.

Table A-1 Device Control Syntax Descriptions

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 Mount Points

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:

  From the command line, type volcheck and press Return.
  From the CDE front panel, click the Folders menu and then click Open Floppy.
  From the CDE File Manager File menu, choose Open Floppy.
  From the OpenWindows File Manager File menu, choose Check for Floppy.

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.

Table A-2 Volume Management Mount Points

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.

Table A-3 Solaris 2.3 CD-ROM and Diskette Device Locations When No File System Is Present

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

Local and Remote CD-ROMs

The following sections describe how to access files from local and remote CD-ROM drives.

Mounting a Local CD-ROM

Use the following procedure to mount a CD-ROM from a local drive:

1.  Insert the CD-ROM in the CD-ROM drive. The CD-ROM is automatically mounted on the /cdrom mount point. If File Manager is running, a window displays the contents of the CD-ROM, as shown in Figure A-1.


Figure A-1  The File Manager CD-ROM window.

2.  To access files on the CD-ROM from a command line, type cd /cdrom/cdrom0 and press Return.
3.  Type ls-L and press Return. The list of files in the /cdrom/cdrom0 directory is displayed. Use the -L option because some of the files on the CD may be symbolic links.


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.

Sharing Files from a Remote CD-ROM Drive

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:

1.  Become superuser.
2.  Type /etc/rc3.d/S15nfs.server stop and press Return. NFS services are stopped.
3.  Type /etc/rc3.d/S15nfs.server start and press Return. NFS services are restarted and the CD files are exported.
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:

1.  Insert the CD-ROM into the caddy and insert the caddy into the drive. The CD-ROM is mounted.
2.  Become superuser on the Solaris 2.2 (or later) system with the CD-ROM drive attached.
3.  Type share -F nfs -o ro /cdrom/cdrom0 and press Return.
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.

How to Mount Shared CD-ROM Files

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:

1.  Become superuser on the local system.
2.  Type mount remote-system-name:/cdrom/cdrom0 /mount-point and press Return. The files from the remote system directory /cdrom/cdrom0 are mounted on the /mount-point directory. The cdrom0 subdirectory is symbolically linked to the actual name of the CD-ROM, which is assigned by the application vendor.

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
#

How to Unmount Shared CD-ROM Files

When you are through using the CD-ROM files, use the following steps to unmount the remote CD-ROM:

1.  On the local system, become superuser.
2.  Type cd and press Return.
3.  Type umount /mount-point and press Return. The files from the remote system directory /cdrom/cdrom0 are unmounted.

Diskettes and Volume Management

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.

Command-Line Access

Follow these steps to format a diskette from a command line:

1.  Insert a diskette into the diskette drive.
2.  Type volcheck and press Return. The system has access to the unformatted diskette.
3.  Type fdformat and press Return to format a ufs file system or fdformat-d to format an MS-DOS file system.
4.  When prompted, press Return to begin formatting the diskette.
5.  For ufs file systems, you must also make a new file system on the diskette.
6.  Become superuser.
7.  Type newfs /vol/dev/rdiskette0/unnamed_floppy and press Return.

Follow these steps to access files on a formatted diskette:

1.  Insert a formatted diskette in the diskette drive.
2.  Type volcheck and press Return. If there is a formatted diskette in the drive, volume management mounts it on the /floppy mount point. If no diskette is in the drive, no error message is displayed. The volcheck command redisplays the prompt. Once the diskette is mounted on the /floppy mount point, you can access files on it either from the command line or from the File Manager Floppy window, which is described in the section "OpenWindows File Manager Access."
3.  Type cd /floppy and press Return.
4.  Type ls and press Return. The name of the diskette is displayed as the name of a directory.
5.  Type cd diskette-name and press Return.
6.  Type ls and press Return. The names of the files on the diskette are displayed. You can copy files to and from the diskette using the cp command.

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:

1.  Type cd and press Return. You have changed out of the /floppy directory.
2.  Type eject and press Return. After a few seconds, the diskette is ejected from the drive.

OpenWindows File Manager Access

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:

1.  Insert the diskette into the diskette drive.
2.  Choose Check for Floppy from the File menu, as shown in Figure A-2.


Figure A-2  Choose Check for Floppy from the File menu.

3.  If the diskette is not formatted, a window is displayed, as shown in Figure A-3. Click SELECT on the Cancel & Eject button if you want to eject the diskette without formatting it.


Figure A-3  The File Manager floppy format.

4.  Click SELECT on the format you want to use and then click Format Disk. The diskette is formatted, and a new file system is created.

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.

CDE Front Panel Access

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:

1.  Insert a formatted or unformatted diskette into the diskette drive.
2.  From the front panel, open the Folders menu, shown in Figure A-5, and click Open Floppy.


Figure A-5  The Front Panel Folders menu.

3.  After the light on the CDE front panel stops flashing (about five to ten seconds), the floppy is mounted to /floppy and a File Manager window opens. Figure A-6 shows an example of the File Manager floppy window for a formatted floppy.


Figure A-6  The CDE File Manager floppy window.

CDE File Manager Access

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:

1.  Insert a formatted or unformatted diskette into the diskette drive.
2.  From the File Manager File menu, shown in Figure A-7, choose Open Floppy. After the Ilight on the CDE front panel stops flashing (about five to ten seconds), the floppy is mounted to /floppy and a File Manager window opens.


Figure A-7  The CDE File Manager menu.

3.  From the File Manager File menu note that you can also format, rename, and eject the diskette by clicking the respective options.

Using the tar and cpio Commands with Diskettes

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:

1.  Insert a formatted diskette into the diskette drive.
2.  Type volcheck and press Return.
3.  Type tar cvf /vol/dev/aliases/floppy0 filename and press Return. The files are copied to the diskette.
4.  Type eject and press Return. After a few seconds, the diskette is ejected.

Use the following steps to copy all tar files from a diskette:

1.  Insert a formatted diskette into the diskette drive.
2.  Change to the directory where you want to put the files.
3.  Type volcheck and press Return. The diskette is mounted.
4.  Type tar xvf /vol/dev/aliases/floppy0 and press Return. The files are copied to the diskette.
5.  Type eject and press Return. After a few seconds, the diskette is ejected.

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.

Troubleshooting

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.

Using Workman with Volume Management

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.

Changes with 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.

Disabling Volume Management

You may want to disable volume management for some users. To do so, use the following steps:

1.  Become superuser.
2.  Remove or rename the /etc/rc2.d/S92volmgt script.
3.  Type /etc/init.d/volmgt stop and press Return.

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