[ Team LiB ] Previous Section Next Section

Volume Management

Starting with the Solaris 2.2 system software, volume management automates mounting of CD-ROMs and diskettes; users no longer need to have superuser permissions to mount a CD-ROM or a diskette.

CAUTION. 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/c0t6d0s2 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 and specify these paths, an error message is displayed.


Volume management provides users with a standard interface for dealing with diskettes and CD-ROMs. Volume management 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.

Mounting devices manually requires the following steps.

  1. Insert medium.

  2. Become superuser.

  3. Determine the location of the medium device.

  4. Create a mount point.

  5. Make sure the current working directory is in the mount point directory.

  6. Mount the device using the proper mount options.

  7. Exit the superuser account.

  8. Work with files on the medium.

  9. Become superuser.

  10. Unmount the medium device.

  11. Eject medium.

  12. Exit the superuser account.

Using volume management requires the following steps.

  1. Insert medium.

  2. For diskettes, use the volcheck command.

  3. Work with files on the medium.

  4. Eject medium.

Volume Management Files

Volume management consists of the /usr/sbin/vold volume management daemon, the /etc/vold.conf configuration file used by the vold daemon to determine which devices to manage, the /etc/rmmount.conf file used to configure removable media mounts, and 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.

graphics/new.gif

# ident "@(#)vold.conf         1.26    00/07/17 SMI"
#
# Volume Daemon Configuration file
#

# Database to use (must be first)
db db_mem.so

# Labels supported
label cdrom label_cdrom.so cdrom
label dos label_dos.so floppy rmdisk pcmem
label sun label_sun.so floppy rmdisk 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 rmdisk drive /dev/rdsk/c*s2 dev_rmdisk.so rmdisk%d

# Actions
eject dev/diskette[0-9]/* user=root /usr/sbin/rmmount
eject dev/dsk/* user=root /usr/sbin/rmmount
insert dev/diskette[0-9]/* user=root /usr/sbin/rmmount
insert dev/dsk/* user=root /usr/sbin/rmmount
notify rdsk/* group=tty user=root /usr/lib/vold/volmissing -p
remount dev/diskette[0-9]/* user=root /usr/sbin/rmmount
remount dev/dsk/* user=root /usr/sbin/rmmount

# List of file system types unsafe to eject
unsafe ufs hsfs pcfs udfs

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).

The syntax for a Devices to use entry is shown below.


use device type special shared-object symname options

Volume management does not automatically mount DVD devices.

Table 66 describes each of the fields for the Devices to use syntax.

Table 66. Device Control Syntax Descriptions

Field

Supported Default Values

Description

device

cdrom, floppy

The removable medium device.

type

drive

The type of device—multiple or single media support.

special

/dev/rdsk/c0t6

/dev/rdiskette

Path name of the device to be used in the /dev directory.

shared-object

/usr/lib/vold/ sharedobject-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 shown below.

graphics/new.gif

# ident     "@(#)rmmount.conf     1.12     00/08/29 SMI"
#
# Removable Media Mounter configuration file.
#

# File system identification
ident udfs ident_udfs.so cdrom floppy rmdisk
ident hsfs ident_hsfs.so cdrom
ident ufs ident_ufs.so cdrom floppy rmdisk pcmem
ident pcfs ident_pcfs.so floppy rmdisk pcmem

# Actions
action cdrom action_filemgr.so
action floppy action_filemgr.so
action rmdisk action_filemgr.so

# Mount
mount * hsfs udfs ufs -o nosuid

The files in the /usr/lib/vold directory are listed below.

graphics/new.gif
graphics/new.gif

castle% ls -1 /usr/lib/vold
db_mem.so.1
db_nis.so.1
dev_cdrom.so.1
dev_cdtest.so.1
dev_floppy.so.1
dev_pcmem.so.1
dev_rmdisk.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 below.

graphics/new.gif

oak% ls -1 /usr/lib/rmmount
action dvdvideo.so.1
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 is shown below.


oak% more /var/adm/vold.log
Tue Jun  1 17:34:24 1999 warning: dev_use: couldn't find a driver for drive
 cdrom at /dev/dsk/c0t6
Tue Jun  1 17:39:12 1999 warning: dev_use: couldn't find a driver for drive
 cdrom at /dev/dsk/c0t6
Tue Jun  1 18:24:24 1999 warning: dev_use: couldn't find a driver for drive
 cdrom at /dev/dsk/c0t6
Wed Jun 23 15:08:47 1999 warning: check device 36.2: device not managed
Wed Jun 23 15:09:58 1999 warning: check device 36.2: device not managed
Wed Jun 23 15:11:08 1999 warning: check device 36.2: device not managed
Thu Jul 15 13:51:23 1999 warning: check device 36.2: device not managed
Thu Jul 15 13:52:53 1999 warning: check device 36.2: device not managed
Thu Jul 15 14:04:37 1999 warning: check device 36.2: device not managed
Thu Jul 15 14:05:52 1999 warning: check device 36.2: device not managed
Thu Jul 15 14:06:16 1999 warning: check device 36.2: device not managed
Wed Jul 21 16:33:33 1999 fatal: svc_tli_create: Cannot create server handle
Thu Jul 22 16:32:28 1999 warning: cdrom: /dev/rdsk/c0t6d0s2; Device busy
castle%

If you want to display debugging messages from the volume management daemon, you can start the daemon by typing /usr/sbin/vold -v -L 10. With these flags set, the volume management 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 with /usr/sbin/rmmount in them to include the -D flag, as shown in the following example.


insert dev/diskette[0-9]/* user=root /usr/sbin/rmmount -D



Volume Management Mount Points

graphics/new.gif

Volume management automatically mounts CD-ROM and DVD-ROM file systems on the /cdrom mount point when you insert the media into the drive.

graphics/new.gif

Volume management automatically mounts Jaz and Zip file systems on /rmdisk/jaz or /rmdisk/zip mount points.

When you insert a diskette in the diskette drive, you must ask the system to check the diskette drive. You can check for a diskette in any one of the following ways.

  • From the command line, type volcheck and press Return.

  • From the CDE front panel, click on the Folders menu and then click on 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 of these methods, the files are mounted on the /floppy mount point. Table 67 describes the mount points and how volume management uses them.

Table 67. Volume Management Mount Points

Medium/Mount Point

State of Medium

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 broken up into more than one partition, each of which has a file system written on it. The file system on the mentioned partition is currently mounted.

/cdrom/unnamed_cdrom

Mounted unnamed CD-ROM.

graphics/new.gif Jaz and Zip Disks

/rmdisk/zip and /rmdisk/zip0

Mounted Zip disk.

/rmdisk/jaz and /rmdisk/jaz0

Mounted Jaz disk.

If the medium does not contain a file system, volume management provides block and character devices in the /vol file system, as shown in Table 68.

Table 68. CD-ROM and Diskette Device Locations When No File System Is Present

Medium/Device Location

State of Medium

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 device access.

CD-ROM

/vol/dev/dsk/c0t6d0/unnamed_cdrom

CD-ROM—block device access.

/vol/dev/rdsk/c0t6d0/unnamed_cdrom

CD-ROM—raw device access.

Limitation on UFS Formats with Volume Management for CDs

UFS formats are not portable between architectures, so you must use them on the architecture for which they were formatted. For example, a UFS CD formatted for a SPARC platform cannot be recognized by an IA platform. Likewise, an IA UFS CD cannot be mounted by volume management on a SPARC platform. The same limitation applies to diskettes.

Most CDs are formatted according to the ISO 9660 standard (High Sierra File System—HSFS), which imposes no limitations on volume management.

CD-ROMs and Volume Management

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. Push the button on the front of the CD-ROM drive to open the tray.

  2. Place the CD-ROM into the tray so that the CD label is visible.

    Volume management creates a subdirectory on the /cdrom mount point, using the label written on the CD-ROM, or creates an unlabeled subdirectory if the CD-ROM doesn't have a label. Then volume management mounts the file system on the CD on that subdirectory. If File Manager is running, a window displays the contents of the CD-ROM, as shown in Figure 5.

    Figure 5. The CDE File Manager CD-ROM Window

    graphics/08fig04.gif

  3. To access files on the CD-ROM from a command line, type cd /cdrom/cdrom0 and press Return.

  4. 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.

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 choosing Eject from the File menu in the File Manager CD-ROM window.

Sharing Local Media Drives with NFS

graphics/new.gif

You can configure a system to share its media drives to make any medium in those drives available to other systems. Once the media drives are shared, other systems can access the medium they contain simply by mounting them.

Use the following steps to make available local media devices.

  1. Become superuser.

  2. Type ps -ef | grep nfsd and press Return.

    Review the output to determine whether the NFS daemon (nfsd) is running. If nfsd is running, skip to Step 7.

  3. Type mkdir / dummy-dir and press Return.

    You have created a dummy directory for nfsd to share. You can use any directory name. This directory will not contain any files. Its sole purpose is to wake up the NFS daemon so that it notices the shared media drive.

  4. Add the following entry to the /etc/dfs/dfstab file.

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

    When you start the NFS daemon, it sees this entry, wakes up, and notices the shared media drive. The -d comment is optional.

  5. Type /etc/init.d/nfs.server start and press Return.

    NFS services are restarted.

  6. Type ps -ef | grep nfsd and press Return.

    Review the output to verify that the NFS daemon (nfsd) is running.

  7. Type eject medium and press Return.

    You have ejected any medium currently in the drive.

  8. Type chmod 644 /etc/rmmount.conf and press Return.

    You have assigned root write permissions to the /etc/rmmount.conf file.

  9. Add the following lines to the /etc/rmmount.conf file.

    
    
    # File System Sharing
    share media*
    
    
    

    These lines share any medium 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).

  10. Type chmod 444 /etc/rmmount.conf and press Return.

    You have removed write permissions from the /etc/rmmount.conf file and returned the file to its default permissions.

  11. Load the medium.

    Any medium loaded into this system's drive is available to other systems. Remember to wait until the light on the drive stops blinking before you verify this task.

  12. Type share and press Return.

    Review the output and verify that the medium is shared.

The following example makes a local CD available to other systems on the network when the nfsd daemon is not running.


# ps -ef | grep nfsd
#
# mkdir /dummy
# vi /etc/dfs/dfstab
(Add the following line:).

share -F nfs -o ro /dummy
# eject /cdrom/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
# /etc/init.d/nfs.server start
# ps -ef | grep nfsd
    root   577     1  0 10:51:55 ?      0:00 /usr/lib/nfs/nfsd
# share
-               /dummy ro ""
#

The following example uses the ps command to verify that the mountd daemon is not already running, and if you are superuser, it runs the S15nfs.server script to stop NFS services and restart them.


oak% ps -ef | grep mountd
    root  4571  4473  5 12:53:51 pts/3   0:00 grep mountd
oak% su
Password:
# /etc/rc3.d/S15nfs.server stop
# /etc/rc3.d/S15nfs.server start
#


How to Access an NFS-Shared CD-ROM File System

You can use the /mnt directory as the mount point for the CD-ROM files, or you can create another directory.

NOTE. Do not use the /cdrom mount point to mount NFS file systems. Volume management may interfere with accessing files on the volume management /cdrom mount point.


When the CD-ROM is in the remote drive and the files are shared by NFS, use the following steps to access the shared files on a local system.

  1. On the local system, become superuser.

  2. All on one line, type mount -F nfs -o ro nfs-server:/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 that has a name assigned by the application vendor.

The following example mounts the files from the remote system castle on the /mnt mount point.


oak% su
Password:
# mount -F nfs -o ro castle:/cdrom/cdrom0 /mnt
# cd /mnt
# ls
SUNWssser  SUNWsssra  SUNWsssrb  SUNWsssrc  SUNWsssrd  SUNWssstr
#


How to Unmount an NFS-Shared CD-ROM File System

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

  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.

How to Find Out If an NFS-Mounted CD-ROM File System Is Still in Use

If a Device busy error message is displayed when you try to unmount a CD-ROM, you can use the fuser command to find out who is currently accessing the CD.

  1. Become superuser.

  2. Type fuser -u /cdrom/cdrom0 and press Return.

    The process ID and user name of those currently accessing the CD are displayed.

  3. Type fuser -u -k /cdrom/cdrom0 and press Return.

    The processes accessing the CD are killed.

  4. Type eject cdrom and press Return, or choose Eject from the File menu in the CD File Manager window.

In the following example, user winsor is accessing the CD.


paperbark% eject cdrom
/vol/dev/rdsk/c0t6d0/s8ap_doc: Device busy
paperbark% su
Password:
# fuser -u /cdrom/cdrom0
/cdrom/cdrom0:      467c(winsor)
# fuser -u -k /cdrom/cdrom0
# eject cdrom
# exit
paperbark%





Diskettes and Volume Management

When you insert a diskette into the diskette drive, to prevent excessive reads, volume management does not mount the diskette automatically. Excessive reads can quickly wear out the diskette drive. You must use the volcheck command that checks for the presence of a diskette in the diskette drive.

Limitation on UFS Formats with Volume Management for Diskettes

UFS formats are not portable between architectures, so you must use them on the architecture for which they were formatted. For example, a UFS diskette formatted for a SPARC platform cannot be recognized by an IA platform. Likewise, an IA UFS diskette cannot be mounted by volume management on a SPARC platform. The same limitation applies to CDs.

UFS incompatibility can occur more often with diskettes than with CDs because formats often can be established by the user. Be aware that if you format a UFS diskette on one architecture, you won't be able to use it on a different architecture.

Command-Line Diskette Formatting (rmformat)
graphics/new.gif

The rmformat command, introduced in the Solaris 8 release, was buggy. The bugs in rmformat are fixed in the Solaris 9 release, and rmformat is preferred command for formatting removable media.

Use the following steps to format a diskette from a command line with the rmformat command.

NOTE. If the diskette does not have a file system written on it, the volcheck command accesses the device. However, if the diskette already has a file system on it, you cannot use the volcheck command to mount the file system on the diskette. rmformat requires an unmounted diskette for formatting.


  1. Insert a diskette into the diskette drive.

  2. Type rmformat -F quick floppy0 and press Return to format and partition the diskette.

    Use fdformat -d to format an MS-DOS file system. rmformat does not provide an MS-DOS formatting option.

  3. When prompted, type y and press Return to begin formatting the diskette.

    When formatting is complete, the prompt is redisplayed. The rmformat command automatically creates a new file system on the diskette.

The following example formats a diskette on a system running volume management.


mopoke% rmformat -F quick floppy0
Formatting will erase all the data on the disk.
Do you want to continue? (y/n) y
mopoke%



Command-Line Diskette Formatting (fdformat)

graphics/new.gif

NOTE. Starting with the Solaris 8 release, fdformat has been superseded by the rmformat(1) command, which provides most fdformat functionality.


Use the following steps to format a diskette from a command line with the fdformat command.

  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 the diskette so that you can later write a UFS file system on it, or fdformat -d to format a diskette and immediately write an MS-DOS file system to it.

  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. To do so, become superuser and type newfs /vol/dev/rdiskette0/unnamed_floppy, and press Return.

Use the following 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 a subdirectory of the /floppy mount point. If no diskette is in the drive, no error message is displayed. The volcheck command redisplays the prompt. When the diskette is mounted on the /floppy subdirectory mount point, you can access files on it either from the command line or from the File Manager Floppy window, described in "CDE File Manager Access" on page 281.

  3. Type cd /floppy and press Return.

  4. Type ls and press Return.

    The name of the diskette is displayed.

  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 with 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%



Determining If a Diskette Is Still in Use

You cannot unmount a file system whose current working directory is in use. If you get the message Device busy, a process has its current working directory on the diskette. You can use the fuser command to find out who is currently accessing the diskette.

  1. Become superuser.

  2. Type fuser -u /floppy/floppy0 and press Return.

    The process ID and user name of those currently accessing the diskette are displayed.

  3. Type fuser -u -k /floppy/floppy0 and press Return.

    The processes accessing the diskette are killed.

  4. Type eject floppy0 and press Return.

NOTE. On a SPARC platform, the diskette is physically ejected from its drive. On an IA platform, you have to eject the diskette by hand. If you are running on an IA platform, look for a message on screen that says you can now eject the diskette. If the diskette jams, eject it manually by inserting a straightened paper clip about an inch into the small hole in the front of the drive.


Ejecting a Diskette

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.

Accessing the CDE Front Panel

If you are running CDE, you can use the Folders menu on the front panel to display the contents of a diskette. Use the following steps to open a diskette 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 6, and click on Open Floppy.

    Figure 6. Front Panel Files Menu

    graphics/08fig05.gif

  3. If the diskette is unformatted, the Format Floppy window is displayed, as shown in Figure 7.

    Figure 7. Format Floppy Window

    graphics/08fig06.gif

  4. Choose the format, type a diskette name in the text field if you want to assign one, and click the Format button.

    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. The floppy is mounted to a subdirectory of the /floppy directory and a File Manager window opens.

    If the diskette is already formatted, after the light on the front panel stops flashing (about 5 to 10 seconds), the floppy is mounted to a subdirectory of the /floppy directory and a File Manager window opens. Figure 8 shows an example of the File Manager floppy window for a formatted diskette.

    Figure 8. The CDE File Manager Floppy Window

    graphics/08fig07.jpg

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. Use the following 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 9, choose Open Floppy.

    Figure 9. The CDE File Manager Menu

    graphics/08fig08.jpg

    If the disk is unformatted, the Format Floppy window is displayed. If the disk is formatted, the File Manager window display shows the contents of the diskette.

  3. From the File Manager File menu you can also eject, format, and rename the diskette, as shown by the menu items in Figure 10.

    Figure 10. The CDE File Manager Floppy Menu

    graphics/08fig09.jpg

Using Removable Media Manager to Format Diskettes
graphics/new.gif

You can use the Removable Media Manager graphical user interface to create the following formats and file systems on a diskette.

  • PCFS (DOS).

  • UFS (UNIX).

  • UDFS.

  • NEC DOS.

You can format an unformatted diskette or reformat a formatted diskette.

CAUTION. Reformatting a diskette destroys any existing data on the diskette.


Use the following steps to format a diskette with Removable Media Manager.

  1. Insert the diskette you want to format in the diskette drive.

  2. Choose Open Floppy from the CDE Front Panel Files menu, or, in a Terminal window, type volcheck and press Return.

    The command checks the diskette drive and mounts a formatted diskette if found. If volume management finds an unformatted diskette in the drive, the diskette is not mounted. Instead, it is made visible as a raw device to the Removable Media Manager, as indicated by the (...unformatted) message and a dash (-) instead of the normal number used to indicate which instance of the diskette is mounted.

  3. From the CDE Front Panel Files menu, choose Removable Media Manager.

    The Removable Media Manager window opens and displays any mounted media on the system. In the example shown in Figure 11, an unformatted diskette is the only available medium.

    Figure 11. Removable Media Manager Window

    graphics/08fig10.gif

  4. Click on the diskette icon.

    The diskette is highlighted to show that you selected it.

  5. From the Selected menu, choose Format.

    The Media Format window is displayed, as shown in Figure 12.

    Figure 12. Removable Media Manager Media Format Window

    graphics/08fig11.gif

  6. Choose the file system type from the File System Type menu.

  7. (Optional) Type a label in the Volume Label field if you want to assign a name to the device.

  8. Click on the Format button.

    The diskette icon is removed from the Removable Media Manager window, and the Format button in the Format window is dimmed. No other status information is displayed while the diskette is formatting. When the diskette is formatted, a notice is displayed, as shown in Figure 13.

    Figure 13. Notice of Successful Formatting

    graphics/08fig12.gif

    The icon in the Removable Media Manager window is updated to show the new format and volume name (if assigned), as shown in Figure 14.

    Figure 14. Removable Media Manager Window

    graphics/08fig13.gif

Using the tar and cpio Commands with Diskettes

If a diskette contains a raw tar or cpio datastream, volume management does not mount it. You cannot access files on the diskette from the old /dev/rdiskette device name.

You can access raw tar and cpio datastreams on a diskette by using the symbolic link to the character device for the media that is in floppy drive 0 with the following device name.


/vol/dev/aliases/floppy0

Use the following steps to create a tar archive that contains a single file.

  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 into which you want to put the files.

  3. Type volcheck and press Return.

    Volume manager creates the proper device files under /vol/dev so that you can access the raw device.

  4. Type tar xvf /vol/dev/aliases/floppy0 and press Return.

    The files are extracted from the raw tar datastream on 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 by 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 with 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 put files into a tar archive that is sent as a raw datastream to the raw diskette device, type tar cvf /vol/dev/rdiskette0/unlabeled filename and press Return. To read a raw tar archive datastream from the raw diskette device and extract the files it contains, type tar xvf /vol/dev/rdiskette0/unlabeled and press Return.

Volume Management 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 whether 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 diskette device files don't exist, 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 by typing /etc/init.d/volmgt start and pressing Return.

If you find a name in /vol/dev/rdiskette0 and nothing is mounted in /floppy/ media-name, it is likely that the data on the medium 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.

Volume Management and workman

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 cdrom action_filemgr line.


# ident "@(#)rmmount.conf     1.12         00/08/29 SMI"
#
# Removable Media Mounter configuration file.
#

# File system identification
ident udfs ident_udfs.so cdrom floppy rmdisk
ident hsfs ident_hsfs.so cdrom
ident ufs ident_ufs.so cdrom floppy rmdisk pcmem
ident pcfs ident_pcfs.so floppy rmdisk pcmem

# Actions
action cdrom action_workman.so pathname
action cdrom action_filemgr.so
action floppy action_filemgr.so
action rmdisk action_filemgr.so

# Mount
mount * hsfs udfs ufs -o nosuid

A pathname is the name of the path by which users access the workman program—for example, /usr/dist/exe/workman.

When you have made this change, audio CD-ROMs are automatically detected and the workman program is started when an audio CD-ROM is inserted into the CD-ROM drive.

NOTE. When you set up workman in the way described here, you 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 is fixed in Solaris 2.3 and later system software.


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 below.


# ident     "@(#)vold.conf     1.26    00/07/17 SMI"
#
# Volume Daemon Configuration file
#

# Database to use (must be first)
db db_mem.so

# Labels supported
label cdrom label_cdrom.so cdrom
label dos label_dos.so floppy rmdisk pcmem
label sun label_sun.so floppy rmdisk 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 rmdisk drive /dev/rdsk/c*s2 dev_rmdisk.so rmdisk%d

# Actions
eject dev/diskette[0-9]/* user=root /usr/sbin/rmmount
eject dev/dsk/* user=root /usr/sbin/rmmount
insert dev/diskette[0-9]/* user=root /usr/sbin/rmmount
insert dev/dsk/* user=root /usr/sbin/rmmount
notify rdsk/* group=tty user=root /usr/lib/vold/volmissing -p
remount dev/diskette[0-9]/* user=root /usr/sbin/rmmount
remount dev/dsk/* user=root /usr/sbin/rmmount

# List of file system types unsafe to eject
unsafe ufs hsfs pcfs udfs



    [ Team LiB ] Previous Section Next Section