Share via


Rsm

Updated: April 17, 2012

Applies To: Windows 7, Windows Server 2008 R2

Manages media resources using Removable Storage. Using the rsm command, you can run batch scripts for applications that do not currently support the Removable Storage API.

  • Allocate media from a media pool

  • Create a media pool

  • Deallocate media

  • Delete a media pool

  • Dismount media from a drive

  • Eject media from a library

  • Eject media from an ATAPI changer

  • Erase the contents of a tape

  • Write a free media label on a piece of media and return it to the Free media pool

  • Inventory the media in a specified automated library

  • Mount media in the designated library

  • Refresh a library, physical media, or all devices of a particular media type

  • Change the friendly name or description of an RSM object

  • Display a list of media objects or UI destinations

  • Set the destination for UI messages

Allocate media from a media pool

Syntax

rsm allocate /m <MediaPoolName> /o{errunavail|new|next} [/l{g|f} <LogicalMediaID>|/p{g|f}<PartitionID>] [/ln<LogicalMediaName>] [/ld<LogicalMediaDescription>] [/pn<PartitionName>] [/pd<PartitionDescription>] [/t<Timeout>] [/b]

Parameters

Parameter Description

/m <MediaPoolName>

Media are allocated from the specified media pool. This means that you will have allocated media in that pool.

/o

Permits the use of one of the parameters listed in the following table:

 

Value Description

errunavail

Prevents the submission of an operator request for new media if none can be allocated with the specified constraints.

new

Allocates a partition that cannot be shared with another application. This can be used to reserve the second side of two-sided media.

next

Allocates the next side of media that was previously allocated using the new parameter.

/l

Specifies the media to be allocated, using the logical media ID.

You can use the GUID (with the /lg command-line option), or the friendly name (with the /lf command-line option).

<LogicalMediaID.

Specifies the logical media ID.

/p

Specifies the partition to be allocated, using the partition ID. You can use the GUID (with the /pg command-line option), or the friendly name (with the /pf command-line option). This parameter is optional and remains persistent even after the media is de-allocated.

<PartitionID>

Specifies the partition ID.

/ln

Specifies the friendly name to be assigned to the allocated media’s logical media object.

<LogicalMediaName>

Specifies the logical media name.

/ld

Specifies the description to be assigned to the allocated media’s logical media object.

<LogicalMediaDescription>

Specifies the logical media description.

/pn

Specifies the friendly name to be assigned to the allocated media’s partition object.

<PartitionName>

Specifies the name of the partition.

/pd

Specifies the description to be assigned to the allocated media’s partition object.

<PartitionDescription>

Specifies the description of the partition.

/t

Specifies the command time-out, in milliseconds. The default time-out value is infinite.

<Timeout>

Time-out, in milliseconds.

/b

Only the GUID for the allocate operation is displayed. This aids in scripting where you want to pass the output of one command to the next with minimal parsing.

/?

Displays Help at the command prompt.

Remarks

  • Logical media names and side names can be used in other commands to specify media as the parameter to the /lf or /pf switch, respectively. If logical media names (which are friendly names) are not used with the allocate command, you can use only GUIDs in subsequent commands to specify logical media.

Create a media pool

Syntax

rsm createpool /m <MediaPoolName> /a{existing|always|new} [/t{g|f} <MediaPoolTypeID>] [/d] [/r]

Parameters

Parameter Description

/m <MediaPoolName>

Specifies the name of the media pool to be created.

/a

Permits the use of one of the parameters listed in the following table:

 

Value Description

existing

Opens the existing media pool or returns an error if the media pool specified does not exist.

always

Opens the existing media pool or creates a new media pool if not found.

new

Creates a new media pool or returns an error if the media pool specified already exists.

/tg

Specifies the type of media the media pool will contain, using the GUID. The default type is a media pool that contains other media pools.

<MediaPoolTypeID>

Specifies the media pool type ID.

/tf

Specifies the type of media the media pool will contain, using the friendly name. The default type is a media pool that contains other media pools.

/d

Permits the media pool to automatically draw media from the free media pool. If the /d command-line option is not included, the media pool will not be permitted to draw media from the free media pool.

/r

Permits the media pool to automatically return media to the free media pool. If the /r command-line option is not included, the media pool will not be permitted to return media to the free media pool.

/?

Displays Help at the command prompt.

Deallocate media

Syntax

rsm deallocate /l{g|f}<LogicalMediaID>| /p{g|f}<PartitionID>

Parameters

Parameter Description

/lg

Specifies the logical media to deallocate, using the GUID.

<LogicalMediaID>

Specifies the logical media ID.

/lf

Specifies the logical media to deallocate, using the friendly name.

/pg

Specifies the media side to deallocate, using the GUID.

<PartitionID>

Specifies the partition ID.

/pf

Specifies the media side to deallocate, using the friendly name.

/?

Displays Help at the command prompt.

Remarks

  • You can use the logical media name or the partition name to specify the logical media to deallocate only if one of these names were specified with the allocate command using the /ln or /pn switch respectively. Otherwise, you must specify either the logical media ID (LMID) or the partition ID (PARTID) instead.

Delete a media pool

Syntax

rsm deletepool /m <MediaPoolName>

Parameters

Parameter Description

/m <MediaPoolName>

Specifies the name of the media pool to be deleted.

/?

Displays Help at the command prompt.

Dismount media from a drive

Syntax

rsm dismount {/l{g|f}<LogicalMediaID>| /p{g|f}<PartitionID>} [/o[deferred]]

Parameters

Parameter Description

/lg

Specifies the logical media to dismount, using the GUID.

<LogicalMediaID>

Specifies the logical media ID.

/lf

Specifies the logical media to dismount, using the friendly name.

/pg

Specifies the media side to dismount, using the GUID.

<PartitionID>

Specifies the partition ID.

/pf

Specifies the media side to dismount, using the friendly name.

/o

When used with the optional deferred parameter, this optional command-line option marks the media as dismountable, but the media is kept in the drive. Subsequent mount commands can be completed normally. If not used, the media is dismounted from the drive immediately.

/?

Displays Help at the command prompt.

Remarks

  • The logical media name or the partition name can be used to specify the logical media to dismount only if one of these names were specified with the allocate command using the /ln or /pn switch, respectively. Otherwise, you must specify either the logical media ID (LMID) or the partition ID (PARTID) instead.

Eject media from a library

The media to be ejected can be specified in one of four ways:

  • You can specify the physical media to eject using either the physical-media ID (PMID) or the physical media name.

  • You can eject the media in a specified slot within a specified library.

  • You can eject the media in a specified drive within a specified library.

  • You can eject the media in a standalone drive by specifying either its GUID or friendly name.

Syntax

rsm eject {/p{g|f}<PhysicalMediaID>| /s{g|f}<SlotID>/l{g|f}<ChangerID/LibraryID>|/d{g |f}
<DriveID>/l{g|f}<LibraryID>| /l{g|f}<StandaloneLibraryID>}
 [/o<EjectOperationID>]
 [/a{start|stop|queue}]
 [/b]

Parameters

Parameter Description

/pg

Specifies the physical media to eject, using the GUID.

<PhysicalMediaID>

Specifies the physical media ID.

/pf

Specifies the physical media to eject, using the friendly name.

/sg

Specifies the slot holding the media to eject, using the GUID.

<SlotID>

Specifies the slot ID.

/sf

Specifies the slot holding the media to eject, using the friendly name.

/lg

Specifies the library containing the media to eject (for a standalone drive), or the library containing the slot or drive from which to eject the media (for an automated library), using the GUID. If you are specifying an automated library, this command-line option must be used with the /s or /d command-line option.

<LibraryID>

Specifies the library ID.

/lf

Specifies the library containing the media to eject (for a standalone drive), or the library containing the slot or drive from which to eject the media (for an automated library), using the friendly name. If you are specifying an automated library, this command-line option must be used with the /s or /d command-line option.

/dg

Specifies the drive holding the media to eject, using the GUID.

<DriveID>

Specifies the drive ID.

/df

Specifies the drive holding the media to eject, using the friendly name.

/o

Used to specify the GUID for the particular eject operation. The optional /o command-line option can be used in conjunction with the /a command-line option and the stop parameter to terminate a particular eject operation. This can also be used in conjunction with the /a command-line option and the start parameter to display the GUID of the particular eject operation.

<EjectOperationID>

Specifies the eject operation ID.

/a

Permits the use of one of the parameters listed in the following table:

 

Value Description

start

Default. Starts the eject operation immediately. The media is ejected until a time-out occurs, or unless another eject command is issued with the /a command-line option and the stop parameter. Such eject commands must also specify the eject operation GUID using the /o command-line option.

The <Timeout> parameter is specified in the library object (for all eject operations) for the library. To set this <Timeout> parameter, you must use the Removable Storage API.

Can also be used in conjunction with the /o command-line option to display the GUID of a particular eject operation.

stop

Terminates the eject operation prior to a time-out expiring. The particular eject operation can be determined using the GUID displayed when the start parameter is used with the /a command-line option and the /o command-line option.

queue

Queues the media for later ejection. This can be used for libraries with multi-slot inject/eject (IE) ports.

/b

Displays only the eject operation GUID for scripting purposes.

/?

Displays Help at the command prompt.

Eject media from an ATAPI changer

Syntax

rsm ejectatapi /n<AtapiChangerNumber>

Parameters

Parameter Description

/n

Specifies the changer number.

<AtapiChangerNumber>

The number found at the end of the string for the device name of the changer. For example, \\.\CdChanger0 has 0 as the ATAPI changer number.

/?

Displays Help at the command prompt.

Remarks

  • Before you run this command, manually stop the ntmssvc service.

Erase the contents of a tape

Syntax

rsm erase /p{g|f}<PhysicalMediaID>[/<Timeout>]
 [/r{normal|high|low|highest|lowest}][/b]

Parameters

Parameter Description

/pg

Specifies the tape to erase, using the GUID.

<PhysicalMediaID>

Specifies the physical media ID.

/pf

Specifies the tape to erase, using the friendly name.

/t

Specifies the command time-out, in milliseconds. The default time-out value is infinite.

<Timeout>

Command time-out, in milliseconds

/r

Optionally specifies the priority with which RSM is to perform the mount operation for the purposes of erasing the tape, with normal being the default. Optional priorities are normalhighlowhighestlowest

/b

Hides the text on completion, for scripting purposes.

/?

Displays Help at the command prompt.

Write a free media label on a piece of media and return it to the Free media pool

Syntax

rsm freemedia {/p{g|f}<PhysicalMediaID>|/s{g|f}<SlotID>/l{g|f}<ChangerID/LibraryID> |/d{g|f}<DriveID>/l{g|f}<ChangerID/LibraryID>|/l{g|f}<StandaloneLibraryID>[/b]

Parameters

Parameter Description

/pg

Specifies the physical media to free, using the GUID.

<PhysicalMediaID>

Specifies the physical media ID.

/pf

Specifies the physical media to free, using the friendly name.

/sg

Specifies the slot holding the media to free, using the GUID.

<SlotID>

Specifies the slot ID.

/sf

Specifies the slot holding the media to free, using the friendly name.

/lg

Specifies the library containing the media to free (for a standalone drive), or the library containing the slot or drive from which to free the media (for an automated library), using the GUID. If you are specifying an automated library, this command-line option must be used with the /s or /d command-line option.

<LibraryID>

Specifies the library ID.

/lf

Specifies the library containing the media to free (for a standalone drive), or the library containing the slot or drive from which to free the media (for an automated library), using the friendly name. If you are specifying an automated library, this command-line option must be used with the /s or /d command-line option.

/dg

Specifies the drive holding the media to free, using the GUID.

<DriveID>

Specifies the drive ID.

/df

Specifies the drive holding the media to free, using the friendly name.

/b

Displays only the eject operation GUID for scripting purposes.

/?

Displays Help at the command prompt.

Remarks

You can specify the media to be freed in one of four ways:

  • You can specify the physical media using either the physical media ID (PMID) or the physical media name.

  • You can write a free media label on the media in a specified slot within a specified library.

  • You can write a free media label on the media in a specified drive within a specified library.

  • You can free the media in a standalone drive by specifying its library GUID or friendly name.

Inventory the media in a specified automated library

Syntax

rsm inventory /l{g|f} <LibraryID> /a{full |fast|default|none|stop}

Parameters

Parameter Description

/lf

Specifies the library to inventory, using the friendly name.

<LibraryID>

Specifies the library ID.

/lg

Specifies the library to inventory, using the GUID.

/a

Required. Specifies the type of inventory operation to perform. The following table lists valid inventory operations:

 

Value Description

full

Performs a full on-media inventory of the library. Removable Storage mounts each tape or disk in the library and reads the on-media identifier.

fast

Performs a bar code inventory, if the specified library has a bar code reader installed. If the library has no bar code reader, Removable Storage checks the storage slots and reads the on-media identifier on media in slots that were previously empty.

default

Performs an inventory using the default method specified in the library's Properties dialog box.

none

Performs no inventory.

stop

Stops the current inventory for the specified library, if one is being performed.

/?

Displays Help at the command prompt.

Mount media in the designated library

The logical media to be mounted can be specified using either the logical-media ID (LMID) or the logical media name.

Syntax

rsm mount {/l{g | f}<LogicalMediaID> | /p{g|f}<PartitionID>| [/s{g|f}<SlotID>/c{g|f}<ChangerID>}
 [/d{g|f}<DriveID>]/o{errunavail |drive|read|write|offline}
 [/r{normal|high|low|highest| lowest}][/t<Timeout>]

Parameters

Parameter Description

/pf

Specifies the media side to mount, using the friendly name.

<PartitionID>

/lf

Specifies the logical media to mount, using the friendly name.

<LogicalMediaID>

/pg

Specifies the media side to mount, using the GUID.

/lg

Specifies the logical media to mount, using the GUID.

/cg

Specifies the changer that contains the media to be mounted, using the GUID. This can only be used in conjunction with the /sg command-line option and the slot GUID, or the /sf command-line option and the slot friendly name.

<ChangerID>

/cf

Specifies the changer that contains the media to be mounted, using the friendly name. This can only be used in conjunction with the /sg command-line option and the slot GUID, or the /sf command-line option and the slot friendly name.

/sg

Specifies the media slot that contains the media to be mounted, using the GUID. This can only be used with the /cg command-line option and the changer GUID, or the /cf and the changer friendly name.

<SlotID>

/sf

Specifies the media slot that contains the media to be mounted, using the friendly name. This can only be used with the /cg command-line option and the changer GUID, or the /cf and the changer friendly name.

/dg

Specifies the particular drive on which to mount the applicable media, using the GUID. This parameter is optional, and must be used in conjunction with the /o command-line option and the drive parameter.

<DriveID>

/df

Specifies the particular drive on which to mount the applicable media, using the friendly name. This parameter is optional, and must be used in conjunction with the /o command-line option and the drive parameter.

/o

Permits the use of one of the parameters listed in the following table:

 

Value Description

errunavail

Generates an error if either the media or the drive is unavailable.

drive

Specifies that a particular drive is to be mounted. This parameter is used in conjunction with the /d command-line option.

read

Mounts the media for read access.

write

Mounts the media for write access. If this parameter is used, completed media will not be mounted.

offline

Generates an error if the media is offline.

/r

Optionally specifies the mount order, or priority. Mount priority may also be specified using one of the listed parameters, normal (the default), high, low, highest, or lowest.

/t

Optionally specifies the command time-out, in milliseconds. The default time-out is infinite.

<Timeout>

Command time-out, in milliseconds.

/?

Displays Help at the command prompt.

Remarks

  • When using the mount command, you can specify the media to be mounted using either the /l or the /p command-line option, or a combination of the /s and the /c command-line options.

Refresh a library, physical media, or all devices of a particular media type

This command causes a single poll of the target devices so that the Removable Storage database contains the current state of the device. This command can be useful after media insert or eject operations.

Syntax

rsm refresh {/l{g|f}<LibraryID>| /p{g|f}<PhysicalMediaID>|/tg<MediaTypeID>}

Parameters

Parameter Description

/lg

Specifies the library to refresh, using the GUID.

<LibraryID>

Specifies the library ID.

/lf

Specifies the library to refresh, using the friendly name.

/pg

Specifies the physical media to refresh, using the GUID.

<PhysicalMediaID>

Specifies the physical media ID.

/pf

Specifies the physical media to refresh, using the friendly name.

/tg

Specifies the media type to be refreshed. Only the GUID can be specified. This parameter can be used to refresh all removable media devices by specifying the GUID for the removable media. This GUID can be determined using the view command as follows: rsm view /tmedia_type /guiddisplay.

<MediaTypeID>

Specifies the media type ID.

/?

Displays Help at the command prompt.

Change the friendly name or description of an RSM object

Syntax

rsm rename /t{drive|library|changer|storageslot|iedoor|ieport|physical_media|media_pool|partition|logical_media|media_type|drive_type|librequest|oprequest|computer} {/f | /g}<ObjectID>/n<NewName>
 [/d<NewDescription>][/b]

Parameters

Parameter Description

/t

Indicates the type of RSM object you are specifying with its friendly name or GUID. The types of RSM objects are:

  • drive

  • library

  • changer

  • storageslot

  • iedoor

  • ieport

  • physical_media

  • media_pool

  • partition

  • logical_media

  • media_type

  • drive_type

  • librequest

  • oprequest

  • computer

/f

Specifies the object to be renamed, using its friendly name.

<ObjectID>

Specifies the object ID.

/g

Specifies the object to be renamed, using the GUID.

/n

Specifies the new name for the RSM object.

<NewName>

Specifies the new name.

/d

Specifies the new description for the RSM object.

<NewDescription>

Specifies the new description.

/b

Hides the text on completion, for scripting purposes.

/?

Displays Help at the command prompt.

Display a list of media objects or UI destinations

Syntax

rsm view /t{drive|library|changer|storageslot|iedoor| ieport |physical_media|media_pool|partition|logical_media|media_type|drive_type|librequest|oprequest|computer|ui_destination}
 [/cg<ContainerID>][/u<UIType>][/guiddisplay][ /desc][ /b]

Parameters

Parameter Description

/t

Displays a list of media objects of the specified type. The types of media objects are:

  • drive

  • library

  • changer

  • storageslot

  • iedoor

  • ieport

  • physical_media

  • media_pool

  • partition

  • logical_media

  • media_type

  • drive_type

  • librequest

  • oprequest

  • computer

/cg

Specifies the GUID for the object container. The type of container depends on the object type (parameter) specified with the /t command-line option. If the container ID is not specified, all instances of the applicable object type are displayed.

<ContainerID>

Specifies the object container ID.

/u

When used with the /tui_destination and /cg command-line options, displays the destinations to which UI messages of the specified type are directed. The type can be one of three parameters:

 

Value Description

info

Informational messages

req

Messages that are "requesting" in nature

err

Error messages

<UIType>

Specifies the UI type.

/guiddisplay

Displays both the GUID and the friendly name for objects.

/desc

Displays the objects' description.

/b

Displays only the object GUID for scripting purposes.

/?

Displays Help at the command prompt.

Remarks

  • If the /guiddisplay and the /b command-line options are not used, only the friendly names for objects are displayed.

  • You must use the /cg and /u command-line options when you specify ui_destination as the object type for the /t command-line option. Moreover, the <ContainerID> specified with the /cg command-line option must be a valid library or computer GUID. If /guiddisplay or /desc are specified, they are ignored.

Set the destination for UI messages

Syntax

rsm ui /o<Operation> /t<UIType> /{l|c}{f|g}<ContainerID>
 [/d<Destination>][/b]

Parameters

Parameter Description

/o

Specifies whether to add or remove items from the list of destinations, using one of the parameters in the following table:

 

Value Description

add

Adds a new destination (computer name) to the list.

delete

Removes an existing destination from the list.

deleteall

Clears the entire destination list. When the destination list is empty, UI messages of the type specified by the /t command-line option will not appear on any computer.

<Operation>

Specifies the operation.

/t

Specifies the type of message for which you are setting the destination, using one of the parameters in the following table:

 

Value Description

info

Informational messages

req

Messages that are “requesting” in nature

err

Error messages

<UIType>

Specifies the UI type.

/cg

Specifies the computer object for which you are redirecting messages of the type specified by /t, using the object's GUID.

<ContainerID>

Specifies the object container ID.

/cf

Specifies the computer object for which you are redirecting messages of the type specified by /t, using the object's friendly name.

/lg

Specifies the library object for which you are redirecting messages of the type specified by /t, using the object's GUID.

/lf

Specifies the library object for which you are redirecting messages of the type specified by /t, using the object's friendly name.

/d

Displays the objects' description.

<Destination>

Specifies the destination.

/b

Hides the text on completion, for scripting purposes.

/?

Displays Help at the command prompt.

Remarks

  • If a command succeeds, then the code ERROR_SUCCESS is returned. All commands that fail return an error code, which can be used for scripting purposes. The error code is either a system-defined error code or one of the error codes listed in the following table.

    Error code Description

    536870913

    Invalid arguments were specified. Frequently, this is caused by a space after an argument command-line option, for example, /t 50 instead of /t50.

    536870914

    Duplicate argument command-line options were specified. For example, the allocate command used with two /m switches.

    536870915

    No GUID matches the friendly name that was specified. Check capitalization because friendly names are case-sensitive.

    536870916

    An insufficient number of argument switches were specified. Check to see if a required switch is missing.

    536870917

    An invalid GUID was specified. Use the view command to determine the correct GUID for an object.

    536870918

    This is returned only by the ejectatapi command. Verify that the ATAPI changer is functioning correctly.

    536870919

    No match was found for the specified drive object. Use the view command to determine the correct friendly name or GUID for the drive.

    536870920

    No match was found for the specified slot object. Use the view command to determine the correct friendly name or GUID for the slot.

Additional references