1
0

scuzz 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. .TH SCUZZ 8
  2. .SH NAME
  3. scuzz \- SCSI target control
  4. .SH SYNOPSIS
  5. .B scuzz
  6. [
  7. .B -q
  8. ]
  9. [
  10. [
  11. .B -r
  12. ]
  13. .I sddev
  14. ]
  15. .SH DESCRIPTION
  16. .I Scuzz
  17. is an interactive program for exercising
  18. raw SCSI devices.
  19. Its intended purpose is to investigate and manipulate
  20. odd devices without the effort of writing a special driver,
  21. such as shuffling the media around on an optical jukebox.
  22. It reads commands from standard input and applies them to a SCSI target
  23. (other devices accessed through the
  24. .IR sd (3)
  25. interface,
  26. such as ATA(PI) devices,
  27. may also work).
  28. If
  29. .I sddev
  30. is given on the command line, an
  31. .B open
  32. (see below)
  33. is immediately applied to the target.
  34. On successful completion of a command,
  35. .BI ok " n
  36. is printed, where
  37. .I n
  38. is the number of bytes transferred to/from the target;
  39. the
  40. .B -q
  41. command line option suppresses the
  42. .B ok
  43. message.
  44. .SS Commands
  45. .TP
  46. .BI help " command
  47. .B Help
  48. is rudimentary and prints a one line synopsis for the named
  49. .IR command ,
  50. or for all commands if no argument is given.
  51. .TP
  52. .B probe
  53. .B Probe
  54. attempts an
  55. .B inquiry
  56. command on all SCSI units,
  57. and prints the result preceded by the name of those
  58. targets which respond.
  59. .LP
  60. The
  61. .B help
  62. and
  63. .B probe
  64. commands may be given at any time.
  65. .TP
  66. .BI open\ [ -r ] sddev
  67. .B Open
  68. must be given before any of the remaining commands will be accepted.
  69. Internally,
  70. unless the
  71. .B -r
  72. option is given,
  73. .B open
  74. issues
  75. .B ready
  76. then
  77. .BR inquiry ,
  78. followed by a device class-specific command to determine the
  79. logical block size of the target.
  80. .I Sddev
  81. is an
  82. .IR sd (3)
  83. device directory like
  84. .IR /dev/sdC0 .
  85. .TP
  86. .B close
  87. .B Close
  88. need only be given if another target is to be opened in the current
  89. session.
  90. .LP
  91. The remaining commands are in rough groups,
  92. intended for specific classes of device.
  93. With the exception of the
  94. .BR read ,
  95. .BR write ,
  96. and
  97. .B space
  98. commands,
  99. all arguments are in the style of ANSI-C integer constants.
  100. .TP
  101. .B ready
  102. Test Unit Ready
  103. checks if the unit is powered up and ready to do
  104. .B read
  105. and
  106. .B write
  107. commands.
  108. .TP
  109. .B rezero
  110. Rezero
  111. Unit requests that a disk be brought to a known state,
  112. usually by seeking to track zero.
  113. .TP
  114. .B rewind
  115. .B Rewind
  116. positions a tape at the beginning of current partition
  117. (there is usually only one partition, the beginning of tape).
  118. .TP
  119. .B reqsense
  120. Request Sense retrieves Sense Data concerning an error or
  121. other condition and is usually issued following the completion of a command
  122. that had check-condition status.
  123. .I Scuzz
  124. automatically issues a
  125. .B reqsense
  126. in response to a check-condition status and prints the result.
  127. .TP
  128. .B format
  129. Format
  130. Unit performs a ``low level'' format of a disk.
  131. .TP
  132. .B rblimits
  133. Read Block Limits
  134. reports the possible block lengths for the logical unit. Tapes only.
  135. .TP
  136. .BI read " file nbytes
  137. .B Read
  138. transfers data from the target to the host.
  139. A missing
  140. .I nbytes
  141. causes the entire device to be read.
  142. .TP
  143. .BI write " file nbytes
  144. .B Write
  145. transfers data from the host to the target.
  146. A missing
  147. .I nbytes
  148. causes the entire input file to be transferred.
  149. .IP
  150. The first argument to the
  151. .BR read
  152. and
  153. .BR write
  154. commands specifies a source
  155. .RB ( write )
  156. or destination
  157. .RB ( read )
  158. for the I/O.
  159. The argument is either a plain file name or
  160. .B |
  161. followed by a command to be executed by
  162. .IR rc (1).
  163. The argument may be quoted in the style of
  164. .IR rc (1).
  165. .TP
  166. .BI seek " offset whence
  167. .B Seek
  168. requests the target to seek to a position on a disk,
  169. arguments being in the style of
  170. .IR seek (2);
  171. .I whence
  172. is 0 by default.
  173. .IP
  174. .I Scuzz
  175. maintains an internal notion of where the current target
  176. is positioned.
  177. The
  178. .BR seek ,
  179. .BR read ,
  180. .BR write ,
  181. .BR rewind ,
  182. .BR rezero ,
  183. and
  184. .B wtrack
  185. commands all manipulate the internal offset.
  186. .TP
  187. .BI filemark " howmany
  188. Write Filemarks
  189. writes one (default) or more filemarks on a tape.
  190. .TP
  191. .BI space\ [ -b ]\ [ -f ]\ [[ "--\fP]\fIhowmany\fP]"
  192. .B Space
  193. positions a tape forwards or backwards.
  194. The arguments
  195. specify logical block
  196. .RB ( -b )
  197. or
  198. filemark
  199. .RB ( -f )
  200. spacing;
  201. default is
  202. .BR -b .
  203. If
  204. .I howmany
  205. is negative
  206. it specifies spacing backwards,
  207. and should be preceded by
  208. .B --
  209. to turn off any further
  210. option processing.
  211. Default is 1.
  212. .TP
  213. .B inquiry
  214. .B Inquiry
  215. is issued to determine the device type of a particular target,
  216. and to determine some basic information about the implemented options and
  217. the product name.
  218. .TP
  219. .BI modeselect bytes...
  220. .TP
  221. .BI modeselect6 bytes...
  222. Mode
  223. Select
  224. is issued to set variable parameters in the target.
  225. .I Bytes
  226. given as arguments comprise all the data for the target;
  227. see an appropriate manual for the format.
  228. The default is the 10-byte form of the command;
  229. modeselect6 is the 6-byte version.
  230. .TP
  231. .BI modesense\ [ page [ nbytes ]]
  232. .TP
  233. .BI modesense6\ [ page [ nbytes ]]
  234. Mode
  235. Sense
  236. reports variable and fixed parameters from the target.
  237. If no
  238. .I page
  239. is given,
  240. all pages are returned.
  241. .I Nbytes
  242. specifies how many bytes should be returned.
  243. The default is the 10-byte form of the command;
  244. modesense6 is the 6-byte version.
  245. .TP
  246. .BI start\ [ code ]
  247. .TP
  248. .BI stop\ [ code ]
  249. .TP
  250. .BI eject\ [ code ]
  251. .TP
  252. .BI ingest\ [ code ]
  253. .BR Start ,
  254. .BR stop ,
  255. .BR eject ,
  256. and
  257. .B ingest
  258. are synonyms for Start/Stop Unit with different default values of
  259. .IR code .
  260. Start/Stop Unit is typically used to spin up and spin down a rotating
  261. disk drive.
  262. .I Code
  263. is 0 to stop,
  264. 1 to start and
  265. 3 to eject (if the device supports ejection of the medium).
  266. .TP
  267. .B capacity
  268. Read Capacity reports the number of blocks and the block
  269. size of a disk.
  270. .LP
  271. The following commands are specific to CD and CD-R/RW devices.
  272. A brief description of each is given; see the SCSI-3
  273. Multimedia Commands (MMC) Specification for details of arguments
  274. and interpretation of the results.
  275. .TP
  276. .BI blank\ [ track/LBA [ type ]]
  277. Erase a CD-RW disk.
  278. Type identifies the method and coverage of the blanking.
  279. .TP
  280. .BI rtoc\ [ track/session-number [ ses ]]
  281. The Read TOC/PMA command transfers data from one of the tables of contents
  282. (TOC or PMA) on the CD medium.
  283. .TP
  284. .B rdiscinfo
  285. (Note the spelling.)
  286. Provides information about disks, including incomplete CD-R/RW.
  287. .TP
  288. .BI rtrackinfo\ [ track ]
  289. Provides information about a track, regardless of its status.
  290. .TP
  291. .B cdpause
  292. .TP
  293. .B cdresume
  294. Pause/resume playback.
  295. .TP
  296. .B cdstop
  297. Stop playback.
  298. .TP
  299. .BI cdplay\ [ track-number ]\ or\ [ -r [ "LBA\fP[\fIlength\fP]]]"
  300. Play audio.
  301. With no arguments, starts at the beginning of the medium.
  302. If a track number is given, the table of contents is read
  303. to find the playback start point.
  304. If the
  305. .B -r
  306. option is given, block addressing is used to find the
  307. playback start point.
  308. .TP
  309. .BI cdload\ [ slot ]
  310. .TP
  311. .BI cdunload\ [ slot ]
  312. Load/unload a disk from a changer.
  313. .TP
  314. .B cdstatus
  315. Read the mechanism status.
  316. .LP
  317. The following commands are specific to Media Changer devices.
  318. A brief description of each is given; see the SCSI-3
  319. Medium Changer Commands (SMC) Specification for details of arguments.
  320. .TP
  321. .B einit
  322. Initialize element status.
  323. .TP
  324. .BI estatus type [ length ]
  325. Report the status of the internal elements.
  326. Type 0 reports all element types.
  327. .TP
  328. .BI mmove transport\ source\ destination [ invert ]
  329. Move medium.
  330. .SH FILES
  331. .TF /dev/sdXX/raw
  332. .TP
  333. .B /dev/\fIsdXX\fP/raw
  334. raw SCSI interface for command, I/O, and status.
  335. .SH SOURCE
  336. .B /sys/src/cmd/scuzz
  337. .SH "SEE ALSO"
  338. .IR sd (3)
  339. .br
  340. .IR "Small Computer System Interface - 2 (X3T9.2/86-109)" ,
  341. Global Engineering Documents
  342. .br
  343. .IR "SCSI Bench Reference" ,
  344. ENDL Publications
  345. .br
  346. .IR "SCSI-3 Multimedia Commands (MMC) Specification" ,
  347. www.t10.org
  348. .br
  349. .IR "SCSI-3 Medium Changer Commands (SMC) Specification" ,
  350. www.t10.org
  351. .SH BUGS
  352. Only a limited subset of SCSI commands has been implemented (as needed).
  353. .LP
  354. Only one target can be open at a time.
  355. .LP
  356. LUNs other than 0 are not supported.
  357. .LP
  358. No way to force 6- or 10- byte commands.
  359. .LP
  360. Should be recoded to use
  361. .IR scsi (2)
  362. in order to get more complete sense code descriptions.
  363. .LP
  364. .I Scuzz
  365. betrays its origins by spelling
  366. .B rdiscinfo
  367. with a
  368. .B c
  369. even though the devices it manipulates are spelled with a
  370. .BR k .