📄 scsitape.1
字号:
.\" scsitape.1 Document Copyright 2001 Eric Lee Green.\".\" This is free documentation; you can redistribute it and/or.\" modify it under the terms of the GNU General Public License as.\" published by the Free Software Foundation; either version 2 of.\" the License, or (at your option) any later version..\".\" The GNU General Public License's references to "object code".\" and "executables" are to be interpreted as the output of any.\" document formatting or typesetting system, including.\" intermediate and printed output..\".\" This manual is distributed in the hope that it will be useful,.\" but WITHOUT ANY WARRANTY; without even the implied warranty of.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the.\" GNU General Public License for more details..\".\" You should have received a copy of the GNU General Public.\" License along with this manual; if not, write to the Free.\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,.\" USA..\".TH SCSITAPE 1 SCSITAPE1.0.SH NAMEscsitape \- control SCSI tape devices .SH SYNOPSISscsitape [-f <scsi-generic-device>] commands.SH DESCRIPTIONThe .B scsitapecommand controls SCSI tape drives in a platform-independentmanner. As long as 'mtx' works on the platform, so does 'scsitape'. .PNote that 'scsitape' and your OS's native tape driver may stomp on eachother. In particular, if you use 'setblk' and your OS's native tapedriver has a different notion of the block size, you may get evil results.It is recommended to use 'scsitape' only for software where you've writtenyour own low-level READ and WRITE routines that use the SCSI command setto directly talk to tape drives (i.e., you do not use the OS's native tapedriver at all). .SH OPTIONSThe first argument, given following.B -f, is the SCSI generic device corresponding to your tape drive.Consult your operating system's documentation for more information (forexample, under Linux these are generally /dev/sg0 through /dev/sg15, under FreeBSD these are /dev/pass0 through /dev/passX. Under Solaristhis is usually the same as your tape drive (Solaris has a SCSI passthroughioctl). You can set the STAPE or TAPE environment variable ratherthan use -f..P.SH COMMANDS.TP 10.B setblk <n>Set the tape drive's SCSI block size to <n> bytes. (NOTE: if you areusing your OS's native tape driver, THIS IS EVIL!). .TP 10.B fsf <n>Go forward by <n> tapemarks..TP 10.B bsf <n>Go to immediately previous the <n>th previous tapemark. (WARNING: Thisprobably doesn't do what you expect -- e.g. if you are immediatelyafter a tapemark and type 'bfs 1', it moves to immediately *before*that tape mark, for a sum total of zero effective movement!)..TP 10.B eodGo to end of data. .TP 10.B rewindRewind the tape drive..TP 10.B ejectEject the tape currently in the drive..TP 10.B eraseDoes a *short* erase (warning: does NOT work on all drives!). .TP 10.B mark <n> write <n> filemarks ( 'mark 0' flushes the drive's buffers ). .TP 10.B seek <n>Seek to a logical position <n> that was reported by a previous 'tapeinfo'command. .TP 10.B write <blocksize> write blocks from stdin to the tape. Chunk the data into <blocksize>-sizedchunks. *DOES NOT WRITE OUT A TAPEMARK!* (you will need to use a subsequent.B mark 1command to write out a tape mark). .TP 10.B read [<blocksize>] [ <#blocks/#bytes> ]read blocks from the tape, write them to stdout. If we are in variableblock mode, <blocksize> should be zero (note: The maximum block sizewe currently support in variable block mode is 128K, MAX_READ_SIZE willneed to be turned into a settable variable to allow bigger reads). If<blocksize> is ommitted, we assume that we're in variable block mode, andthat we are going to read from tape until we hit a tapemark or end ofpartition or end of tape. .SH AUTHORSThis program was written by Eric Lee Green <eric@estinc.com>. Major portions of the 'mtxl.c' library used herein were written byLeonard Zubkoff. .PThe SCSI read and write routines are based upon those that RichardFish wrote for Enhanced Software Technology's BRU 16.1 product,substantially modified to work in our particular environment (inparticular, all the variable block stuff is new since BRU only doesfixed block reads and writes, and the BRU code uses bitmasks ratherthan bitfields for the various flags and such in return values, aswell as the BRU code having a different SCSI API and having variablenames considerably shorter than the rather sesquipedalian 'mtx'identifiers). As required by 'mtxl.c', these routines are licensedunder the GNU General Public License..SH HINTSUnder Linux, .B cat /proc/scsi/scsiwill tell you what SCSI devices you have.You can then refer to them as .B /dev/sga,.B /dev/sgb, etc. by the order theyare reported..PUnder FreeBSD, .B camcontrol devlistwill tell you what SCSI devices youhave, along with which .B passdevice controls them..PUnder Solaris 7 and 8,.B /usr/sbin/devfsadm -Cwill clean up your /devices directory. Then.B find /devices -name 'st@*' -print will return a list of all tape drives. /dev on Solaris is apparently onlyof historical interest. .SH BUGS AND LIMITATIONSfor.B scsitape read 0 <n>where you are doing variable-block-size reads and wish for <n> bytes,it instead reads one and exactly one block from tape and prints that(no matter what its size). Use 'dd' on the output of scsitape if youwant finer control. .P.B scsitape read 0attempts reads of MAX_READ_SIZE, which is currently 128K. If blocks on tapeare larger than 128K, only the first 128K will be read -- the remainderwill be silently dumped in the toilet..PThis program does not interact well (or at all :-) with your OS'snative tape driver. You will likely see weird things happen if youattempt to intermingle scsitape commands with native tape driveroperations. Note that BRU 16.1 for Solaris (and possibly others, butSolaris I know about) will have a 'scsi' keyword to bypass the native tape driver and write via direct uscsi commands, so if you use'scsitape' to bypass the flaws of the native Solaris driver, you can useBRU 16.1 to write your actual tape archives. (Assuming that BRU 16.1has been released at the time that you read this). .SH AVAILABILITYThis version of .B scsitapeis currently being maintained by Eric Lee Green <eric@badtux.org> formerly ofEnhanced Software Technologies Inc. as part of the 'mtx' suite ofprograms. The 'mtx' home page is http://mtx.sourceforge.net and theactual code is currently available there and via CVS fromhttp://sourceforge.net/projects/mtx . .SH SEE ALSO.BR tapeinfo (1), mtx (1)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -