home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!haven.umd.edu!umd5!umd5.umd.edu!anderson
- From: anderson@sapir.cog.jhu.edu (Steve Anderson)
- Newsgroups: comp.sys.next.hardware
- Subject: Re: Sun "Archive Python" Tape Drive
- Message-ID: <ANDERSON.92Sep2074128@sapir.cog.jhu.edu>
- Date: 2 Sep 92 11:41:28 GMT
- References: <1992Sep2.023035.11992@ee.gatech.edu>
- Sender: news@umd5.umd.edu
- Organization: Dept. of Cognitive Science, The Johns Hopkins University
- Lines: 50
- In-reply-to: lockhart@eecom.gatech.edu's message of 2 Sep 92 02:30:35 GMT
-
- This has to be the hundredth time this question has been asked.
-
- I think you'll find that the problem is due to the fact that (at least
- in 2.x) the SCSI tape driver assumes variable block size, and the
- Archive (along with lots of other drives) wants fixed blocks. What you
- have to do is reset the driver. Attached is a bit of code posted to
- (the ancestor of) this newsgroup last year; compile it, and run it
- once to reset the driver. Your Archive drive should then work. You'll
- have to rerun it if you reboot; if the Archive (or other fixed
- blocksize device) is the only device you use the SCSI tape driver
- with, you might want to run it automatically from rc.local at tboot
- time.
-
- I would have responded by mail, but this question shows up often
- enough that I thought someone else out there might also be wondering,
- and the code is really pretty short.
-
- --Steve Anderson
-
- ----------------(included file setmtd.c)--------------------
- /*
- * setmd - set SCSI tape driver to a fixed block size
- * by John L. Chmielewski
- * Tue Feb 19, 1991
- */
-
- #include <fcntl.h>
- #include <sys/types.h>
- #include <nextdev/scsireg.h>
-
- #define RSTDEVICE "/dev/rst0"
- #define BLOCKSIZE 512
-
- main()
- {
- int fd, size = BLOCKSIZE;
-
- if ((fd = open(RSTDEVICE, O_RDWR)) < 0)
- {
- perror(RSTDEVICE);
- exit(1);
- }
- if (ioctl(fd, MTIOCFIXBLK, &size) < 0)
- {
- perror("ioctl");
- exit(1);
- }
- (void) close(fd);
- return 0;
- }
-