scsi-changer.txt 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. README for the SCSI media changer driver
  2. ========================================
  3. This is a driver for SCSI Medium Changer devices, which are listed
  4. with "Type: Medium Changer" in /proc/scsi/scsi.
  5. This is for *real* Jukeboxes. It is *not* supported to work with
  6. common small CD-ROM changers, neither one-lun-per-slot SCSI changers
  7. nor IDE drives.
  8. Userland tools available from here:
  9. http://linux.bytesex.org/misc/changer.html
  10. General Information
  11. -------------------
  12. First some words about how changers work: A changer has 2 (possibly
  13. more) SCSI ID's. One for the changer device which controls the robot,
  14. and one for the device which actually reads and writes the data. The
  15. later may be anything, a MOD, a CD-ROM, a tape or whatever. For the
  16. changer device this is a "don't care", he *only* shuffles around the
  17. media, nothing else.
  18. The SCSI changer model is complex, compared to - for example - IDE-CD
  19. changers. But it allows to handle nearly all possible cases. It knows
  20. 4 different types of changer elements:
  21. media transport - this one shuffles around the media, i.e. the
  22. transport arm. Also known as "picker".
  23. storage - a slot which can hold a media.
  24. import/export - the same as above, but is accessible from outside,
  25. i.e. there the operator (you !) can use this to
  26. fill in and remove media from the changer.
  27. Sometimes named "mailslot".
  28. data transfer - this is the device which reads/writes, i.e. the
  29. CD-ROM / Tape / whatever drive.
  30. None of these is limited to one: A huge Jukebox could have slots for
  31. 123 CD-ROM's, 5 CD-ROM readers (and therefore 6 SCSI ID's: the changer
  32. and each CD-ROM) and 2 transport arms. No problem to handle.
  33. How it is implemented
  34. ---------------------
  35. I implemented the driver as character device driver with a NetBSD-like
  36. ioctl interface. Just grabbed NetBSD's header file and one of the
  37. other linux SCSI device drivers as starting point. The interface
  38. should be source code compatible with NetBSD. So if there is any
  39. software (anybody knows ???) which supports a BSDish changer driver,
  40. it should work with this driver too.
  41. Over time a few more ioctls where added, volume tag support for example
  42. wasn't covered by the NetBSD ioctl API.
  43. Current State
  44. -------------
  45. Support for more than one transport arm is not implemented yet (and
  46. nobody asked for it so far...).
  47. I test and use the driver myself with a 35 slot cdrom jukebox from
  48. Grundig. I got some reports telling it works ok with tape autoloaders
  49. (Exabyte, HP and DEC). Some People use this driver with amanda. It
  50. works fine with small (11 slots) and a huge (4 MOs, 88 slots)
  51. magneto-optical Jukebox. Probably with lots of other changers too, most
  52. (but not all :-) people mail me only if it does *not* work...
  53. I don't have any device lists, neither black-list nor white-list. Thus
  54. it is quite useless to ask me whenever a specific device is supported or
  55. not. In theory every changer device which supports the SCSI-2 media
  56. changer command set should work out-of-the-box with this driver. If it
  57. doesn't, it is a bug. Either within the driver or within the firmware
  58. of the changer device.
  59. Using it
  60. --------
  61. This is a character device with major number is 86, so use
  62. "mknod /dev/sch0 c 86 0" to create the special file for the driver.
  63. If the module finds the changer, it prints some messages about the
  64. device [ try "dmesg" if you don't see anything ] and should show up in
  65. /proc/devices. If not.... some changers use ID ? / LUN 0 for the
  66. device and ID ? / LUN 1 for the robot mechanism. But Linux does *not*
  67. look for LUNs other than 0 as default, because there are too many
  68. broken devices. So you can try:
  69. 1) echo "scsi add-single-device 0 0 ID 1" > /proc/scsi/scsi
  70. (replace ID with the SCSI-ID of the device)
  71. 2) boot the kernel with "max_scsi_luns=1" on the command line
  72. (append="max_scsi_luns=1" in lilo.conf should do the trick)
  73. Trouble?
  74. --------
  75. If you insmod the driver with "insmod debug=1", it will be verbose and
  76. prints a lot of stuff to the syslog. Compiling the kernel with
  77. CONFIG_SCSI_CONSTANTS=y improves the quality of the error messages a lot
  78. because the kernel will translate the error codes into human-readable
  79. strings then.
  80. You can display these messages with the dmesg command (or check the
  81. logfiles). If you email me some question because of a problem with the
  82. driver, please include these messages.
  83. Insmod options
  84. --------------
  85. debug=0/1
  86. Enable debug messages (see above, default: 0).
  87. verbose=0/1
  88. Be verbose (default: 1).
  89. init=0/1
  90. Send INITIALIZE ELEMENT STATUS command to the changer
  91. at insmod time (default: 1).
  92. timeout_init=<seconds>
  93. timeout for the INITIALIZE ELEMENT STATUS command
  94. (default: 3600).
  95. timeout_move=<seconds>
  96. timeout for all other commands (default: 120).
  97. dt_id=<id1>,<id2>,...
  98. dt_lun=<lun1>,<lun2>,...
  99. These two allow to specify the SCSI ID and LUN for the data
  100. transfer elements. You likely don't need this as the jukebox
  101. should provide this information. But some devices don't ...
  102. vendor_firsts=
  103. vendor_counts=
  104. vendor_labels=
  105. These insmod options can be used to tell the driver that there
  106. are some vendor-specific element types. Grundig for example
  107. does this. Some jukeboxes have a printer to label fresh burned
  108. CDs, which is addressed as element 0xc000 (type 5). To tell the
  109. driver about this vendor-specific element, use this:
  110. $ insmod ch \
  111. vendor_firsts=0xc000 \
  112. vendor_counts=1 \
  113. vendor_labels=printer
  114. All three insmod options accept up to four comma-separated
  115. values, this way you can configure the element types 5-8.
  116. You likely need the SCSI specs for the device in question to
  117. find the correct values as they are not covered by the SCSI-2
  118. standard.
  119. Credits
  120. -------
  121. I wrote this driver using the famous mailing-patches-around-the-world
  122. method. With (more or less) help from:
  123. Daniel Moehwald <moehwald@hdg.de>
  124. Dane Jasper <dane@sonic.net>
  125. R. Scott Bailey <sbailey@dsddi.eds.com>
  126. Jonathan Corbet <corbet@lwn.net>
  127. Special thanks go to
  128. Martin Kuehne <martin.kuehne@bnbt.de>
  129. for a old, second-hand (but full functional) cdrom jukebox which I use
  130. to develop/test driver and tools now.
  131. Have fun,
  132. Gerd
  133. --
  134. Gerd Knorr <kraxel@bytesex.org>