mtx.doc
来自「通用SCSI设备备份/读写程序」· DOC 代码 · 共 210 行
DOC
210 行
[WARNING: This document is of historical value only! Please read 'mtxl.README.html' and 'man mtx' for current documentation! The only thing useful here is examples of how to use the 'tar' command for multi-tape backups.] MTX - SCSI Tape Medium Changer Control Program Version 1.1 for Linux, Solaris, IRIX, Digital Unix, and OpenVMS 2 June 1998 Leonard N. Zubkoff Dandelion Digital lnz@dandelion.com Copyright 1997-1998 by Leonard N. Zubkoff <lnz@dandelion.com> INTRODUCTIONThe MTX program controls the robotic mechanism in DDS Autoloaders such as theSeagate 4586NP (Archive Python 28849-XXX). This program is also reported towork with the Seagate 4584NP, HP Surestore 12000, Quantum DLT 2500 XT, and AIWADL-210. The 4586NP responds to both Logical Units 0 and 1 on the selectedTarget ID. Logical Unit 0 supports commands from the SCSI-3 Sequential StreamDevice Command Set and must be accessed via the SCSI tape devices /dev/st<N>.Logical Unit 1 only supports commands from the SCSI-3 Medium Changer CommandSet and must be accessed via the SCSI Generic devices /dev/sg<N>. In addition,Logical Unit 0 also acts as an Attached Medium Changer and supports the READELEMENT STATUS and MOVE MEDIUM commands. Since using the Primary Device(Logical Unit 0) via the Attached Medium Changer interface is sufficient forthe commands provided by this program, Logical Unit 1 is not normally used.The AIWA DL-210, by contrast, does not support the Attached Medium Changercommands on Logical Unit 0 and so MTX must be used with Logical Unit 1 via theSCSI Generic devices /dev/sg<N>. Note that when using the SCSI Generic devicesthe Linux kernel option "max_scsi_luns=2" may be necessary.Medium Changers support four types of elements: Medium Transport Elements,Storage Elements, Import Export Elements, and Data Transfer Elements. For thelimited case of DDS Autoloaders, only the Data Transfer Element and StorageElement types are really applicable. The Data Transfer Element is the primarydevice where a volume can be loaded to actually perform data transfers. AStorage Element is a place a volume can be when it is waiting to be used. Fora DDS Autoloader, the Storage Elements are the slots in the cartridge wheretapes may be placed, and the Data Transfer Element is the tape mechanism.Every Medium Changer Element has a unique integer Element Address thatidentifies it in the address space of all Elements known to the Medium Changer.For the 4586NP, the Data Transfer Element is Address 1 and the Storage Elementsare Addresses 2-5 or 2-13. To simplify the human interface, this program doesnot use Element Addresses directly. Rather, it uses Storage Element Numberswhich range from 1 to the number of Storage Elements available.The specific tape device to be operated on can either be supplied on thecommand line with the "-f <tape-device>" option, or via the TAPE environmentvariable. BUILDING MTXThe Makefile contains sections for Linux, Solaris/SPARC, SGI IRIX, and DigitalUNIX. Comment/uncomment as necessary for the target environment. For OpenVMS,see the file "vms/000readme" for information on building MTX; a VMS releaseincluding pre-built binaries should be available from the WKU VMS FILESERVARCHIVES, which are located at URLs http://www2.wku.edu/www/fileserv/ andftp://ftp.wku.edu/vms/fileserv/. COMMANDSMTX provides the following commands:mtx [ -f <tape-device> ] inquiryThe "inquiry" command reports the Vendor ID, Product ID, and Revision from aSCSI INQUIRY command.kelewan:~# setenv TAPE /dev/st0kelewan:~# mtx inquiryVendor ID: 'ARCHIVE ', Product ID: 'Python 28849-XXX', Revision: '4.CM'mtx [ -f <tape-device> ] statusThe "status" command reports on the status of the DDS Autloader. The reportindicates the status of the Data Transfer Element and each of the StorageElements. In the first example, no tape is currently loaded. In the secondexample, Storage Element Number 1 is loaded. The Storage Element loaded intothe Data Transfer Element is usually reported by the DDS Autoloader, or it canbe inferred by MTX if there is only a single empty Storage Element.kelewan:~# mtx statusData Transfer Element: EmptyStorage Element 1: FullStorage Element 2: FullStorage Element 3: FullStorage Element 4: Fullkelewan:~# mtx statusData Transfer Element: Full (Storage Element 1 Loaded)Storage Element 1: EmptyStorage Element 2: FullStorage Element 3: FullStorage Element 4: Fullmtx [ -f <tape-device> ] load <storage-element-number>The "load" command loads the volume in Storage Element <storage-element-number>into the Data Transfer Element. An error is signaled if the Data TransferElement is already full.mtx [ -f <tape-device> ] unload [ <storage-element-number> ]The "unload" command unloads the volume in the Data Transfer Element intoStorage Element <storage-element-number>. If <storage-element-number> is notprovided, then the volume is unloaded back into the Storage Element from whichit was originally loaded, if known. An error is signaled if the StorageElement is already full.mtx [ -f <tape-device> ] firstThe "first" command unloads any volume in the Data Transfer Element and thenloads the volume in the lowest numbered non-empty Storage Element. If thecorrect Storage Element is already loaded, the unload/load is suppressed.mtx [ -f <tape-device> ] nextThe "next" command unloads any volume in the Data Transfer Element and thenloads the volume in the lowest numbered non-empty Storage Element above theStorage Element that was just unloaded. If there is no next Storage Element,the unload is still performed and the Data Transfer Element will be left emptyso that the volume is not accidentally overwritten.mtx [ -f <tape-device> ] lastThe "last" command unloads any volume in the Data Transfer Element and thenloads the volume in the highest numbered non-empty Storage Element. If thecorrect Storage Element is already loaded, the unload/load is suppressed.mtx [ -f <tape-device> ] previousThe "previous" command unloads any volume in the Data Transfer Element and thenloads the volume in the highest numbered non-empty Storage Element below theStorage Element that was just unloaded. If there is no previous StorageElement, the unload is still performed and the Data Transfer Element will beleft empty so that the volume is not accidentally overwritten.The interface is designed to allow both explicit control of precisely whichStorage Element is loaded, as well as sequential access among only the StorageElements that actually have volumes present. Thus for example, one way ofusing MTX would be to perform Monday's incremental backups on Storage Element1, Tuesday's on Storage Element 2, and so on. Multi-volume full backups arealso conveniently supported, as in:setenv TAPE "/dev/st0"mtx statusmtx firsttime tar --create --one-file-system --atime-preserve \ --listed-incremental `date +%y%m%d`.ss \ --multi-volume --new-volume-script "mtx next" \ --directory / <wherever>mtx firsttime tar --compare --multi-volume --new-volume-script "mtx next" \ --directory /mtx unload LINUX KERNEL REQUIREMENTSBecause the MOVE MEDIUM command may require 60 seconds or more to perform avolume load or unload request, a longer timeout must be provided. Linuxkernels 2.0.30 and 2.1.28 should already contain a long enough timeout. Forearlier kernels, edit the file "linux/drivers/scsi/scsi_ioctl.c" and add thefollowing entries to the switch statement in ioctl_command: case MOVE_MEDIUM: case READ_ELEMENT_STATUS: timeout = 5 * 60 * HZ; /* 5 minutes */ retries = 1; break;For older kernels, you may also need to add the following definitions to"linux/include/scsi/scsi.h":#define MOVE_MEDIUM 0xa5#define READ_ELEMENT_STATUS 0xb8Note also that "/usr/include/scsi" should be a symbolic link to the directory"linux/include/scsi" from your kernel source.Finally, when using MTX you may see some console messages from the SCSI tapedriver mentioning that there is no tape present. These can safely be ignored.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?