KB Logo

TOLIS Group Knowledge Base

Browse KB by category:
Go to KB #:
Glossary
Email   Bookmark



How do I control my tape library with the libctl (tm) command on Mac OS X?

Views: 17446
Votes: 3
Posted: 15 Oct, 2007

Controlling a Tape Library - libctl

A tape library allows you to automate the use of multiple tapes and even multiple tape drives without direct user intervention. Tape libraries are often referred to by the names Library, Autoloader, or Changer, but these all refer to the same basic idea – robotic control of loading and unloading of a tape drive within a self contained cabinet. The general distinction is that an Autoloader is usually a smaller unit supporting 10 or fewer tape slots and a single tape drive, while a Library or Changer supports 10s or even 1000s of tape slots and one or more tape drives.

Additionally, it is important to note that many libraries support different access modes. These modes include SCSI – or Random, Console, LCD, and Sequential modes. For proper software operation with libctl, your library should be set to SCSI – or Random mode. For information on the other modes and how you interface with them, please refer to your library’s documentation.

The TOLIS Tape Tools libctl utility provides the mechanism to control all of the robotic operations of a library. Commands provided by libctl include:

display - displays available changer devices
inquiry - displays the SCSI inquiry info for the selected library
status - displays info on library queried.
initialize - (re)initialize elements / read barcodes.
inventory - Displays load settings for drive(s) and tapes.
load [s] [d] - Load a tape from slot [s] to drive [d].
unload [d] [s] - Unload tape from drive [d] to slot [s].
move <fs> <ts> - Moves tape in slot fs to slot ts. fs and ts are required.
export <fs> [ie] - Places tape from slot fs into the ie (mailslot) specified.
import [ie] <ts> - Loads tape in the ie (mailslot) to slot ts. export and import default to the first ie slot.
unlock - Unlocks the i/e port (mailslot) for addition of tape(s).

Example libctl commands and their results

# libctl display
Available Tape Changers:
changer0: SONY LIB-162 01m6

# libctl status
Vendor = SONY , Model = LIB-162
Revision Level = 01m6
Unit has barcode reader
Robots: 1 (0), Drives: 1 (82), Tape Slots: 16 (1 - 16),
No Import/Export slots.
Drive 0: Empty
Slot 1: Full : Ready : A01JEN
Slot 2: Full : Ready : A01JEG
Slot 3: Full : Ready : A01JED
Slot 4: Full : Ready : ABD123
Slot 5: Full : Ready : ABD120
Slot 6: Full : Ready : ABD125
Slot 7: Full : Ready : ABD126
Slot 8: Full : Ready : A01JEE
Slot 9: Full : Ready : A01JG4
Slot 10: Empty
Slot 11: Empty
Slot 12: Empty
Slot 13: Empty
Slot 14: Empty
Slot 15: Empty
Slot 16: Full : Ready : No Bar Code

# libctl -v load 3 0
Vendor = SONY , Model = LIB-162
Revision Level = 01m6
Unit has barcode reader
Robots: 1 (0), Drives: 1 (82), Tape Slots: 16 (1 - 16),
No Import/Export slots.
Move Element Called 0, 3, 82
Move Element Complete.

As with tapectl, all libctl commands will provide a return code. A zero indicates complete success while non-zero indicates an error has occurred.

libctl Command Breakdown

display
Syntax: libctl display

The display command lists the libraries available according to your OS X . Libraries are type 8 SCSI devices. To provide a standardized naming convention, we refer to the devices as changerX where X is a number starting at zero. The default device for all commands is changer0.

inquiry
Syntax: libctl inquiry

The inquiry command issues a SCSI INQUIRY command to the defined device and displays the data returned by the tape library.

status
Syntax: libctl status

The status command returns the current status of the selected tape library. This information includes vendor info, number of drives, tape slots, and import/export slots, as well as the status of each of these elements.

initialize
Syntax: libctl initialize

The initialize command performs a full INITIALIZE ELEMENT STATUS operation on the entire library. For smaller libraries, this command will finish very quickly, but for a larger library (100+ slots), it can take many minutes to complete.

inventory
Syntax: libctl inventory

The inventory command is a subset of the status command in that it returns the status of drives, I/E slots, and tape slots.

load
Syntax: libctl load 3 0

The load command instructs the library to load a tape from the slot listed into a drive. The tape slot is required, but the destination drive may be omitted and the default of the first drive (drive 0) will be assumed.

unload
Syntax: libctl unload 0 3

The unload command instructs the library to pick the tape from the listed drive and return it to the listed slot. You may omit either the slot and libctl will return the tape to the slot it was originally picked from, or both the drive and the slot and libctl will use drive 0 and the slot the tape was originally picked from.
unload NOTE: Some libraries require that the tape be physically ejected from the tape drive before being instructed to pick it. Use the ‘tapectl unload’ command to eject the tape from the drive before issuing the ‘libctl unload’ command.

move
Syntax: libctl 4 10

The move command allows you to relocate a tape from one slot to another within the library. The example command moves the tape in slot 4 to slot 10. Not all libraries support this operation, so check the libctl return code if nothing seems to have occurred. Also, an error will occur if the from slot is empty or the to slot is full.

export
Syntax: libctl export 14 1

The export command is only useful if your library has a true Import/Export slot (sometimes called a mailslot or an EE slot). It provides a method of exchanging tapes within the library without requiring that the library be physically opened. This is mainly important in larger libraries where opening the library causes a full reinitialization. This command tells the library to pick the tape from the listed slot and place it into the listed I/E slot. The example picks the tape in slot 14 and places it into the first I/E slot.

import
Syntax: libctl import 1 14

The import command is the opposite of the export command. It is only useful if your library has a true Import/Export slot. After you’ve placed a tape into the I/E slot and locked it, this command will pick the tape and place it into the library’s inventory.

unlock
Syntax: libctl unlock

The unlock command unlocks the I/E slot. It is not supported by all libraries and can actually cause a system hang between the library and the computer. We recommend that you use your library’s control panel for locking and unlocking the I/E slots.

"libctl" is a trademark of TOLIS Group, Inc.

Others in this Category
document How can I test to see if my tape drive/library is operating properly under Mac OS X?
document SCSI Compatibility Issues Under Mac OS X
document How do I use the 'taperead' command?
document How do I control tape devices with tapectl(tm)?
document How do I write to a tape with the 'tapewrite' command?
» More Articles



RSS
Powered by KnowledgebasePublisher
Page Load Time: 0.032269 seconds / 32.269 milliseconds.
Page File Size: 29332 bytes.