.\" @project The CERN Tape Archive (CTA) .\" @copyright Copyright © 2017-2022 CERN .\" @license This program is free software, distributed under the terms of the GNU General Public .\" Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". You can .\" redistribute it and/or modify it under the terms of the GPL Version 3, or (at your .\" option) any later version. .\" .\" This program is distributed in the hope that it will be useful, but WITHOUT ANY .\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A .\" PARTICULAR PURPOSE. See the GNU General Public License for more details. .\" .\" In applying this licence, CERN does not waive the privileges and immunities .\" granted to it by virtue of its status as an Intergovernmental Organization or .\" submit itself to any jurisdiction. .TH CTA-SMC "1cta" "2022-07-12" "CTA" "The CERN Tape Archive (CTA)" .SH NAME cta-smc \- CTA SCSI Media Changer client .SH SYNOPSIS \fBcta-smc\fP -d -D \fIdrive_ordinal\fR [ -V \fIvid\fR ] .br \fBcta-smc\fP -e -V \fIvid\fR .br \fBcta-smc\fP -i [ -V \fIvid\fR ] .br \fBcta-smc\fP -m -D \fIdrive_ordinal\fR -V \fIvid\fR .br \fBcta-smc\fP -q D [ -D \fIdrive_ordinal\fR ] [ --json ] .br \fBcta-smc\fP -q L [ --json ] .br \fBcta-smc\fP -q P [ --json ] .br \fBcta-smc\fP -q S [ -N nb_elements ] [ -S starting_slot ] [ --json ] .br \fBcta-smc\fP -q V [ -N nb_elements ] [ -V \fIvid\fR ] [ --json ] .SH DESCRIPTION \fBcta-smc\fP is the SCSI Media Changer client. It controls the mounting, dismounting and exporting of tapes in a robotic tape library and can be used to query the state of the library. .SH OPTIONS .TP \-d Triggers a dismount operation. The drive must be already unloaded. The drive must be specified, but the Volume ID (VID) of the cartridge is optional. If -V \fIvid\fR is specified, \fIvid\fR must match the VID on the cartridge to be dismounted. .TP -D \fIdrive_ordinal\fP Specify which drive to control or query. \fIdrive_ordinal\fP is the SCSI bus number of the drive, starting from 0. .TP \-e Moves a tape from a storage slot to the export slot (which can be virtual). The VID must be specified. .TP \-i Imports either a specific VID (indicated by -V) or all tapes in state "import" in the import/export slots. .TP \-m Triggers a mount operation. The drive must be free. The drive and the VID must be specified. .TP \-N \fInb_elements\fR Specifies the maximum number of entries to be reported. .TP \-q \fIquery_type\fR Queries the library and produces a report about the state of the library. \fIquery_type\fR may be one of the following: .RS .TP .B D Produce a list of drives with their status and the VID of the mounted tape (if any). The status of all drives is reported, unless a specific drive is selected with the -D option. .TP .B L Prints the result of the SCSI \fBINQUIRY\fP command (Vendor/Product/Revision). It also gives the starting address and the number of slots, drives, ports and transports (robotic arms) in the library. .TP .B P Prints the status of import/export slots. .TP .B S Prints the status of slots. By default all slots are reported, but the starting address may be specified with the -S option, and the number of elements to be reported may be specified with the -N option. .TP .B V Prints the status of volumes (tapes). A single VID or a pattern may also be specified with the -V option. .RE .TP \-S \fIstarting_slot\fR Specifies the starting slot address for the query operation. .TP \-V \fIvid\fR A full VID or a pattern may be specified using shell wildcard characters '?' and '*'. .TP --json Return query responses in JSON format (for use in scripts). .SH EXIT STATUS .P 0 Ok. .br 1 Parameter error or unrecoverable error (just log it). .br 2 Should release drive and retry in 600 seconds. .br 3 Should retry in 60 seconds. .br 4 Should first do a demount force. .br 5 Should configure the drive down. .br 6 Should send a message to the operator and exit. .br 7 Ops msg (nowait) + release drive + slow retry. .br 8 Should send a message to the operator and wait. .br 9 Should unload the tape and retry demount. .br 16 Robot busy. .SH EXAMPLE .P To mount the tape with VID JK2005 on drive 1: .P .RS .B "cta-smc -m -D 1 -V JK2005" .RE .P To dismount the tape present on drive 1 after checking the VID: .P .RS .B "cta-smc -d -D 1 -V JK2005" .RE .P To query the main charateristics of the library: .P .RS .B "cta-smc -q L" .sp .nf Vendor/Product/Revision = Transport Count = 1, Start = 1000 Slot Count = 99, Start = 0 Port Count = 1, Start = 1010 Device Count = 2, Start = 1030 .fi .RE .P To query the status of all the drives: .P .RS .B "cta-smc -q D" .sp .nf .cs R 20 Drive Ordinal Element Addr. Status Vid 0 1030 free 1 1031 unloaded JK2005 .cs R .fi .RE .P To get the list of a few slots in the library: .P .RS .B "cta-smc -q S -S 20 -N 10" .sp .nf .cs R 20 Element Addr. Vid 20 JK2021 21 JK2022 22 JK2023 23 JK2024 24 JK2025 25 JK2026 26 JK2027 27 JK2028 28 JK2029 29 JK2030 .cs R .fi .RE .P To get the status of tapes for which the VID starts with JK200 .P .RS .B "cta-smc -q V -V 'JK200*'" .sp .nf .cs R 20 Vid Element Addr. Element Type JK2001 0 slot JK2002 1 slot JK2003 2 slot JK2004 3 slot JK2006 5 slot JK2007 6 slot JK2008 7 slot JK2009 8 slot JK2005 1031 drive .cs R .fi .RE .SH SEE ALSO .P CERN Tape Archive documentation (\fIhttps://eoscta.docs.cern.ch/\fR) .SH COPYRIGHT .P Copyright © 2022 CERN. License GPLv3+: GNU GPL version 3 or later (\fIhttp://gnu.org/licenses/gpl.html\fR). This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. In applying this licence, CERN does not waive the privileges and immunities granted to it by virtue of its status as an Intergovernmental Organization or submit itself to any jurisdiction.