C H A P T E R  2

Using Automated Libraries and Manually Loaded Drives

An automated library is a robotically controlled device designed to load and unload removable cartridges without operator intervention. Automated libraries are also known as media changers, jukeboxes, robots, libraries, or media libraries.

This chapter describes aspects of using automated libraries and manually loaded drives in a Sun StorEdge SAM-FS environment. In addition, this chapter describes the operator-oriented load notification facility that alerts an operator when a requested volume is not in a library.



Note - The Sun StorEdge SAM-FS software interoperates with automated libraries from many manufacturers. Contact Sun Customer Support for information pertinent to library model numbers, firmware levels, and other compatibility information.



Certain operation for some automated libraries may differ from those described in this chapter. To determine whether your automated library has additional vendor-specific operating instructions in a Sun StorEdge SAM-FS environment, see Appendix A, Basic Operations for Libraries With Vendor-Specific Operational Procedures.

This chapter contains the following sections:


Automated Library Operations

A number of basic operations are essentially the same for all automated libraries. This section explains the following:


procedure icon  To Start Removable Media Operations

Typically, removable media operations commence when a Sun StorEdge SAM-FS file system is mounted.

single-step bulletTo start removable media operations manually, without mounting any file systems, enter the samd(1M) start command.


# samd start

If removable media operations are already running when the preceding command is entered, the following message is generated:


SAM-FS sam-amld daemon already running

For more information about the samd(1M) command, see the samd(1M) man page.


procedure icon  To Stop Removable Media Operations

It is possible to stop removable media operations and leave the Sun StorEdge SAM-FS system mounted. You might do this, for example, if you want to manually manipulate cartridges in a library. When operations are restarted, pending stages are reissued and archiving is resumed.

single-step bulletTo stop removable media operations, use the samcmd(1M) idle and samd(1M) stop commands.


samcmd idle eq
samd stop

For eq, enter the equipment ordinal of the drive being stopped as defined in the mcf file. To idle multiple drives, enter a samcmd idle eq command for each drive configured in your mcf file.

You can also idle drives by using the samu(1M) operator utility or by using File System Manager.



Note - Idle the drives in your Sun StorEdge SAM-FS environment before issuing the samd(1M) stop command. This enables the archiver, stager, and other processes to complete current tasks. Failure to issue the samd(1M) stop command can cause unexpected results when archiving, staging, and other activities are resumed.




procedure icon  To Turn On an Automated Library

When a library is in the on state, it is under the control of the Sun StorEdge SAM-FS system and can proceed with general operations. When you turn on a library, the Sun StorEdge SAM-FS software performs the following actions:

single-step bulletUse the samcmd(1M) on command to turn on an automated library.


samcmd on eq

For eq, specify the equipment ordinal of the automated library as defined in the mcf file.

You can also perform this task by using samu(1M) or File System Manager.


procedure icon  To Turn Off an Automated Library

Placing a library in the off state stops I/O operations and removes the automated library from Sun StorEdge SAM-FS control. No automatic movement of cartridges occurs, and the drives in the automated library remain in the on state. You might want to turn an automated library off to perform the following tasks:

single-step bulletUse the samcmd(1M) off command to turn off an automated library.


samcmd off eq

For eq, specify the equipment ordinal of the automated library being addressed as defined in the mcf file.

You can also perform this task by using samu(1M) or File System Manager.


procedure icon  To Load a Cartridge Into an Automated Library

Loading is the movement of a cartridge from a storage slot to a drive and its preparation to receive data. Loading occurs automatically when a volume serial name (VSN) is requested for archiving or staging.

single-step bulletUse the samcmd(1M) load command to manually load a cartridge.

You can use this command even if the drive is in unavail status. This command has the following two possible formats:


samcmd load eq:slot[:partition]
samcmd load media-type.vsn

TABLE 2-1 Arguments for samcmd (1M) load

Argument

Meaning

eq

The equipment ordinal of the drive as defined in the mcf file.

slot

The number of a storage slot as recognized in the library catalog.

media-type

The media type. For a list of valid media types, see the mcf(4) man page.

partition

A side of a magneto-optical disk. The partition must be 1 or 2. This argument is not applicable to tape cartridges.

vsn

The volume serial name assigned to the volume.


 

You can also perform this task by using samu(1M) or File System Manager.

When you manually load a cartridge, it is generally loaded in the next available drive in the library. If you want to make a drive unavailable for this purpose, use the samu(1M) utility's :unavail command or change the state of the device using File System Manager. You might do this, for example, during a disaster recovery operation or to analyze a tape.


procedure icon  To Unload a Cartridge From a Drive

Unloading is the removal of a cartridge from a drive.Unloading occurs automatically when a volume is no longer needed. You can also manually unload a drive.

single-step bulletUse the samcmd(1M) unload command to manually unload a cartridge.

This command can be used even if the drive is in unavail status. Use this command:


samcmd unload eq

For eq, specify the equipment ordinal of the drive as defined in the mcf file.

You can also perform this task by using samu(1M) or File System Manager.

Labeling a Cartridge

The procedure for labeling a cartridge depends on whether you are labeling a tape or optical disk. The following two sections describe these procedures.



caution icon

Caution - Labeling and relabeling a cartridge makes the data currently on the cartridge inaccessible to any software. Relabel a cartridge only if you are certain that you do not need the data that is stored on the cartridge.




procedure icon  To Label or Relabel a Tape

single-step bulletTo label a new tape, use the tplabel(1M) command.


tplabel -new -vsn vsn eq:slot

single-step bulletTo relabel an existing tape, use the tplabel(1M) command.


tplabel -old vsn -vsn vsn eq:slot

TABLE 2-2 Arguments for tplabel (1M)

Argument

Meaning

vsn

Volume serial name (VSN). If you are relabeling, the new VSN name can be identical to the old VSN name.

eq

The equipment ordinal of the drive as defined in the mcf file.

slot

The number of the tape's storage slot as recognized in the library catalog. This argument is not applicable for manually loaded drives.


 

After the command to label or relabel a tape is issued, the tape is loaded and positioned, and the tape label is written. For more information about the tplabel(1M) command, see the tplabel(1M) man page.

You can also perform this task by using File System Manager.


procedure icon  To Label or Relabel an Optical Disk

single-step bulletTo label a new optical disk, use the odlabel(1M) command.


odlabel -new -vsn vsn eq:slot:partition

single-step bulletTo relabel an existing optical disk, use the odlabel(1M) command.


odlabel -old vsn -vsn vsn eq:slot:partition

TABLE 2-3 Arguments for odlabel (1M)

Argument

Meaning

vsn

Volume serial name (VSN). If you are relabeling, the new VSN name can be identical to the old VSN name.

eq

The equipment ordinal of the drive as defined in the mcf file.

slot

The number of the disk's storage slot as recognized in the library catalog. This argument is not applicable to manually loaded drives.

partition

A side of a magneto-optical disk. The partition value must be 1 or 2. This argument is not applicable to tape cartridges.


 

After the command to label or relabel an optical disk is issued, the optical disk is loaded and positioned, and the optical disk label is written. For more information about the odlabel(1M) command, see the odlabel(1M) man page.

You can also perform this task by using File System Manager.


procedure icon  To Audit a Volume

Occasionally the reported space remaining on a tape or optical disk might need to be updated in the library catalog. The auditslot(1M) command loads the cartridge containing the volume, reads the label, and updates the library catalog entry for the slot.

single-step bulletUse the auditslot(1M) command to audit a volume.


auditslot [-e] eq:slot[:partition]

TABLE 2-4 Arguments for auditslot (1M)

Argument

Meaning

-e

If the -e option is specified and the media is tape, the remaining space is updated. Otherwise, it is not changed.

eq

The equipment ordinal of the drive as defined in the mcf file.

slot

The number of the storage slot as recognized in the library catalog. This argument is not applicable to manually loaded drives.

partition

A side of a magneto-optical disk. The partition value must be 1 or 2. This argument is not applicable to tape cartridges.


 

For more information about the auditslot(1M) command, see the auditslot(1M) man page.

You can also perform this task by using the samu(1M) utility's :audit command or by using File System Manager.


procedure icon  To Audit a Direct-Attached Automated Library



Note - This task cannot be performed on a network attached automated library.



A full audit loads each cartridge into a drive, reads the label, and updates the library catalog. You should audit a library in the following situations:

single-step bulletUse the samcmd(1M) audit command to perform a full audit on a direct-attached automated library.


samcmd audit eq

For eq, specify the equipment ordinal of the automated library as defined in the mcf file.

You can also perform this task by using the samu(1M) utility's :audit command or by using File System Manager.

Using a Cleaning Cartridge

The Sun StorEdge SAM-FS environment supports the use of cleaning tapes if cleaning tapes are supported by the hardware. If a tape drive requests cleaning, the system automatically loads a cleaning tape.

If your system uses barcoded labels, cleaning tapes must have a VSN of CLEAN or a VSN starting with the letters CLN in the barcode label. Alternatively, you can use the chmed(1M) command to mark a VSN as a cleaning tape and set the count. Multiple cleaning tapes are allowed in a system.

Cleaning practices differ from manufacturer to manufacturer. See Basic Operations for Libraries With Vendor-Specific Operational Procedures to determine if specialized procedures are recommended for your equipment.


procedure icon  To Reset the Number of Cleaning Cycles

Cleaning tapes are useful only for a limited number of cleaning cycles. You can view the number of remaining cycles with the samu(1M) utility's :v display or by using File System Manager.

The Sun StorEdge SAM-FS system tracks the number of cleaning cycles used for each cleaning tape and ejects the tape when the remaining cycles equal zero. For example, a DLT cleaning tape has 20 cycles, and an Exabyte cleaning tape has 10 cycles. Each time a cleaning tape is imported, the cleaning cycle is reset to the highest number of cycles for that type of tape.

If automatic cleaning is available on your system but all cleaning tapes in the automated library have a count of zero, the drive is set to off and a message is issued in the Sun StorEdge SAM-FS log.

single-step bulletUse the chmed(1M) command to reset a cleaning tape with a count of zero.


chmed -count count media-type.vsn

TABLE 2-5 Arguments for chmed (1M)

Argument

Meaning

count

The number of cleaning cycles to which you want the cleaning tape reset.

media-type

The media type. For a list of valid media types, see the mcf(4) man page.

vsn

The volume serial name (VSN) assigned to the volume.


 

procedure icon  To Use a Cleaning Cartridge With a Barcode

If the cleaning cartridge is barcoded, you can import it using the import(1M) command.

1. Make sure that the cleaning cartridge has a barcode of CLEAN or starts with the letters CLN.

2. Use the import(1M) command to import the cleaning cartridge into the automated library.


import eq

For eq, specify the equipment ordinal of the automated library as defined in the mcf file.

For example, the following command imports a cleaning tape into the automated library that is numbered 50 in your mcf file:


# import 50

You can also perform this task by using samu(1M) or File System Manager.

The Sun StorEdge SAM-FS system moves the cartridge from the mailbox to a storage slot and updates the library catalog. In addition, after this command is issued, the cleaning media flag is set, and the access count is set to the appropriate number of cleaning cycles, based on the media type. Each time the cartridge is used to clean a drive, the access count is decremented.


procedure icon  To Use a Cleaning Cartridge Without a Barcode

If the cartridge is not barcoded, you must import it first. It is not automatically marked as a cleaning cartridge.

1. Use the import(1M) command to import the cartridge into the automated library.


import eq

For eq, specify the equipment ordinal of the automated library as defined in the mcf file.

2. Use the chmed(1M) command to change the type to a cleaning cartridge.


chmed +C eq:slot

For eq, specify the equipment ordinal of the automated library. For slot, specify the slot in which the cleaning cartridge has been loaded.

In the following example, the automated library is equipment ordinal 50 and the cleaning cartridge is in slot 77:


# chmed +C 50:77

3. Use chmed(1M) again to set the cleaning cycle count.


chmed -count count-number eq:slot

For eq, specify the equipment ordinal of the automated library. For slot, specify the slot in which the cleaning cartridge has been loaded.

The following example command sets the count on the cartridge used in the preceding step:


# chmed -count 20 50:77

For more information about the chmed(1M) command, see the chmed(1M) man page.


procedure icon  To Limit the Number of Cleaning Cycles

single-step bulletCertain drive errors can result in the repeated loading of cleaning cartridges until all cleaning cycles are consumed. Use the chmed(1M) command to limit the number of cleaning cycles on cleaning cartridges.


chmed -count count-number eq:slot

For eq, specify the equipment ordinal of the automated library. For slot, specify the slot in which the cleaning cartridge has been loaded.

For example, the following command sets the cleaning cycle count to 20 for the cleaning cartridge in slot 77 of the automated library with the equipment ordinal of 50.


# chmed -count 20 50:77


procedure icon  To Clean a Tape Drive

When automatic cleaning is not available and the system uses barcodes, perform the following procedure to request manually that a drive be cleaned:

single-step bulletUse the cleandrive(1M) command.


cleandrive eq

For eq, specify the equipment ordinal of the automated library as defined in the mcf file. This is the drive to be loaded with the cleaning cartridge.

Tape Drive Auto-Cleaning

Beginning with Sun StorEdge SAM-FS 4U4, the default setting for software-initiated tape drive cleaning is off, which forces the user to choose between a hardware- or software-initiated tape drive cleaning strategy.

A hardware-initiated cleaning strategy uses the media changer's built-in auto-cleaning feature. In order to use this feature, you may need to put cleaning cartridges in special slots. See the manufacturer's documentation for directions.

A software-initiated cleaning strategy uses the Sun StorEdge SAM-FS auto-cleaning feature. The logsense option is an enhancement to this feature that prevents a drive from using expired cleaning media. For the Sun StorEdge SAM-FS auto-cleaning feature to be enabled, the hardware-initiated cleaning should be disabled and the following line should appear in the defaults.conf file:


tapeclean = all autoclean on logsense on

To invoke the legacy Sun StorEdge SAM-FS auto-cleaning feature, which relies on sense data only for drive cleaning status, insert the following line in the defaults.conf file:


tapeclean = all autoclean on logsense off



Note - When using the auto-cleaning feature with a library with more than two drives, it is recommended that you have at least two cleaning cartridges per Sun StorEdge SAM-FS catalog. If there are drives that need to be cleaned, and not enough cleaning cartridges, those drives will be put into a DOWN state.




procedure icon  To Clear Media Errors

When a hardware or software error is encountered on a cartridge, the Sun StorEdge SAM-FS system sets the media error flag in the VSN catalog. On any given cartridge that generates a media error signal, you can use the chmed(1M) command to clear the error, and you can then attempt to use the cartridge. The media error flag is displayed in the samu(1M) utility's v display and in File System Manager.

1. Use the chmed(1M) command to clear the media error flag.


chmed -E media-type.vsn

TABLE 2-6 Arguments for chmed (1M)

Argument

Meaning

media_type

The media type. For a list of valid media types, see the mcf(4) man page.

vsn

The volume serial name (VSN) assigned to the volume.


 

2. Issue the auditslot(1M) command to update the space remaining information.


auditslot -e eq:slot[:partition]

TABLE 2-7 Arguments for auditslot (1M)

Argument

Meaning

-e

If the -e option is specified and the media is tape, the remaining space is updated. Otherwise, it is not changed.

eq

The equipment ordinal of the automated library or manually loaded drive as defined in the mcf file.

slot

The number of the storage slot in the automated library as recognized in the library catalog. This argument is not applicable to manually loaded drives.

partition

A side of a magneto-optical disk. The partition must be 1 or 2. This argument is not applicable to tape cartridges.


 

For more information about the auditslot(1M) command, see the auditslot(1M) man page.

You can also perform this task by using the samu(1M) utility's :audit command or File System Manager.


procedure icon  To Remove a Stuck Cartridge From a Drive

If a cartridge becomes stuck in a drive, follow these steps.

1. Use the samcmd(1M) off command to turn off the drive in the automated library.


samcmd off eq

For eq, specify the equipment ordinal of the drive as defined in the mcf file.

You can also perform this step by using samu(1M) or File System Manager.

2. Use the samcmd(1M) off command to turn off the automated library.


samcmd off eq

For eq, specify the equipment ordinal of the library as defined in the mcf file.

You can also perform this step by using samu(1M) or File System Manager.

3. Physically remove the cartridge from the drive.

Make sure you do not damage either the cartridge or the drive.

4. Use the samcmd(1M) on command to turn on the automated library and the drive.

Issue this command once for the drive and once for the library.


samcmd on eq

For eq, specify the equipment ordinal of the library or drive as defined in the mcf file.

If the automated library performs an audit when it is turned on, you are done.

5. Follow these steps if the automated library does not perform an audit when it is turned on:

a. Put the cartridge back into its storage slot.

b. Use the chmed(1M) command to adjust the library catalog to set the occupied flag for the damaged tape.

Use this command in the following format:


chmed +o eq:slot

TABLE 2-8 Arguments for chmed (1M)

Argument

Meaning

eq

The equipment ordinal of the automated library or drive as defined in the mcf file.

slot

The number of the storage slot in the library as recognized in the library catalog. This argument is not applicable for manually loaded drives.


 

For more information about the chmed(1M) command, see the chmed(1M) man page.

If you keep the cartridge out, and you want to put it back in later, you must import the cartridge into the automated library.

Catalog Operations, Importing Cartridges, and Exporting Cartridges

The physical addition (import) and removal (export) of cartridges from an automated library enables you to perform several functions, including the following:

When you import and export cartridges, you also update the library catalog.

The library catalog is the central repository of all information that the Sun StorEdge SAM-FS environment needs for finding cartridges in an automated library. The library catalog file is a binary UFS-resident file that contains information about each slot in an automated library. The information in this file includes the one or more volume serial names (VSNs) associated with the cartridge stored in the slot, the capacity and space remaining on that cartridge, and flags indicating read-only, write-protect, recycling, and other status information for the cartridge.

The Sun StorEdge SAM-FS environment treats catalogs differently depending on how the automated library is attached to the server, as follows:

Each automated library handles cartridge import and export differently due to system characteristics and the vendor-supplied software. For example, on the ACL 4/52 library, you need to issue a move command to move cartridges into the import/export unit before exporting cartridges from the automated library.

Network attached automated libraries import and export cartridges using their own utilities, so the import(1M) and samexport(1M) commands only update the library catalog entries used by the Sun StorEdge SAM-FS systems. If you have a network attached library, see Basic Operations for Libraries With Vendor-Specific Operational Procedures for information about importing and exporting cartridges.

Tracking Exported Media -- The Historian

The Sun StorEdge SAM-FS historian keeps track of cartridges exported from an automated library or a manually mounted device. The historian acts like a virtual library, but it has no defined hardware devices. Like an automated library, it is configured in the mcf file, has a catalog that records entries for all cartridges associated with it, can import and export cartridges, and appears in File System Manager as another automated library.

You can configure the historian in the mcf file by using a device type of hy. If you do not configure the historian in the mcf file, it is created as follows:


historian  n+1  hy  -  on  /var/opt/SUNWsamfs/catalog/historian

In the preceding entry, n+1 is the last equipment ordinal in the mcf file plus 1. If you want to use a different equipment ordinal or path name for the catalog, you need only to define the historian in the mcf.

The historian library catalog is initialized with 32 entries when the historian first starts. Make sure that the catalog resides on a file system large enough to hold the entire catalog. Your site might want to track existing Sun StorEdge SAM-FS cartridges that have been exported from the library. In this case, you need to build a historian catalog from the existing cartridges as described in the build_cat(1M) man page.

The following two configuration directives in the defaults.conf file affect the behavior of the historian:

For more configuration information, see the historian(7) and defaults.conf(4) man pages.

Importing and Exporting From an Automated Library

A mailbox is an area in an automated library for adding and removing cartridges from the automated library. The import(1M) command moves a cartridge from the mailbox to a storage slot. The samexport(1M) command moves the cartridge from a storage slot to the mailbox. For most libraries, if a cartridge is present in the mailbox when the Sun StorEdge SAM-FS software is started, the software imports the cartridge automatically upon startup.

Importing and exporting practices differ from manufacturer to manufacturer. See Basic Operations for Libraries With Vendor-Specific Operational Procedures to determine if specialized procedures are recommended for your equipment.

The following sections describe importing and exporting cartridges:


procedure icon  To Import a Cartridge From a Library With a Mailbox

1. Open the mailbox using the manufacturer's suggested operation.

There is usually a button near the mailbox. Sometimes the mailbox is a one-slot mailbox referred to as a mail slot in the vendor's documentation.

2. Manually place the cartridge in the mailbox.

3. Close the mailbox.

4. Use the import(1M) command to import the cartridge.


import eq

For eq, specify the equipment ordinal of the library as defined in the mcf file.

The system moves the cartridge from the mailbox to a storage slot and updates the library catalog for the cartridge.

You can also perform this task by using samu(1M) or File System Manager.


procedure icon  To Export a Cartridge From a Library With a Mailbox

1. Use the samexport(1M) command to move a cartridge from a storage slot to the mailbox.

Use this command in one of the following formats:


samexport eq:slot
samexport media_type.vsn

TABLE 2-9 Arguments for samexport (1M)

Argument

Meaning

eq

The equipment ordinal of the automated library as defined in the mcf file.

slot

The number of the storage slot in the automated library as recognized in the library catalog.

media-type

The media type of the cartridge. For a list of valid media types, see the mcf(4) man page.

vsn

The volume serial name (VSN) assigned to the volume.


 

You can also perform this step by using samu(1M) or File System Manager.

2. Open the mailbox or mail slot using the manufacturer's suggested operation.

There is usually a button near the mailbox.


procedure icon  To Import a Cartridge From a Library Without a Mailbox

1. Use the samcmd(1M) unload command.


samcmd unload eq

For eq, specify the equipment ordinal of the library as defined in the mcf file.

2. Wait until the system completes its current task, sets the status to off, and transfers the current active catalog to the historian.

3. Unlock and open the door to the automated library.

4. Load cartridges into the available slots.

5. Close and lock the door to the automated library.

The automated library reinitializes and scans the cartridges in the library. The Sun StorEdge SAM-FS software updates the library catalog by adding the VSNs of the imported cartridges to the catalog. The automated library state is set to on.


procedure icon  To Export a Cartridge From a Library Without a Mailbox

1. Use the samcmd(1M) unload command.


samcmd unload eq

For eq, specify the equipment ordinal of the library being addressed as defined in the mcf file.

2. Wait until the system completes its current task, sets the status to off, and transfers the current active catalog to the historian.

3. Unlock and open the door to the automated library.

4. Remove the cartridges from their respective slots.

5. Close and lock the door to the automated library.

The automated library reinitializes and scans the cartridges in the automated library. The system updates the library catalog with the VSNs of the cartridges currently in library slots. The VSNs of the removed cartridges are removed from the library catalog and are now recorded only in the historian file. The automated library state is set to on.


procedure icon  To Enable Load Notification

The Sun StorEdge SAM-FS software requests cartridges to be loaded regularly to satisfy archiving and staging needs. If the request is for a cartridge that resides inside a library, the request is handled automatically. If the request is for a cartridge that resides outside the library, operator action is required. If enabled, the load_notify.sh(1M) script sends email when a cartridge needs to be obtained from outside the library.

1. Become superuser.

2. Use the cp(1) command to copy the load notification script from its installed location to its operable location.

For example:


# cp /opt/SUNWsamfs/examples/load_notify.sh /etc/opt/SUNWsamfs/scripts/load_notify.sh

3. Use more(1) or another command to examine the defaults.conf file.

Make sure that the following directives are in the file and appear as follows:

These directives are set by default. If the load notification capability is to be enabled, ensure that these directives have not been changed.

4. Modify the load_notify.sh script to send notices to the operator.

By default, the script sends email to root, but it can be edited to send email to another person, to dial a pager, or to provide some other means of notification.


Manually Loaded Drive Operations

This section describes operations that differ if you have a manually loaded, standalone drive rather than an automated library. Each manually loaded drive has its own one-slot library catalog.


procedure icon  To Load a Cartridge

single-step bulletTo load a cartridge into a manually loaded device, place the cartridge in the drive according to the manufacturer's instructions.

The Sun StorEdge SAM-FS system recognizes that the cartridge is loaded, reads the label, and updates the one-slot catalog. No further action is necessary.


procedure icon  To Unload a Cartridge

single-step bulletUse samcmd(1M) idle command to idle the drive.


samcmd idle eq

For eq, specify the equipment ordinal of the drive as defined in the mcf file.

This command ensures that no archive or stage processes are active. The drive switches from idle to off when all I/O activity is complete, and the tape ejects.

If the cartridge is a tape, the tape rewinds and is ready to be removed. An optical disk ejects automatically. See the manufacturer's instructions for removing the specific cartridge.

You can also perform this task by using samu(1M) or File System Manager.


procedure icon  To View a Library Catalog

single-step bulletUse the samu(1M) utility's :v command.


:v eq

For eq, specify the equipment ordinal of the library as defined in the mcf file.