<chapter id="medintro-55492"><title>Managing Removable Media (Overview)</title><highlights><para>This chapter provides general guidelines for managing removable media
in the Solaris OS.</para><para>This is a list of the overview information in this chapter.</para><itemizedlist><listitem><para><olink targetptr="gbbfr" remap="internal">What's New in Removable Media?</olink></para>
</listitem><listitem><para><olink targetptr="medintro-4" remap="internal">Where to Find Managing Removable
Media Tasks</olink></para>
</listitem><listitem><para><olink targetptr="medintro-61235" remap="internal">Removable Media Features
and Benefits</olink></para>
</listitem><listitem><para><olink targetptr="medintro-79377" remap="internal">Comparison of Manual and
Automatic Mounting</olink></para>
</listitem><listitem><para><olink targetptr="medintro-10775" remap="internal">Overview of Accessing Removable
Media</olink></para>
</listitem>
</itemizedlist>
</highlights><sect1 id="gbbfr"><title>What's New in Removable Media?</title><para>The following section describes new removable media features in the
Solaris release.</para><itemizedlist><listitem><para><olink targetptr="gbppr" remap="internal">Changes and
Improvements to Removable Media Management</olink></para>
</listitem><listitem><para><olink targetptr="gbppq" remap="internal">vold is Managed by the Service Management
Facility (SMF)</olink></para>
</listitem><listitem><para><olink targetptr="gbbfu" remap="internal">Improvements to Volume Management
(vold)</olink></para>
</listitem>
</itemizedlist><para>For a complete listing of new Solaris features and a description of
Solaris releases, see <olink targetdoc="solwhatsnew" remap="external"><citetitle remap="book">Solaris Express Developer Edition What&rsquo;s New</citetitle></olink>.</para><sect2 id="gbppr"><title>Changes
and Improvements to Removable Media Management</title><para><emphasis role="strong">Solaris Express 12/06</emphasis>: Previous features
for managing removable media have been removed and replaced with services
and methods that provide better removable media management.</para><para>For information about using <command>vold</command> in previous Solaris
10 releases, see <olink targetdoc="817-5093" remap="external"><citetitle remap="book">System Administration Guide: Devices and File Systems</citetitle></olink>.</para><para>The following new features are available:</para><itemizedlist><listitem><para>New removable media services are enabled and disabled by using
SMF.</para><screen>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</screen>
</listitem><listitem><para>Removable media is now mounted automatically in the <filename>/media</filename> directory. However, symbolic links to <filename>/media</filename> are
provided from previous media mount points, <filename>/cdrom</filename> and <filename>/rmdisk</filename>, for compatibility purposes.</para><para>For example, a compact flash memory
card (<filename>/dev/dsk/c4d0p0:1</filename>) is mounted as follows:</para><screen>$ ls /media/NIKON</screen><para>For example, a USB memory stick (<filename>/dev/dsk/c3t0d0s0</filename>)
is mounted as follows:</para><screen>$ ls /media/U3</screen><para>For example, a diskette (<filename>/dev/diskette0</filename>) is mounted
as follows:</para><screen>$ ls /media/floppy</screen>
</listitem><listitem><para>The default removable media volume manager, <command>rmvolmgr</command>,
is responsible for following activities:</para><itemizedlist><listitem><para>Mounting and unmounting volumes.</para>
</listitem><listitem><para>The root instance of <command>rmvolmgr</command> starts at
system boot. However, you can configure your session's configuration files
to start an instance of <command>rmvolmgr</command> when you log in. When
run within a user session, <command>rmvolmgr</command> only mounts devices
owned by the current user or session and does not conflict with the root instance.</para>
</listitem><listitem><para>When <command>rmvolmgr</command> exits, it unmounts all media
that it mounted.</para>
</listitem><listitem><para>For compatibility purposes, <command>rmvolmgr</command> creates
symbolic links under the <filename>/cdrom</filename>, <filename>/floppy</filename>, <filename>/rmdisk</filename> directories to the actual mount points under <filename>/media</filename>.</para>
</listitem><listitem><para>A special <command>rmvolmgr</command> run mode is available
for CDE compatibility.</para>
</listitem>
</itemizedlist>
</listitem><listitem><para>The hardware abstraction layer (HAL) daemon, <command>hald</command>,
provides a view of the device attached to a system. This view is updated automatically
as hardware configuration changes, by hotplugging or other mechanisms.</para><para>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 (<literal>.fdi</literal> files) and some are related to the actual device
configuration.</para>
</listitem>
</itemizedlist><para>The following features are removed:</para><itemizedlist><listitem><para>The <command>vold</command> daemon, the <literal>volfs</literal> file
system, and the <command>volfs</command> service have been removed.</para><screen>svc:/system/filesystem/volfs</screen>
</listitem><listitem><para>Logical device names for removable media under the <filename>/vol</filename> directory, such as <filename>/vol/dev/rdsk/...</filename> or <filename>/vol/dev/aliases/...</filename>, are no longer provided.</para><para>To access
removable media by its logical device name, the <filename>/dev</filename> device
should be used. For example:</para><screen>/dev/rdsk/c0t6d0s2</screen>
</listitem><listitem><para>Some <command>vold</command> device nicknames are no longer
available. The following <command>eject</command> <option>l</option> output
identified the available device nicknames for each device and in this example,
the mounted media pathname (<filename>/media/SOL_11_X86_4</filename>):</para><screen>$ 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</screen><para>The comma-separated list shows the nicknames that can be used to eject
each device.</para>
</listitem><listitem><para>Customizations that were made in <filename>vold.conf</filename> and <filename>rmmount.conf</filename> are no longer available because these configuration
files no longer exist. For information about managing media customizations,
see <olink targetptr="gepzn" remap="internal">Customizing Removable Media Management</olink>.</para>
</listitem><listitem><para>Commands that begin with <filename>vol</filename>* commands
except for <command>volcheck</command> and <command>volrmmount</command>.</para>
</listitem>
</itemizedlist><sect3 id="gepzr"><title>Backward Compatibility</title><para>The following features provide backward compatibility with previous
Solaris removable media features:</para><itemizedlist><listitem><para>Removable media mount points have moved to the <filename>/media</filename> directory,
which is used to mount removable media, such as CD-ROMs and USB devices. Symbolic
links to <filename>/media</filename> from previous media mounts points, such
as <filename>/cdrom</filename> and <filename>/rmdisk</filename>, are provided
for compatibility purposes.</para>
</listitem><listitem><para>The <command>rmformat</command> command is still available.
The output of this command is identical to what it looks in previous Solaris
releases with <command>vold</command> disabled.</para><para>For example:</para><screen># 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: &lt;None>
        Access permissions: &lt;Unknown></screen>
</listitem><listitem><para>The <command>eject</command> command is available but has
been enhanced. For more information, see <olink targetptr="gepzj" remap="internal">Ejecting
Removable Media</olink>.</para>
</listitem>
</itemizedlist>
</sect3><sect3 id="gepzk"><title>Mounting and Unmounting Removable Media</title><para>Most commands that begin with <filename>vol</filename>* are removed
in this release. A modified version of <command>rmmount</command> and a new <command>rmumount</command> command are available to mount and unmount removable media.</para><para>These commands can be used to mount by device name, label, or mount
point. For example, to mount an iPod:</para><screen>% <userinput>rmmount ipod</userinput></screen><para>For example, to unmount the file systems on a DVD:</para><screen># <userinput>rmumount cdrom</userinput>
cdrom /dev/dsk/c0t6d0s5 unmounted
cdrom /dev/dsk/c0t6d0s0 unmounted</screen><para>For more information, see <olink targetdoc="refman1m" targetptr="rmmount-1m" remap="external"><citerefentry><refentrytitle>rmmount</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink>.</para><sect4 id="gepzw"><title>Mounting and Unmounting Diskettes</title><para>You can use the existing <command>volcheck</command> command to manually
poll diskettes and mount them if a new diskette is detected.</para><para>If you manually reformat diskette after it is connected to the system,
HAL is not automatically notified. Continue to use the <command>volcheck</command> command
to notify the system and attempt to automount a new file system on a diskette.</para>
</sect4>
</sect3><sect3 id="gepzj"><title>Ejecting Removable Media</title><para>As in previous Solaris releases, use the <command>eject</command> command
to unmount and eject removable media. However, the following <command>eject</command> options
are available:</para><variablelist><varlistentry><term><option>f</option></term><listitem><para>Forces the device to eject even if the device is busy.</para>
</listitem>
</varlistentry><varlistentry><term><option>l</option></term><listitem><para>Displays paths and nicknames of devices that can be ejected.</para>
</listitem>
</varlistentry><varlistentry><term><option>t</option></term><listitem><para>A CD-ROM tray close command is provided to the device. Not
all devices support this option.</para>
</listitem>
</varlistentry>
</variablelist><para>For example, to eject by its volume label:</para><screen>% <userinput>eject mypictures</userinput></screen><para>As in previous Solaris releases, you might need to issue the <command>volcheck</command> command before using the <command>eject</command> command to eject
a diskette.</para><para>For more information, see <olink targetdoc="refman1" targetptr="eject-1" remap="external"><citerefentry><refentrytitle>eject</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink>.</para>
</sect3><sect3 id="gepzn"><title>Customizing Removable Media Management</title><para>For most customizations that were available in the <filename>vold.conf</filename> and <filename>rmmount.conf</filename> files, you will need to either use Desktop Volume
manager preferences or modify the <filename>.fdi</filename> files.</para><itemizedlist><listitem><para>For <filename>rmmount.conf</filename> actions, you will need
to use either Desktop Volume Manager actions, gconf, or HAL callouts.</para>
</listitem><listitem><para>Previously, <filename>rmmount.conf</filename> <literal>actions</literal> could
be run as root on behalf of ordinary users. Now, this is done by installing
callout executables in the <filename>/usr/lib/hal</filename> directory.</para>
</listitem>
</itemizedlist>
</sect3><sect3 id="gepzs"><title>Disabling Removable Media Features</title><para>You can disable some or all removable media features in this release:</para><itemizedlist><listitem><para>To prevent volumes from mounting outside of user sessions,
disable the <command>rmvolmgr</command> service. For example:</para><screen># svcadm disable rmvolmgr</screen>
</listitem><listitem><para>To prevent any volume management, disable the <command>dbus</command>, <command>hal</command>, and <command>rmvolmgr</command> services.</para><screen># svcadm disable rmvolmgr
# svcadm disable dbus
# svcadm disable hal</screen>
</listitem>
</itemizedlist>
</sect3>
</sect2><sect2 id="gbppq"><title><command>vold</command> is Managed by the Service
Management Facility (SMF)</title><note><para>Starting in the Solaris
Express 12/06 release, <command>vold</command> is removed. For information
about managing removable media with <command>vold</command> in Solaris 10
releases, see <olink targetdoc="817-5093" remap="external"><citetitle remap="book">System Administration Guide: Devices and File Systems</citetitle></olink>.</para>
</note><para><emphasis role="strong">Solaris Express 11/05:</emphasis> The volume management daemon, <command>vold</command>, is now managed by the Service Management Facility (SMF). This
 means you can use the <command>svcadm disable</command> command to disable
the following new volfs service, if appropriate:</para><screen># <userinput>svcadm disable volfs</userinput></screen><para>You can identify the status of the <literal>volfs</literal> service
by using this command:</para><screen>$ <userinput>svcs volfs</userinput>
STATE          STIME    FMRI
online         Sep_29   svc:/system/filesystem/volfs:default</screen><para>For more information, see <olink targetdoc="refman5" targetptr="smf-5" remap="external"><citerefentry><refentrytitle>smf</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink>.</para><para>You can use the <command>svccfg</command> command to display and to
set additional <command>vold</command> properties. For example, you could
temporarily enable <command>vold</command> logging to help troubleshooting
a problem. For example:</para><screen># <userinput>svccfg</userinput>
svc:> <userinput>select system/filesystem/volfs</userinput>
svc:/system/filesystem/volfs> <userinput>setprop vold/log_debuglevel=3</userinput>
svc:/system/filesystem/volfs> <userinput>exit</userinput>
# <userinput>svcadm disable volfs</userinput>
# <userinput>svcadm enable volfs</userinput></screen><para>You can also use the <command>svccfg</command> command to display a
listing of settable <command>vold</command> properties.</para><screen># <userinput>svccfg</userinput>
svc:> <userinput>select volfs</userinput>
svc:/system/filesystem/volfs> <userinput>listprop vold/*</userinput>
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> <userinput>exit</userinput></screen>
</sect2><sect2 id="gbbfu"><title>Improvements to Volume Management (<command>vold</command>)</title><note><para>Starting in the Solaris Express 12/06 release, <command>vold</command> is removed. For information about managing removable media
with <command>vold</command> in Solaris 10 releases, see <olink targetdoc="817-5093" remap="external"><citetitle remap="book">System Administration Guide: Devices and File Systems</citetitle></olink>.</para>
</note><para><emphasis role="strong">Solaris Express 11/05:</emphasis> Removable media management
is improved. Previously, <command>vold</command> 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:</para><screen>lrwxrwxrwx   1 root     root     28 Jun 13 13:09 /vol/dev/aliases/cdrom0 ->
 /vol/dev/rdsk/c2t2d0/nomedia</screen><para>Now, you can use the <command>cdrw</command> and <command>rmformat</command> commands
to list devices that have no media when <command>vold</command> is running.</para><para>You can revert back to the previous <command>vold</command> behavior
by changing the following <literal>support nomedia</literal> entry in the <filename>/etc/vold.conf</filename> file as follows:</para><screen>support media</screen><para>Then, restart <command>vold</command>. </para><para>In addition, <command>vold</command> is now hot-plug aware. This improvement
means that if you insert removable media, the media is automatically detected
and mounted by <command>vold</command>.  There should be no need to restart <command>vold</command> manually to recognize and mount a file system from any removable
media device.</para><para>If you are using a legacy or non-USB diskette device, then you might
need to issue the <command>volcheck</command> command before <command>vold</command> can
recognize the media.</para><para>If the media is detected, but for some reason, is unmounted, then you'll
need to run the following commands:</para><screen># volrmmount -i rmdisk0</screen><para>Before you hot-remove a removable media device, eject the media first.
For example:</para><screen># eject rmdisk0</screen>
</sect2>
</sect1><sect1 id="medintro-4"><title>Where to Find Managing Removable Media Tasks</title><para>Use these references to find step-by-step instructions for managing
removable media.</para><informaltable frame="topbot"><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="colspec0" colwidth="50*"/><colspec colname="colspec1" colwidth="50*"/><thead><row rowsep="1"><entry><para>Removable Media Management Task</para>
</entry><entry><para>For More Information</para>
</entry>
</row>
</thead><tbody><row><entry><para>Access removable media</para>
</entry><entry><para><olink targetptr="medaccess-29267" remap="internal">Chapter&nbsp;3, Accessing Removable
Media (Tasks)</olink></para>
</entry>
</row><row><entry><para>Format removable media</para>
</entry><entry><para><olink targetptr="medformat-83002" remap="internal">Chapter&nbsp;2, Managing Removable
Media (Tasks)</olink></para>
</entry>
</row><row><entry><para>Write data CDs and DVDs and music CDs</para>
</entry><entry><para><olink targetptr="medcdrw-1" remap="internal">Chapter&nbsp;4, Writing CDs and DVDs (Tasks)</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="medintro-61235"><title>Removable Media Features and Benefits</title><para>The Solaris release gives users and software developers a standard interface
for dealing with removable media. Removable media services provide the following
benefits:</para><itemizedlist><listitem><para>Automatically mounts removable media. For a comparison of
manual and automatic mounting, see the following section.</para>
</listitem><listitem><para>Enables you to access removable media without having to become
superuser.</para>
</listitem><listitem><para>Allows you to give other systems on the network automatic
access to any removable media on your local system. For more information,
see <olink targetptr="medaccess-29267" remap="internal">Chapter&nbsp;3, Accessing Removable
Media (Tasks)</olink>.</para>
</listitem>
</itemizedlist>
</sect1><sect1 id="medintro-79377"><title>Comparison of Manual and Automatic Mounting</title><para>The following table compares the steps involved in manual mounting (without
removable media services) and automatic mounting (with removable media management)
of removable media. </para><table frame="all" id="medintro-tbl-4"><title>Comparison of Manual and Automatic
Mounting of Removable Media</title><tgroup cols="3" colsep="1" rowsep="1"><colspec colwidth="52*"/><colspec colwidth="173*"/><colspec colwidth="171*"/><thead><row><entry><para>Steps</para>
</entry><entry><para>Manual Mounting</para>
</entry><entry><para>Automatic Mounting</para>
</entry>
</row>
</thead><tbody><row><entry><para>1</para>
</entry><entry><para>Insert media.</para>
</entry><entry><para>Insert media.</para>
</entry>
</row><row><entry><para>2</para>
</entry><entry><para>Become superuser.</para>
</entry><entry><para>For diskettes, use the <command>volcheck</command> command.</para>
</entry>
</row><row><entry><para>3</para>
</entry><entry><para>Determine the location of the media device.</para>
</entry><entry><para>Removable media services automatically perform many of the tasks that
are required to manually mount and work with removable media.</para>
</entry>
</row><row><entry><para>4</para>
</entry><entry><para>Create a mount point.</para>
</entry><entry><para></para>
</entry>
</row><row><entry><para>5</para>
</entry><entry><para>Make sure you are not in the mount point directory.</para>
</entry><entry><para></para>
</entry>
</row><row><entry><para>6</para>
</entry><entry><para>Mount the device and use the proper <command>mount</command> options.</para>
</entry><entry><para></para>
</entry>
</row><row><entry><para>7</para>
</entry><entry><para>Exit the superuser account.</para>
</entry><entry><para></para>
</entry>
</row><row><entry><para>8</para>
</entry><entry><para>Work with files on media.</para>
</entry><entry><para>Work with files on media.</para>
</entry>
</row><row><entry><para>9</para>
</entry><entry><para>Become superuser.</para>
</entry><entry><para></para>
</entry>
</row><row><entry><para>10</para>
</entry><entry><para>Unmount the media device.</para>
</entry><entry><para></para>
</entry>
</row><row><entry><para>11</para>
</entry><entry><para>Eject media.</para>
</entry><entry><para>Eject media.</para>
</entry>
</row><row><entry><para>12</para>
</entry><entry><para>Exit the superuser account.</para>
</entry><entry>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect1><sect1 id="medintro-10775"><title>Overview of Accessing Removable
Media</title><para>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. </para><para>If the media contains a file system and a label, the media label name is used
to name the <replaceable>/media/pathname</replaceable> mount point. If a label
is not present, the disk model name is used to name the media, such as <filename>/media/cdrom</filename>. A generic <replaceable>nickname</replaceable> is
used only for legacy symbolic links. For example, <filename>/rmdisk/rmdisk0</filename>.</para><para>If your system has more than one type of removable device, see the following
table for their access points.</para><table frame="topbot" id="medintro-tbl-1"><title>How
to Access Data on Removable Media</title><tgroup cols="4" colsep="0" rowsep="0"><colspec colname="colspec0" colwidth="85.36*"/><colspec colname="colspec1" colwidth="106.98*"/><colspec colname="colspec2" colwidth="165.66*"/><colspec colname="colspec3" colwidth="165.66*"/><thead><row rowsep="1"><entry><para>Access</para>
</entry><entry><para>Insert</para>
</entry><entry><para>Unlabeled Media Pathnames</para>
</entry><entry><para>Labeled Media Pathname Examples</para>
</entry>
</row>
</thead><tbody><row><entry><para>Files on a diskette</para>
</entry><entry><para>The diskette and type <command>volcheck</command> on the command line</para>
</entry><entry><para><filename>/media/floppy</filename></para>
</entry><entry><para><filename>/media/FD-05PUB</filename></para>
</entry>
</row><row><entry><para>Files on a removable hard disk</para>
</entry><entry><para>The removable hard disk and type <command>volcheck</command> on the
command line</para>
</entry><entry><para><filename>/media/</filename><replaceable>usb-disk</replaceable> or the
legacy path <filename>/rmdisk/rmdisk0</filename></para>
</entry><entry><para><filename>/media/00JB-00CRA0</filename></para>
</entry>
</row><row><entry><para>Files on a CD</para>
</entry><entry><para>The CD and wait for a few seconds</para>
</entry><entry><para><filename>/media/cdrom</filename></para>
</entry><entry><para><filename>/media/sol_9_sparc</filename></para>
</entry>
</row><row><entry><para>Files on a DVD</para>
</entry><entry><para>The DVD and wait for a few seconds</para>
</entry><entry><para><filename>/media/cdrom</filename></para>
</entry><entry><para><filename>/media/SOL_11_X86</filename></para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>You can use the <command>rmmount</command> <option>l</option> command
to identify mounted media on your system. For example:</para><screen># 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</screen><para>In
the above output, the mounted devices are as follows:</para><variablelist><varlistentry><term><filename>/dev/dsk/c5t0d0p0</filename></term><listitem><para>USB floppy</para>
</listitem>
</varlistentry><varlistentry><term><filename>/dev/dsk/c4t0d3p0</filename></term><listitem><para>CF card in a USB card reader</para>
</listitem>
</varlistentry><varlistentry><term><filename>/dev/dsk/c2t0d0s2</filename></term><listitem><para>DVD-ROM</para>
</listitem>
</varlistentry><varlistentry><term><filename>/dev/dsk/c3t0d0p0</filename></term><listitem><para>Removable USB disk</para>
</listitem>
</varlistentry>
</variablelist>
</sect1>
</chapter>