413 lines · 8.6 KB · Text
RawDownload
.TH SCUZZ 8.SH NAMEscuzz \- SCSI target control.SH SYNOPSIS.B scuzz[.B -6eq] [.B -m.I max-xfer] [[.B -r].I sddev].SH DESCRIPTION.I Scuzzis an interactive program for exercisingraw SCSI devices.Its intended purpose is to investigate and manipulateodd devices without the effort of writing a special driver,such as shuffling the media around on an optical jukebox.It reads commands from standard input and applies them to a SCSI target(other devices accessed through the.IR sd (3)interface,such as ATA(PI) devices,may also work).If.I sddevis given on the command line, an.B open(see below)is immediately applied to the target.On successful completion of a command,.BI ok " nis printed, where.I nis the number of bytes transferred to/from the target;the.B -qcommand line option suppresses the.B okmessage..LPThe.B -6forces the use of 6-byte SCSI commands rather than 10-byte ones.Some older devices require this, though.I scuzzattempts to adapt automatically.The.B -emakes.I scuzzmore willing to retry I/O errors but less tolerant of other errorsand implies.BR -6 .This option is often needed to read Exabyte 8mm tapes.The.B -moption sets the maximum I/O transfer size to.IR max-xfer .Exabyte drives often require this to be 1024 or the exact tape block sizeand some 4mm drives require this to be the exact tape block size or larger..SS Commands.TF "inquiry".PD.TP.BI help " command.B Helpis rudimentary and prints a one line synopsis for the named.IR command ,or for all commands if no argument is given..TP.B probe.B Probeattempts an.B inquirycommand on all SCSI units,and prints the result preceded by the name of thosetargets which respond..LPThe.B helpand.B probecommands may be given at any time..TF "inquiry".PD.TP.BI open\ [ -r ] sddev.B Openmust be given before any of the remaining commands will be accepted.Internally,unless the.B -roption is given,.B openissues.B readythen.BR inquiry ,followed by a device class-specific command to determine thelogical block size of the target..I Sddevis an.IR sd (3)device directory like.IR /dev/sdC0 ..TP.B close.B Closeneed only be given if another target is to be opened in the currentsession..LPThe remaining commands are in rough groups,intended for specific classes of device.With the exception of the.BR read ,.BR write ,and.B spacecommands,all arguments are in the style of ANSI-C integer constants..TF "inquiry".PD.TP.B readyTest Unit Readychecks if the unit is powered up and ready to do.B readand.B writecommands..TP.B rezeroRezeroUnit requests that a disk be brought to a known state,usually by seeking to track zero..TP.B rewind.B Rewindpositions a tape at the beginning of current partition(there is usually only one partition, the beginning of tape)..TP.B reqsenseRequest Sense retrieves Sense Data concerning an error orother condition and is usually issued following the completion of a commandthat had check-condition status..I Scuzzautomatically issues a.B reqsensein response to a check-condition status and prints the result..TP.B formatFormatUnit performs a ``low level'' format of a disk..TP.B rblimitsRead Block Limitsreports the possible block lengths for the logical unit. Tapes only..TP.BI read " file nbytes.B Readtransfers data from the target to the host.A missing.I nbytescauses the entire device to be read..TP.BI write " file nbytes.B Writetransfers data from the host to the target.A missing.I nbytescauses the entire input file to be transferred..IPThe first argument to the.BR readand.BR writecommands specifies a source.RB ( write )or destination.RB ( read )for the I/O.The argument is either a plain file name or.B |followed by a command to be executed by.IR rc (1).The argument may be quoted in the style of.IR rc (1)..TP.BI seek " offset whence.B Seekrequests the target to seek to a position on a disk,arguments being in the style of.IR seek (2);.I whenceis 0 by default..IP.I Scuzzmaintains an internal notion of where the current targetis positioned.The.BR seek ,.BR read ,.BR write ,.BR rewind ,.BR rezero ,and.B wtrackcommands all manipulate the internal offset..TP.BI filemark " howmanyWrite Filemarkswrites one (default) or more filemarks on a tape..TP.BI space\ [ -b ]\ [ -f ]\ [[ "--\fP]\fIhowmany\fP]".B Spacepositions a tape forwards or backwards.The argumentsspecify logical block.RB ( -b )orfilemark.RB ( -f )spacing;default is.BR -b .If.I howmanyis negativeit specifies spacing backwards,and should be preceded by.B --to turn off any furtheroption processing.Default is 1..TP.B inquiry.B Inquiryis issued to determine the device type of a particular target,and to determine some basic information about the implemented options andthe product name..TP.BI modeselect bytes....TP.BI modeselect6 bytes...ModeSelectis issued to set variable parameters in the target..I Bytesgiven as arguments comprise all the data for the target;see an appropriate manual for the format.The default is the 10-byte form of the command;modeselect6 is the 6-byte version..TP.BI modesense\ [ page [ nbytes ]].TP.BI modesense6\ [ page [ nbytes ]]ModeSensereports variable and fixed parameters from the target.If no.I pageis given,all pages are returned..I Nbytesspecifies how many bytes should be returned.The default is the 10-byte form of the command;modesense6 is the 6-byte version..TP.BI start\ [ code ].TP.BI stop\ [ code ].TP.BI eject\ [ code ].TP.BI ingest\ [ code ].BR Start ,.BR stop ,.BR eject ,and.B ingestare synonyms for Start/Stop Unit with different default values of.IR code .Start/Stop Unit is typically used to spin up and spin down a rotatingdisk drive..I Codeis 0 to stop,1 to start and3 to eject (if the device supports ejection of the medium)..TP.B capacityRead Capacity reports the number of blocks and the blocksize of a disk..LPThe following commands are specific to CD and CD-R/RW devices.A brief description of each is given; see the SCSI-3Multimedia Commands (MMC) Specification for details of argumentsand interpretation of the results..TF "inquiry".PD.TP.BI blank\ [ track/LBA [ type ]]Erase a CD-RW disk.Type identifies the method and coverage of the blanking..TP.BI rtoc\ [ track/session-number [ ses ]]The Read TOC/PMA command transfers data from one of the tables of contents(TOC or PMA) on the CD medium..TP.B rdiscinfo(Note the spelling.)Provides information about disks, including incomplete CD-R/RW..TP.BI rtrackinfo\ [ track ]Provides information about a track, regardless of its status..TP.B cdpause.TP.B cdresumePause/resume playback..TP.B cdstopStop playback..TP.BI cdplay\ [ track-number ]\ or\ [ -r [ "LBA\fP[\fIlength\fP]]]"Play audio.With no arguments, starts at the beginning of the medium.If a track number is given, the table of contents is readto find the playback start point.If the.B -roption is given, block addressing is used to find theplayback start point..TP.BI cdload\ [ slot ].TP.BI cdunload\ [ slot ]Load/unload a disk from a changer..TP.B cdstatusRead the mechanism status..LPThe following commands are specific to Media Changer devices.A brief description of each is given; see the SCSI-3Medium Changer Commands (SMC) Specification for details of arguments..TF "inquiry".PD.TP.B einitInitialize element status..TP.BI "estatus " "type " [ length ]Report the status of the internal elements.Type 0 reports all element types..TP.BI "mmove " transport\ source\ destination [ invert ]Move medium..SH FILES.TF /dev/sdXX/raw.TP.B /dev/\fIsdXX\fP/rawraw SCSI interface for command, I/O, and status..SH SOURCE.B /sys/src/cmd/scuzz.SH "SEE ALSO".IR sd (3).br.IR "Small Computer System Interface - 2 (X3T9.2/86-109)" ,Global Engineering Documents.br.IR "SCSI Bench Reference" ,ENDL Publications.br.IR "SCSI-3 Multimedia Commands (MMC) Specification" ,www.t10.org.br.IR "SCSI-3 Medium Changer Commands (SMC) Specification" ,www.t10.org.SH BUGSOnly a limited subset of SCSI commands has been implemented (as needed)..LPOnly one target can be open at a time..LPLUNs other than 0 are not supported..LPNo way to force 10-byte commands, though they are the default..LPShould be recoded to use.IR scsi (2)in order to get more complete sense code descriptions..LP.I Scuzzbetrays its origins by spelling.B rdiscinfowith a.B ceven though the devices it manipulates are spelled with a.BR k ..LPThe.I max-xfervalue is currently limited to 245760to limit kernel memory consumption..LPIt may be necessary to set.I max-xferto exactly the block size used to write a tapein order to read it on some drives.