The Removable Storage Management (RSM) utility helps
you manage any portable media for your machine. Microsoft provides this
utility so you can manage resources for applications that don't support
the Removable Storage API through scripts or batch files. Early versions
of the RSM utility relied on a simple command line and didn't provide
much functionality. The following sections reflect the modes supported
by newer versions of the utility.
NOTE
Like many
utilities, the command line for RSM is case insensitive when you type
actual arguments. However, this utility differs in that the media
objects, which include media, drives, changers, libraries, media types,
and slots, are case sensitive. If you have a drive named MyDrive and
want to refer to it by its friendly name, then you must observe the
actual case of the name when typing the command. In addition, unlike
many utilities, you must type the arguments for a command line switch
directly after the switch. For example, /MMyPool will work, but /M MyPool won't because it has a space between the command line switch and the argument.
Windows operating
systems, Vista and above, do provide support for the RSM utility.
However, you won't find it in the same location as previous versions of
Windows. Depending on your system configuration, you'll likely find this
utility in the \Windows\winsxs\x86_microsoft-windows-r..emanagement-service_31bf3856ad364e35_6.0.5744.16384_none_21ccd2c119fdb6d5 folder of your hard drive. In addition, you might see complaints about a missing NTMSAPI.DLL file that you'll find in the \Windows\winsxs\x86_microsoft-windows-r..management-apilayer_ 31bf3856ad364e35_6.0.5744.16384_none_cb8fdf31cbc6c1a7
folder. Theoretically, Microsoft will eventually work out all of these
issues. In the meantime, you may have to spend some time getting the RSM
utility to work. All you need to do is create a new folder and place
all of the files from both directories into it to make RSM work under
Server Core. Make sure you have full rights to the new folder or the
copy process will fail.
1. ALLOCATE
Use the ALLOCATE mode to allocate existing media for a specific use. This mode uses the following syntax:
RSM ALLOCATE /M<MediaPoolName> [/L[G|F]<LogicalMediaID> |
/P[G|F]<PartitionID>] /O[{ERRUNAVAIL | NEW | NEXT}] [/T{<timeout> |
INFINITE}] [/LN<LogicalMediaName>] [/LD<LogicalMediaDescription>]
[/PN<PartitionName>] [/PD<PartitionDescription>] [/B]
The following list describes each of the command line arguments.
/M
MediaPoolNameSpecifies the name of the media pool to use for the allocation.
/LG
LogicalMediaIdentifierDefines the logical media identifier as a GUID.
/LF
LogicalMediaIdentifierDefines the logical media identifier as a friendly name.
/PG
PartitionIDDefines the partition identifier as a GUID.
/PF
PartitionIDDefines the partition identifier as a friendly name.
/O[{ERRUNAVAIL | NEW | NEXT}]
Defines
the removable storage allocation options. You may use more than one
command line switch to define multiple options, but each option must
appear as a separate command line switch. The ERRUNAVAIL
option specifies that the utility submit a request for new media to the
operator when the allocation fails due to a lack of media. The NEW
option allocates media in such a way that another application can't use
the media. You can use this option to reserve the second side of
two-sided media for exclusive use of a single application. Once you set
the media aside, you must actually allocate it with the NEXT option. The NEXT option allocates the next partition of media previously allocated using the NEW option.
/T{timeout | INFINITE}
Specifies the
timeout value for a drive in milliseconds. The timeout value determines
how long the utility waits for the media allocation to succeed. The
default setting is INFINITE.
/LN
LogicalMediaNameDefines the friendly name that the utility assigns to the LogicalMedia object of the allocated media.
/PN
PartitionNameDefines the friendly name that the utility assigns to the Partition object of the allocated media.
/LD
LogicalMediaDescriptionDefines the description that the utility assigns to the LogicalMedia object of the allocated media.
/LD
PartitionDescriptionDefines the description that the utility assigns to the Partition object of the allocated media.
/B
Specifies the bare
option that you can use with scripts. The utility displays only the
GUIDs of the allocated media. You can redirect this output to another
utility to perform additional media processing.
2. DEALLOCATE
Use the DEALLOCATE mode to deallocate previously allocated media. This mode uses the following syntax:
RSM DEALLOCATE /L[G|F]<LogicalMediaID> | /P[G|F]<PartitionID>
The following list describes each of the command line arguments.
/LG
LogicalMediaIDDefines the logical media to deallocate as a GUID.
/LF
LogicalMediaIDDefines the logical media to deallocate as a friendly name.
/PG
PartitionIDDefines the partition to deallocate as a GUID.
/PF
PartitionIDDefines the partition to deallocate as a friendly name.
3. MOUNT
Use the MOUNT mode to make removable media available for use. This mode uses the following syntax:
RSM MOUNT /L[G|F]<LogicalMediaID> /O[{ERRUNAVAIL | READ | WRITE |
OFFLINE}] [/R[{NORMAL | HIGH | LOW | HIGHEST | LOWEST}]
[/T{timeout | INFINITE}]
RSM MOUNT /P[G|F]<PartitionID> /O[{ERRUNAVAIL | READ | WRITE |
OFFLINE}] [/R[{NORMAL | HIGH | LOW | HIGHEST | LOWEST}]
[/T{timeout | INFINITE}]
RSM MOUNT /S[G|F]<SlotID> /O[{ERRUNAVAIL | READ | WRITE | OFFLINE}]
[/R[{NORMAL | HIGH | LOW | HIGHEST | LOWEST}] [/T{timeout | INFINITE}]
RSM MOUNT /C[G|F]<ChangerID /O[{ERRUNAVAIL | READ | WRITE | OFFLINE}]
[/R[{NORMAL | HIGH | LOW | HIGHEST | LOWEST}] [/T{timeout | INFINITE}]
RSM MOUNT /D[G|F]<DriveID> /O[{ERRUNAVAIL | DRIVE | READ | WRITE | OFFLINE}]
[/R[{NORMAL | HIGH | LOW | HIGHEST | LOWEST}] [/T{timeout | INFINITE}]
The following list describes each of the command line arguments.
/LG
LogicalMediaIDDefines the logical media to mount as a GUID.
/LF
LogicalMediaIDDefines the logical media to mount as a friendly name.
/PG
PartitionIDDefines the partition to mount as a GUID.
/PF
PartitionIDDefines the partition to mount as a friendly name.
/SG
SlotIDDefines the slot identifier to mount as a GUID.
/SF
SlotIDDefines the slot identifier to mount as a friendly name.
/CG
ChangerIDDefines the changer identifier to mount as a GUID.
/CF
ChangerIDDefines the changer identifier to mount as a friendly name.
/DG
DriveIDDefines the drive identifier to mount as a GUID.
/DF
DriveIDDefines the drive identifier to mount as a friendly name.
/O[{ERRUNAVAIL | DRIVE | READ | WRITE | OFFLINE}]
Defines the
removable storage allocation options. You may use more than one command
line switch to define multiple options, but each option must appear as a
separate command line switch. The ERRUNAVAIL
option tells the utility to generate an error if either the media or
the drive isn't available. The error normally notifies an operator of
the need to fix the drive. The READ option mounts the drive for read access. The WRITE
option mounts the drive for write access. This option fails when you
try to mount media that's marked as completed (non-writeable). The DRIVE option is required when you use the /DG or /DF options. The OFFLINE option tells the utility to generate an error if the media isn't online.
/T{timeout | INFINITE}
Specifies the
timeout value for a drive in milliseconds. The timeout value determines
how long the utility waits for the media allocation to succeed. The
default setting is INFINITE.
[/R[{NORMAL | HIGH | LOW | HIGHEST | LOWEST}]
Specifies the mount priority of the media. The system mounts higher priority media first. The default priority is NORMAL.