cancel
Showing results for 
Search instead for 
Did you mean: 

A command line to check if a tape is on the drive

Christian_K_
Level 2
Hello,

I am looking for a command line to know if a tape is mounted on a drive and, optionaly, with one.

Thanks
ChristianMessage was edited by:
Christian K.
1 ACCEPTED SOLUTION

Accepted Solutions

Stumpr2
Level 6
vmoprcmd -d

Here is the man page:
# man vmoprcmd

vmoprcmd(1M) vmoprcmd(1M)
18 Jul 2003

NAME
vmoprcmd - perform operator functions on drives

SYNOPSIS
/usr/openv/volmgr/bin/vmoprcmd -down | -up | -upopr |
-reset drive_index | -downbyname | -upbyname | -upoprbyname |
-resetbyname drive_name | -crawlreleasebyname drive_name |
-comment drive_index | -commentbyname drive_name
| -assign drive_index mount_request_id | -assignbyname
drive_name mount_request_id | -deny | -resubmit mount_request_id |
-d | -help

DESCRIPTION
Perform operator functions on drives. The -h option is not required,
but you must choose one and only one of the other options listed
below.

This command can be executed by any authorized users. For more
information about NetBackup authorization, refer to "Enhanced
Authorization and Authentication" in the NetBackup System
Administrator's Guide or the NetBackup Media Manager System
Administrator's Guide.

OPTIONS
-h device_host
Name of the device host where the drives are attached and
configured. If no host option is specified, the device host
where you execute the command is assumed.

The following point applies only to NetBackup Server:

The device host is the host where Media Manager is
installed.

-down | -up | -upopr | -reset drive_index
-down Sets the drive to the DOWN state, if it is not
assigned.

-up Sets the drive to UP in Automatic Volume Recognition
(AVR) mode. This is the normal mode for all drives.

-upopr Sets the drive to UP in Operator (OPR) mode. This
mode is normally used only for security reasons. For a drive
in a robot, OPR and AVR are treated identically while the
robot daemon is up.

-reset Resets the specified drive, terminating the drive
assignment and taking control away from the assigned user.

CAUTION: Do not reset an assigned drive unless directed by site
policy or the system administrator. Terminating an active

- 1 - Formatted: December 15, 2004

vmoprcmd(1M) vmoprcmd(1M)
18 Jul 2003

job can destroy user data.

-downbyname | -upbyname | -upoprbyname | -resetbyname drive_name
These options are similar to -down, -up, -upopr, and -reset
respectively, except the drive is specified by the drive
name instead of drive index.

-comment drive_index
Add a comment for the drive. The quotes are required if your
comment contains any spaces. If you do not specify comment,
any existing comments for the drive are deleted.

-commentbyname drive_name
This option is similar to the -comment option, except the
drive is specified by the drive name instead of drive index.

-assign drive_index mount_request_id
Assign a drive to a mount request.

-assignbyname drive_name mount_request_id
This option is similar to the -assign option, except the
drive is specified by the drive name instead of drive index.

-deny | -resubmit mount_request_id
-deny Denying a mount request returns an error message to
the user.

-resubmit Resubmit a mount request. If a pending action
message involves a robot, you must correct the problem and
resubmit the request that caused the message.

-d
If none of the following optional display parameters are
specified, all information is displayed.

pr Display pending requests.

ds Display the status of drives under control of Media
Manager.

ad Display additional status of drives under control of
Media Manager.

-help Display the usage statement for this command.

-crawlreleasebyname drive_name
This option is only applicable for NetBackup Enterprise
Server. This option forces all hosts (that are registered
to use the drive) to issue a SCSI release command to the
drive. Issue this option on the host that is the SSO device
allocator (DA host) or use the -h option to specify the DA

- 2 - Formatted: December 15, 2004

vmoprcmd(1M) vmoprcmd(1M)
18 Jul 2003

host.

CAUTION: Use this option after a PEND status has been seen in Device
Monitor. Do not use this option during backups.

NOTES
Only limited validation of the option parameters is done.

tpconfig -d, tpconfig -l, and vmoprcmd may truncate long drive names.
Please use tpconfig -dl to obtain the full drive name.

vmoprcmd may truncate drive names to 20 characters.

EXAMPLES
The following command sets the drive, with a drive index of 0, to UP
mode:

vmoprcmd -up 0

The following command displays the drive status of all drives:

vmoprcmd -d ds

The following command displays pending requests and the drive status
of all drives on the device host named crab:

vmoprcmd -h crab

SEE ALSO
tpconfig(1M)

COPYRIGHT
Copyright 2002-2003 VERITAS Software Corporation. All rights reserved.

- 3 - Formatted: December 15, 2004Message was edited by:
Bob Stump

View solution in original post

2 REPLIES 2

Stumpr2
Level 6
vmoprcmd -d

Here is the man page:
# man vmoprcmd

vmoprcmd(1M) vmoprcmd(1M)
18 Jul 2003

NAME
vmoprcmd - perform operator functions on drives

SYNOPSIS
/usr/openv/volmgr/bin/vmoprcmd -down | -up | -upopr |
-reset drive_index | -downbyname | -upbyname | -upoprbyname |
-resetbyname drive_name | -crawlreleasebyname drive_name |
-comment drive_index | -commentbyname drive_name
| -assign drive_index mount_request_id | -assignbyname
drive_name mount_request_id | -deny | -resubmit mount_request_id |
-d | -help

DESCRIPTION
Perform operator functions on drives. The -h option is not required,
but you must choose one and only one of the other options listed
below.

This command can be executed by any authorized users. For more
information about NetBackup authorization, refer to "Enhanced
Authorization and Authentication" in the NetBackup System
Administrator's Guide or the NetBackup Media Manager System
Administrator's Guide.

OPTIONS
-h device_host
Name of the device host where the drives are attached and
configured. If no host option is specified, the device host
where you execute the command is assumed.

The following point applies only to NetBackup Server:

The device host is the host where Media Manager is
installed.

-down | -up | -upopr | -reset drive_index
-down Sets the drive to the DOWN state, if it is not
assigned.

-up Sets the drive to UP in Automatic Volume Recognition
(AVR) mode. This is the normal mode for all drives.

-upopr Sets the drive to UP in Operator (OPR) mode. This
mode is normally used only for security reasons. For a drive
in a robot, OPR and AVR are treated identically while the
robot daemon is up.

-reset Resets the specified drive, terminating the drive
assignment and taking control away from the assigned user.

CAUTION: Do not reset an assigned drive unless directed by site
policy or the system administrator. Terminating an active

- 1 - Formatted: December 15, 2004

vmoprcmd(1M) vmoprcmd(1M)
18 Jul 2003

job can destroy user data.

-downbyname | -upbyname | -upoprbyname | -resetbyname drive_name
These options are similar to -down, -up, -upopr, and -reset
respectively, except the drive is specified by the drive
name instead of drive index.

-comment drive_index
Add a comment for the drive. The quotes are required if your
comment contains any spaces. If you do not specify comment,
any existing comments for the drive are deleted.

-commentbyname drive_name
This option is similar to the -comment option, except the
drive is specified by the drive name instead of drive index.

-assign drive_index mount_request_id
Assign a drive to a mount request.

-assignbyname drive_name mount_request_id
This option is similar to the -assign option, except the
drive is specified by the drive name instead of drive index.

-deny | -resubmit mount_request_id
-deny Denying a mount request returns an error message to
the user.

-resubmit Resubmit a mount request. If a pending action
message involves a robot, you must correct the problem and
resubmit the request that caused the message.

-d
If none of the following optional display parameters are
specified, all information is displayed.

pr Display pending requests.

ds Display the status of drives under control of Media
Manager.

ad Display additional status of drives under control of
Media Manager.

-help Display the usage statement for this command.

-crawlreleasebyname drive_name
This option is only applicable for NetBackup Enterprise
Server. This option forces all hosts (that are registered
to use the drive) to issue a SCSI release command to the
drive. Issue this option on the host that is the SSO device
allocator (DA host) or use the -h option to specify the DA

- 2 - Formatted: December 15, 2004

vmoprcmd(1M) vmoprcmd(1M)
18 Jul 2003

host.

CAUTION: Use this option after a PEND status has been seen in Device
Monitor. Do not use this option during backups.

NOTES
Only limited validation of the option parameters is done.

tpconfig -d, tpconfig -l, and vmoprcmd may truncate long drive names.
Please use tpconfig -dl to obtain the full drive name.

vmoprcmd may truncate drive names to 20 characters.

EXAMPLES
The following command sets the drive, with a drive index of 0, to UP
mode:

vmoprcmd -up 0

The following command displays the drive status of all drives:

vmoprcmd -d ds

The following command displays pending requests and the drive status
of all drives on the device host named crab:

vmoprcmd -h crab

SEE ALSO
tpconfig(1M)

COPYRIGHT
Copyright 2002-2003 VERITAS Software Corporation. All rights reserved.

- 3 - Formatted: December 15, 2004Message was edited by:
Bob Stump

Christian_K_
Level 2
Fine, Thanks.

I will use "vmoprcmd -d ds".

Christian