1MTX(1)                      General Commands Manual                     MTX(1)
2
3
4

NAME

6       mtx - control SCSI media changer devices
7

SYNOPSIS

9       mtx  [-f <scsi-generic-device>] [nobarcode] [invert] [noattach] command
10       [ command ... ]
11

DESCRIPTION

13       The mtx command controls single or multi-drive SCSI media changers such
14       as  tape  changers, autoloaders, tape libraries, or optical media juke‐
15       boxes.  It can also be used with media changers that use the 'ATTACHED'
16       API,  presuming  that they properly report the MChanger bit as required
17       by the SCSI T-10 SMC specification.
18

OPTIONS

20       The first argument, given following -f , is  the  SCSI  generic  device
21       corresponding  to  your media changer.  Consult your operating system's
22       documentation for more information (for example, under Linux these  are
23       generally   /dev/sg0   through   /dev/sg15,  under  FreeBSD  these  are
24       /dev/pass0 through /dev/passX, under SunOS  it  may  be  a  file  under
25       /dev/rdsk).
26
27       The 'invert' option will invert (flip) the media (for optical jukeboxes
28       that allow such) before inserting it into the drive or returning it  to
29       the storage slot.
30
31       The  'noattach' option forces the regular media changer API even if the
32       media changer incorrectly reported that it uses the 'ATTACHED' API.
33
34       The 'nobarcode' option forces the loader to not request  barcodes  even
35       if the loader is capable of reporting them.
36
37       Following  these  options there may follow one or more robotics control
38       commands. Note that the 'invert' and 'noattach' options apply to ALL of
39       robotics control commands.
40
41

COMMANDS

43       --version Report the mtx version number (e.g. mtx 1.2.8) and exit.
44
45
46       inquiry   Report  the  product type (Medium Changer, Tape Drive, etc.),
47                 Vendor ID, Product ID, Revision, and whether  this  uses  the
48                 Attached  Changer  API (some tape drives use this rather than
49                 reporting  a  Medium  Changer  on  a  separate  LUN  or  SCSI
50                 address).
51
52       noattach  Make  further  commands  use  the  regular  media changer API
53                 rather than the _ATTACHED API, no matter what the  "Attached"
54                 bit  said  in  the Inquiry info.  Needed with some brain-dead
55                 changers that  report  Attached  bit  but  don't  respond  to
56                 _ATTACHED API.
57
58       inventory Makes  the  robot  arm  go and check what elements are in the
59                 slots. This is needed for a few  libraries  like  the  Breece
60                 Hill  ones that do not automatically check the tape inventory
61                 at system startup.
62
63       status    Reports how many drives and storage elements are contained in
64                 the  device.  For  each  drive,  reports whether it has media
65                 loaded in it, and if so, from which storage  slot  the  media
66                 originated.  For  each  storage  slot,  reports whether it is
67                 empty or full, and if the media changer has a bar  code,  MIC
68                 reader, or some other way of uniquely identifying media with‐
69                 out loading it into a drive,  this  reports  the  volume  tag
70                 and/or  alternate  volume  tag  for each piece of media.  For
71                 historical reasons drives are numbered  from  0  and  storage
72                 slots are numbered from 1.
73
74       load <slotnum> [ <drivenum> ]
75                 Load media from slot <slotnum> into drive <drivenum>. Drive 0
76                 is assumed if the drive number is omitted.
77
78       unload [<slotnum>] [ <drivenum> ]
79                 Unloads media from drive <drivenum> into slot  <slotnum>.  If
80                 <drivenum>  is  omitted,  defaults to drive 0 (as do all com‐
81                 mands).  If <slotnum> is omitted, defaults to the  slot  that
82                 the drive was loaded from. Note that there's currently no way
83                 to say 'unload drive 1's media to the  slot  it  came  from',
84                 other than to explicitly use that slot number as the destina‐
85                 tion.
86
87       [eepos <operation>] transfer <slotnum> <slotnum>
88                 Transfers media from one slot to another, assuming that  your
89                 mechanism  is capable of doing so. Usually used to move media
90                 to/from  an  import/export   port.   'eepos'   is   used   to
91                 extend/retract the import/export tray on certain mid-range to
92                 high end tape libraries (if, e.g., the tray was slot 32,  you
93                 might  say  say 'eepos 1 transfer 32 32' to extend the tray).
94                 Valid values for eepos <operation> are 0 (do nothing  to  the
95                 import/export tray), 1, and 2 (what 1 and 2 do varies depend‐
96                 ing upon the library, consult your library's SCSI-level docu‐
97                 mentation).
98
99       [eepos  <operation>]  [invert]  [invert2]  exchange <slotnum> <slotnum>
100       [<slotnum>]
101                 Move medium from the first slot to the second  slot,  placing
102                 the  medium currently in the second slot either back into the
103                 first slot or into the optional third slot.
104
105
106       first [<drivenum>]
107                 Loads drive <drivenum> from  the  first  slot  in  the  media
108                 changer.  Unloads  the  drive if there is already media in it
109                 (note: you may need to eject the tape using  your  OS's  tape
110                 control  commands  first).  Note that this command may not be
111                 what you want on large tape libraries -- e.g. on Exabyte 220,
112                 the  first  slot is usually a cleaning tape. If <drivenum> is
113                 omitted, defaults to first drive.
114
115       last [<drivenum>]
116                 Loads drive <drivenum>  from  the  last  slot  in  the  media
117                 changer.  Unloads the drive if there is already a tape in it.
118                 (Note: you may need to eject the tape using  your  OS's  tape
119                 control commands first).
120
121       previous [<drivenum>]
122                 Unloads the drive and loads the previous tape in sequence. If
123                 the drive was empty, loads the first tape into the drive.
124
125       next [<drivenum>]
126                 Unloads the drive and loads the next tape in sequence. If the
127                 drive was empty, loads the first tape into the drive.
128
129       position <slotnum>
130                 Positions the robot at a specific slot. Needed by some chang‐
131                 ers to move to and open the import/export, or mailbox, slot.
132
133       eject     Eject the tape currently in the drive.
134
135

AUTHORS

137       The original 'mtx' program was written by Leonard  Zubkoff  and  exten‐
138       sively revised for large multi-drive libraries with bar code readers by
139       Eric Lee Green <eric@badtux.org>. See 'mtx.c' for other contributors.
140

BUGS AND LIMITATIONS

142       You may need to do a 'mt offline' on the tape drive to eject  the  tape
143       before  you  can  issue the 'mtx unload' command. The Exabyte EZ-17 and
144       220 in particular will happily sit there snapping the robot arm's claws
145       around thin air trying to grab a tape that's not there.
146
147       For  some Linux distributions, you may need to re-compile the kernel to
148       scan  SCSI  LUN's  in  order  to  detect  the  media   changer.   Check
149       /proc/scsi/scsi to see what's going on.
150
151       If  you  try  to  unload  a tape to its 'source' slot, and said slot is
152       full, it will instead put the tape into the first empty slot.  Unfortu‐
153       nately  the  list of empty slots is not updated between commands on the
154       command line, so if you try to unload another drive to a full  'source'
155       slot  during the same invocation of 'mtx', it will try to unload to the
156       same (no longer empty) slot and will urp with a SCSI error.
157
158       This program reads the  Mode  Sense  Element  Address  Assignment  Page
159       (SCSI)  and  requests  data  on  all  available  elements.  For  larger
160       libraries (more than a couple dozen elements) this sets a  big  Alloca‐
161       tion_Size in the SCSI command block for the REQUEST_ELEMENT_STATUS com‐
162       mand in order to be able to read  the  entire  result  of  a  big  tape
163       library.  Some  operating  systems may not be able to handle this. Ver‐
164       sions of Linux earlier than 2.2.6, in particular, may fail this request
165       due to inability to find contiguous pages of memory for the SCSI trans‐
166       fer (later versions of Linux 'sg' device do scatter-gather so that this
167       should no longer be a problem).
168
169       The  eepos command remains in effect for all further commands on a com‐
170       mand line. Thus you might want to follow eepos 1 transfer  32  32  with
171       eepos 0 as the next command (which clears the eepos bits).
172
173       Need a better name for 'eepos' command! ('eepos' is the name of the bit
174       field in the actual low-level SCSI command, and has nothing to do  with
175       what it does).
176
177       This  program  has  only  been tested on Linux with a limited number of
178       tape loaders (a dual-drive Exabyte  220  tape  library,  with  bar-code
179       reader  and 21 slots, an Exabyte EZ-17 7-slot autoloader, and a Seagate
180       DDS-4 autochanger with 6 slots). It may not  work  on  other  operating
181       systems  with  larger  libraries,  due  to  the  big SCSI request size.
182       Please see the projecdt  page  http://sourceforge.net/projects/mtx  for
183       information on reporting bugs, requesting features and the mailing list
184       for peer support.
185

HINTS

187       Under Linux, cat /proc/scsi/scsi will tell you what  SCSI  devices  you
188       have.   You  can  then refer to them as /dev/sga, /dev/sgb, etc. by the
189       order they are reported.
190
191       Under FreeBSD, camcontrol devlist will tell you what SCSI  devices  you
192       have, along with which pass device controls them.
193
194       Under  Solaris,  set  up your 'sgen' driver so that it'll look for tape
195       changers (see /kernel/drv/sgen.conf and the sgen man page), type  touch
196       /reconfigure then reboot. You can find your changer in /devices by typ‐
197       ing /usr/sbin/devfsadm -C to clean out no-longer-extant entries in your
198       /devices  directory,  then find /devices -name \∗changer -print to find
199       the device name. Set the symbolic link /dev/changer to  point  to  that
200       device name (if it is not doing so already).
201
202       With  BRU,  set your mount and unmount commands as described on the BRU
203       web site at http://www.bru.com to move to the next tape when backing up
204       or  restoring.  With  GNU tar, see mtx.doc for an example of how to use
205       tar and mtx to make multi-tape backups.
206
207

AVAILABILITY

209       This version of mtx is currently  being  maintained  by  Robert  Nelson
210       <robertnelson@users.sourceforge.net>   .    The   'mtx'  home  page  is
211       http://mtx.sourceforge.net and the actual code is  currently  available
212       there and via SVN from http://sourceforge.net/projects/mtx.
213

SEE ALSO

215       mt(1),loaderinfo(1),tapeinfo(1),scsitape(1),scsieject(1)
216
217
218
219                                    MTX1.3                              MTX(1)
Impressum