There is a problem in the way mt handles command line arguments. If the "-f device" option is specified, subsequent arguments are mangled such that "count" always becomes 0 or "arguments" are misinterpreted. Here are some examples. (The SCSI tape driver st.c has been compiled with debugging enabled.) (1)Forward space the tape using the norewind device: bash# mt -f /dev/nst0 fsf 1 Detected scsi tape st0 at scsi1, channel 0, id 3, lun 0 st: Buffer size 32768 bytes, write threshold 30720 bytes. st: Allocated tape buffer 0 (32768 bytes, dma: 1, a: 00f98000). st: Allocated tape buffer 1 (32768 bytes, dma: 1, a: 00f90000). st0: Block limits 1 - 16777215 bytes. st0: Mode sense. Length 11, medium 0, WBS 10, BLL 8 st0: Density 25, tape length: 0, drv buffer: 1 st0: Block size: 0, buffer size: 32768 (1 blocks). st0: Spacing tape forward over 0 filemarks. st0: arg = 0. Please note: the last displayed line "st0: arg = 0.", from the st driver was added by me, it is not part of the driver as distributed. (2) Set the "debug" argument to the "stoptions" operation while using the "-f" option: bash# mt -f /dev/nst0 stoptions debug Detected scsi tape st0 at scsi1, channel 0, id 3, lun 0 st: Buffer size 32768 bytes, write threshold 30720 bytes. st: Allocated tape buffer 0 (32768 bytes, dma: 1, a: 00f98000). st: Allocated tape buffer 1 (32768 bytes, dma: 1, a: 00f90000). st0: Block limits 1 - 16777215 bytes. st0: Mode sense. Length 11, medium 0, WBS 10, BLL 8 st0: Density 25, tape length: 0, drv buffer: 1 st0: Block size: 0, buffer size: 32768 (1 blocks). Illegal property name '/dev/nst0'. The implemented property names are: buffer-writes -> buffered writes async-writes -> asynchronous writes read-ahead -> read-ahead for fixed block size debug -> debugging (if compiled into driver) two-fms -> write two filemarks when file closed fast-eod -> space directly to eod (and lose file number) auto-lock -> automatically lock/unlock drive door def-writes -> the block size and density are for writes can-bsr -> drive can space backwards well no-blklimits -> drive doesn't support read block limits can-partitions -> drive can handle partitioned tapes scsi2logical -> logical block addresses used with SCSI-2 bash# Here is a possible fix: *** mt.c.orig Sun Apr 12 00:58:25 1998 --- mt.c Mon Feb 8 17:08:10 1999 *************** *** 282,288 **** mtfd = (-1); if (comp->cmd_function != NULL) ! i = comp->cmd_function(mtfd, comp, argc - 2, &(argv [2])); else { fprintf(stderr, "mt: Internal error: command without function.\n"); i = 1; --- 282,288 ---- mtfd = (-1); if (comp->cmd_function != NULL) ! i = comp->cmd_function(mtfd, comp, argc - argn, argv + argn); else { fprintf(stderr, "mt: Internal error: command without function.\n"); i = 1; --------------------------- The author of the fix was Geoff Hort (g.hort.au) Thank you, Tim Hespe t.hespe.au
This was apparently fixed by the maintainer Kai Makisara (Kai.Makisara) on August 15 1998. I would have thought it could have made it into 5.2. This has also been reported before in reports 577 and 691. Neither is flagged as fixed. Tim Hespe (t.hespe.au)
*** This bug has been marked as a duplicate of 276 ***