This chapter provides general guidelines for managing removable media in the Solaris OS.
This is a list of the overview information in this chapter.
The following section describes new removable media features in the Solaris release.
For a complete listing of new Solaris features and a description of Solaris releases, see Solaris Express Developer Edition What’s New.
Solaris Express 12/06: Previous features for managing removable media have been removed and replaced with services and methods that provide better removable media management.
For information about using vold in previous Solaris 10 releases, see System Administration Guide: Devices and File Systems.
The following new features are available:
New removable media services are enabled and disabled by using SMF.
online 12:17:54 svc:/system/hal:default online 12:17:56 svc:/system/filesystem/rmvolmgr:default online 12:17:26 svc:/system/dbus:default |
Removable media is now mounted automatically in the /media directory. However, symbolic links to /media are provided from previous media mount points, /cdrom and /rmdisk, for compatibility purposes.
For example, a compact flash memory card (/dev/dsk/c4d0p0:1) is mounted as follows:
$ ls /media/NIKON |
For example, a USB memory stick (/dev/dsk/c3t0d0s0) is mounted as follows:
$ ls /media/U3 |
For example, a diskette (/dev/diskette0) is mounted as follows:
$ ls /media/floppy |
The default removable media volume manager, rmvolmgr, is responsible for following activities:
Mounting and unmounting volumes.
The root instance of rmvolmgr starts at system boot. However, you can configure your session's configuration files to start an instance of rmvolmgr when you log in. When run within a user session, rmvolmgr only mounts devices owned by the current user or session and does not conflict with the root instance.
When rmvolmgr exits, it unmounts all media that it mounted.
For compatibility purposes, rmvolmgr creates symbolic links under the /cdrom, /floppy, /rmdisk directories to the actual mount points under /media.
A special rmvolmgr run mode is available for CDE compatibility.
The hardware abstraction layer (HAL) daemon, hald, provides a view of the device attached to a system. This view is updated automatically as hardware configuration changes, by hotplugging or other mechanisms.
HAL represents a piece of hardware as a device object. A device object is identified by a unique device identifier (UDI) and carries a set of key-value pairs referred to as device properties. Some properties are derived from the actual hardware, some are merged from device information files (.fdi files) and some are related to the actual device configuration.
The following features are removed:
The vold daemon, the volfs file system, and the volfs service have been removed.
svc:/system/filesystem/volfs |
Logical device names for removable media under the /vol directory, such as /vol/dev/rdsk/... or /vol/dev/aliases/..., are no longer provided.
To access removable media by its logical device name, the /dev device should be used. For example:
/dev/rdsk/c0t6d0s2 |
Some vold device nicknames are no longer available. The following eject -l output identified the available device nicknames for each device and in this example, the mounted media pathname (/media/SOL_11_X86_4):
$ eject -l /dev/dsk/c2t0d0s2 cdrom,cdrom0,cd,cd0,sr,sr0,SOL_11_X86_4,/media/SOL_11_X86_4 /dev/diskette floppy,floppy0,fd,fd0,diskette,diskette0,rdiskette,rdiskette0 |
The comma-separated list shows the nicknames that can be used to eject each device.
Customizations that were made in vold.conf and rmmount.conf are no longer available because these configuration files no longer exist. For information about managing media customizations, see Customizing Removable Media Management.
Commands that begin with vol* commands except for volcheck and volrmmount.
The following features provide backward compatibility with previous Solaris removable media features:
Removable media mount points have moved to the /media directory, which is used to mount removable media, such as CD-ROMs and USB devices. Symbolic links to /media from previous media mounts points, such as /cdrom and /rmdisk, are provided for compatibility purposes.
The rmformat command is still available. The output of this command is identical to what it looks in previous Solaris releases with vold disabled.
For example:
# rmformat Looking for devices... 1. Logical Node: /dev/rdsk/c0t6d0s2 Physical Node: /pci@1f,4000/scsi@3/sd@6,0 Connected Device: TOSHIBA DVD-ROM SD-M1401 1009 Device Type: DVD Reader Bus: SCSI Size: 2.9 GB Label: <None> Access permissions: <Unknown> |
The eject command is available but has been enhanced. For more information, see Ejecting Removable Media.
Most commands that begin with vol* are removed in this release. A modified version of rmmount and a new rmumount command are available to mount and unmount removable media.
These commands can be used to mount by device name, label, or mount point. For example, to mount an iPod:
% rmmount ipod |
For example, to unmount the file systems on a DVD:
# rmumount cdrom cdrom /dev/dsk/c0t6d0s5 unmounted cdrom /dev/dsk/c0t6d0s0 unmounted |
For more information, see rmmount(1M).
You can use the existing volcheck command to manually poll diskettes and mount them if a new diskette is detected.
If you manually reformat diskette after it is connected to the system, HAL is not automatically notified. Continue to use the volcheck command to notify the system and attempt to automount a new file system on a diskette.
As in previous Solaris releases, use the eject command to unmount and eject removable media. However, the following eject options are available:
Forces the device to eject even if the device is busy.
Displays paths and nicknames of devices that can be ejected.
A CD-ROM tray close command is provided to the device. Not all devices support this option.
For example, to eject by its volume label:
% eject mypictures |
As in previous Solaris releases, you might need to issue the volcheck command before using the eject command to eject a diskette.
For more information, see eject(1).
For most customizations that were available in the vold.conf and rmmount.conf files, you will need to either use Desktop Volume manager preferences or modify the .fdi files.
For rmmount.conf actions, you will need to use either Desktop Volume Manager actions, gconf, or HAL callouts.
Previously, rmmount.conf actions could be run as root on behalf of ordinary users. Now, this is done by installing callout executables in the /usr/lib/hal directory.
You can disable some or all removable media features in this release:
To prevent volumes from mounting outside of user sessions, disable the rmvolmgr service. For example:
# svcadm disable rmvolmgr |
To prevent any volume management, disable the dbus, hal, and rmvolmgr services.
# svcadm disable rmvolmgr # svcadm disable dbus # svcadm disable hal |
Starting in the Solaris Express 12/06 release, vold is removed. For information about managing removable media with vold in Solaris 10 releases, see System Administration Guide: Devices and File Systems.
Solaris Express 11/05: The volume management daemon, vold, is now managed by the Service Management Facility (SMF). This means you can use the svcadm disable command to disable the following new volfs service, if appropriate:
# svcadm disable volfs |
You can identify the status of the volfs service by using this command:
$ svcs volfs STATE STIME FMRI online Sep_29 svc:/system/filesystem/volfs:default |
For more information, see smf(5).
You can use the svccfg command to display and to set additional vold properties. For example, you could temporarily enable vold logging to help troubleshooting a problem. For example:
# svccfg svc:> select system/filesystem/volfs svc:/system/filesystem/volfs> setprop vold/log_debuglevel=3 svc:/system/filesystem/volfs> exit # svcadm disable volfs # svcadm enable volfs |
You can also use the svccfg command to display a listing of settable vold properties.
# svccfg svc:> select volfs svc:/system/filesystem/volfs> listprop vold/* vold/config_file astring vold/log_debuglevel count 3 vold/log_file astring vold/log_nfs_trace boolean false vold/log_verbose boolean false vold/root_dir astring vold/never_writeback_label boolean false svc:/system/filesystem/volfs> exit |
Starting in the Solaris Express 12/06 release, vold is removed. For information about managing removable media with vold in Solaris 10 releases, see System Administration Guide: Devices and File Systems.
Solaris Express 11/05: Removable media management is improved. Previously, vold did not create device links for removable devices that contain no media. Now, device links are properly created for devices that contain no media, similar to the following:
lrwxrwxrwx 1 root root 28 Jun 13 13:09 /vol/dev/aliases/cdrom0 -> /vol/dev/rdsk/c2t2d0/nomedia |
Now, you can use the cdrw and rmformat commands to list devices that have no media when vold is running.
You can revert back to the previous vold behavior by changing the following support nomedia entry in the /etc/vold.conf file as follows:
support media |
Then, restart vold.
In addition, vold is now hot-plug aware. This improvement means that if you insert removable media, the media is automatically detected and mounted by vold. There should be no need to restart vold manually to recognize and mount a file system from any removable media device.
If you are using a legacy or non-USB diskette device, then you might need to issue the volcheck command before vold can recognize the media.
If the media is detected, but for some reason, is unmounted, then you'll need to run the following commands:
# volrmmount -i rmdisk0 |
Before you hot-remove a removable media device, eject the media first. For example:
# eject rmdisk0 |
Use these references to find step-by-step instructions for managing removable media.
Removable Media Management Task |
For More Information |
---|---|
Access removable media | |
Format removable media | |
Write data CDs and DVDs and music CDs |
The Solaris release gives users and software developers a standard interface for dealing with removable media. Removable media services provide the following benefits:
Automatically mounts removable media. For a comparison of manual and automatic mounting, see the following section.
Enables you to access removable media without having to become superuser.
Allows you to give other systems on the network automatic access to any removable media on your local system. For more information, see Chapter 3, Accessing Removable Media (Tasks).
The following table compares the steps involved in manual mounting (without removable media services) and automatic mounting (with removable media management) of removable media.
Table 1–1 Comparison of Manual and Automatic Mounting of Removable Media
Steps |
Manual Mounting |
Automatic Mounting |
---|---|---|
1 |
Insert media. |
Insert media. |
2 |
Become superuser. |
For diskettes, use the volcheck command. |
3 |
Determine the location of the media device. |
Removable media services automatically perform many of the tasks that are required to manually mount and work with removable media. |
4 |
Create a mount point. |
|
5 |
Make sure you are not in the mount point directory. |
|
6 |
Mount the device and use the proper mount options. |
|
7 |
Exit the superuser account. |
|
8 |
Work with files on media. |
Work with files on media. |
9 |
Become superuser. |
|
10 |
Unmount the media device. |
|
11 |
Eject media. |
Eject media. |
12 |
Exit the superuser account. |
Essentially, removable media services enable you to access removable media just as manual mounting does, but more easily and without the need for superuser access.
If the media contains a file system and a label, the media label name is used to name the /media/pathname mount point. If a label is not present, the disk model name is used to name the media, such as /media/cdrom. A generic nickname is used only for legacy symbolic links. For example, /rmdisk/rmdisk0.
If your system has more than one type of removable device, see the following table for their access points.
Table 1–2 How to Access Data on Removable Media
Access |
Insert |
Unlabeled Media Pathnames |
Labeled Media Pathname Examples |
---|---|---|---|
Files on a diskette |
The diskette and type volcheck on the command line |
/media/floppy |
/media/FD-05PUB |
Files on a removable hard disk |
The removable hard disk and type volcheck on the command line |
/media/usb-disk or the legacy path /rmdisk/rmdisk0 |
/media/00JB-00CRA0 |
Files on a CD |
The CD and wait for a few seconds |
/media/cdrom |
/media/sol_9_sparc |
Files on a DVD |
The DVD and wait for a few seconds |
/media/cdrom |
/media/SOL_11_X86 |
You can use the rmmount -l command to identify mounted media on your system. For example:
# rmmount -l /dev/dsk/c5t0d0p0 rmdisk6,/media/FD-05PUB /dev/dsk/c4t0d3p0 rmdisk5,/media/223UHS-SD-MMC /dev/dsk/c2t0d0s2 cdrom1,cd1,sr1,SOL_11_X86,/media/SOL_11_X86 /dev/dsk/c3t0d0p0 rmdisk2,/media/00JB-00CRA0 |
In the above output, the mounted devices are as follows:
USB floppy
CF card in a USB card reader
DVD-ROM
Removable USB disk