Return to BSD News archive
Newsgroups: comp.os.386bsd.questions Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!spool.mu.edu!umn.edu!csus.edu!netcom.com!alm From: alm@netcom.com (Andrew Moore) Subject: Re: Beginner tape questions (was Re: question in using scsi tape drive) Message-ID: <almCCBB21.4Ez@netcom.com> Organization: Netcom Online Communications Services (408-241-9760 login: guest) References: <CC8u4z.LLH@usenet.ucs.indiana.edu> <almCC93oE.Ao1@netcom.com> Date: Wed, 25 Aug 1993 11:10:49 GMT Lines: 191 Julian asked me to post the following reply (thanks Julian!): In article <almCC93oE.Ao1@netcom.com> alm@netcom.com (Andrew Moore) writes: >In article <CC8u4z.LLH@usenet.ucs.indiana.edu> "(Mr.) C. Y. Kung" <ckung@nickel.ucs.indiana.edu> writes: >> >>Hi, can anyone help me in using scsi tape drive? >>Does the tape need to be formatted? > >It depends, but I think usually not. And when it is necessary, >I don't know how it would be done. > >I am just learning how to use tape myself. >Here's an additional list of questions that would be nice to see >answered in the FAQ: > >I just got an Archive Viper 2150s (aka Viper 150, evidently) tape drive >and have some general questions about using tape. To avoid delving too >deep into the code, any answers you can offer are appreciated. I'll try, I've been looking at the tape driver recently. > >Q1. >$ st -f /dev/st0 status >Archive/Tandberg? tape drive, residual=0, blocksize=512 >Density: high = 16 (0x10), medium = 15 (0xf), low = 5 (0x5) >ds=0 >er=0 > >so to write to tape at high-density (QIC-150), presumably I want to use >a device with minor number 4+ (in st.c, density is computed as >minor >> 2 & 0x03, where low density == 3 and high == 1): >$ ls -l /dev/*st4 >crw-rw-r-- 1 root 14, 5 Aug 6 19:17 /dev/nrst4 >brw-rw-r-- 1 root 5, 5 Aug 6 19:17 /dev/nst4 >crw-rw-r-- 1 root 14, 4 Aug 6 19:17 /dev/rst4 >brw-rw-r-- 1 root 5, 4 Aug 6 19:16 /dev/st4 first.... NEVER use the block devices.. erase them and forget you ever saw them. but yes, you have the idea.. density is controlled by bits 2 and 3 00 = default 01 = hi density 10 = medium density 11 = low density, however unless the driver knows about you kind of drive the density values may need to be set by hand before they make any sense. (using the 'st' program you used above) > >Is this correct? BTW, when is erst4 used? >crw-rw-r-- 1 root 14, 6 Aug 6 19:17 /dev/erst4 e stands for 'eject' and is bit 1 of the minor.. e.g. eject on close.. many devices can't actually do this. > >Q2. >How is density (bpi) computed? I am using 3M DC 6250 cassettes which >have a 250MB capacity on the Viper 150. But computing the bits/inch >based on 250MB/tape-length (1020 ft.), I get a density of 171335 bpi, >which is nowhere near the 10000 bpi associated with QIC-150 in the st(1) >man page. Why the discrepancy? how many times does the tape go backwards and forwards? QIC tapes usually record on many tracks going backwards and forwards, so if there were 17 tracks ....... > >Q3. >How is an appropriate block size determined (and in what units are they >specified in the st(1) command)? QIC 150 and below should stick to 512 byte blocks a write of 1024 bytes from the program will be written as 2 512 byte blocks with no speed penalty. dd will think it's writing a 1024 byte block but on tape it's 2 x 512. stick to 512 on QIC 150 or less if you ever hope to swap data with anyone else. > >From the 4.3BSD mtio(4) man page, it sounds like data is typically >(traditionally?) stored on tape in eof-terminated sequences of 1 kiokbyte >records. So first of all, is st's notion of "file" the record sequence >between two eof marks? What about a "record"? Is a "record" one >"block", as determined by st's "blocksize" command? If not, what is >the connection between them? Can I change the "record" size? When >would I want a block size that is different from the default? > no th 1KB is the size of writes used by dd or whatever. QIC specifies 512 (well at least its what people use..) whatever you write in will be broken into 512 byte sections. They must be multiples of 512 though. If you have written to a tape, a close will automatically append a filemark (eof mark) You may read the 512 byte blocks back as 512 byte records or as 1024 byte records (in which case you'll get 2 at once). the bigger the unit, the more efficient. >Q4. >How do I write several archives to a single tape? >I tried without success: > >$ st -f /dev/rst4 rewind >$ tar cf /dev/nst4 archive1 >$ st -f /dev/nrst4 weof >$ tar cf /dev/nst4 archive2 >$ st -f /dev/nrst4 weof > throw away teh block devices. n stands for 'No-Rewind-on-close' and will leave the tape positionned ready for another file. e.g. tar -cf /dev/nrst0 archive1 tar -cf /dev/nrst0 archive2 >And so on. Any suggestions? BTW, when tar'ing/cpio'ing/dd'ing to tape, >is one of the block or character devices more appropriate? Is either ever >not appropriate? > >Later I would expect to be able to access, say, archive3 via: > >$ st -f /dev/rst0 rewind >$ st -f /dev/nrst0 fsf 2 >$ tar xf /dev/st0 # extract archive3 > st -f /dev/nrst0 rewind st -f /dev/nrst0 fsf 2 tar -xf /dev/nrst0 {files} st -f /dev/nrst0 rewind <----- not needed if you used rst0 for the tar. >What is a correct sequence for this? > >Q5. >Since the Viper 150 writes on QIC-150/120, I guess I don't need to >worry able variable-length records? How about reading a tape written >with variable-length records. Is this possible with the Viper? >If so, what's involved? > who would have written it? presently you can't. you`re right.. don't worry about it.. new st changes will change this somewhat though. >Q6. >The very scant documentation that came with my drive mentions >a "selectable buffer disconnect size," whose default is 16K. >This is evidently the "maximum number of bytes that can be sent over >the SCSI bus during a single data transfer phase." What's that? >How is it connected st's "blocksize" command? Do I want to >use 16K blocks, or might I even want to set the disconnect size to a >higher value? this suggests that 32 512 blocks will be written at a time.. use dd or tar with 16 k blocks and 32 x 512 byte blocks will be written. > >Q7. >What is "streaming"? When I tar a directory of files to tape, >I notice that the tape often stops. Streaming means it doesn't stop? >How would I get the viper 150 to stream using tar or cpio or dump? > use a bigger write size... (more efficient) >Q8. >Where are all the answers to the above and related questions written >down? Neither on the net nor in the 4.3BSD manuals nor Administration text >which I have could I find this stuff covered! > >Q9. >What else should I know? For example, it seems that a new tape must >stretched. How is this done? use a blowtorce and a pair of pliers. > >If I can collect enough information, maybe I'll even write up a "tape" >man page. Thanks! >-Andrew Moore <alm@netcom.com> you! I thought this was a newby till I got to the name! julian