ftp.nice.ch/pub/next/unix/scsi/scsitools_new.N.bs.tar.gz#/scsitools

Makefile
 
PARMFILES/
 
README
 
formatter
 
inquire
 
inquire.c
[View inquire.c] 
mtset
 
mtset.c
[View mtset.c] 
select
 
select.c
[View select.c] 
sense
 
sense.c
[View sense.c] 
sense1
 
sense1.c
[View sense1.c] 
setmtd
 
setmtd.c
[View setmtd.c] 

README

This is a collection of SCSI tools/utilities that I use that may be of interest to others.

setmtd.c - 	set SCSI tape driver to a fixed block size
			by John L. Chmielewski
			by David D. Johnson (ddj@gradient.com)
			
mtset.c  - 	set SCSI tape driver characteristics
			by John L. Chmielewski
			by David D. Johnson (ddj@gradient.com)
			by Charles Chambers
			
			
sense.c  - 	Generates listing of SCSI sense mode pages for SCSI disk which
		can be used by select program to modify SCSI disk parameters  
		(like sector size among other things).
			by Charles Chambers

select.c  - 	SCSI select mode pages for SCSI disk, output from sense
		program can be used to modify SCSI disk parameters (like sector
		size among other things). Checks for consistency between disk
		and input parameters.
			by Charles Chambers

inquire.c -	SCSI inquire listing of all SCSI devices on bus.			
			by Charles Chambers
			

Various notes:
===========================================================================
Notes on inquire,sense,select:

FIRST, USE AT YOUR OUR RISK. I NOT NOT BE RESPONSIBLE FOR PROBLEM CAUSED BY THESE PROGRAMS.

Note that I have only tested these programs on a small number of drives (see PARAMETERS directories). BE CAREFUL, if you do not know what you are doing, then I recommend that you not use it. But it is very useful for those people that do know.

I received a Maxtor XT8760 that had been formatted for 512 byte sectors. I wished to change this to the 1024 byte sectors, but lacked the tools. So, when
Roy Bolters SCSI formatter claimed to reformat for 1024 byte sector, I thought
to try it on the Maxtor. Well, it made it unusable. I then read the notes with Roy program and it did not claim to work with the Maxtor XT-8760. So, having no recourse, I wrote a simple program that would dump the scsi sense mode parameters, and used it on a NeXT formatted Maxtor. Using the dump, I then wrote another program to set the third party Maxtor to the NeXT formatted Maxtor's parameters. These programs have been cleaned up some to alert about parameter differences (so you can check them). I thought about adding a NeXTstep interface on them, but scsi disk formatting is not the sort of thing to be doing on the system in multiuser mode, so I kept it so that it can be used in single user mode. For the same reason I added the inquire program as well, its something that you use to test for SCSI devices recognized by the system. The idea was to have a set of scsi tools, but keep it simple. To use the sense/select programs:

On a system with a drive formatted like you wish to "copy":

sense -t <original target> -l <lun> -p 63 > drive.sense

you can now edit the "drive.sense" file, if you like, to make changes
for destination drive formatting. The "sense" file contains a "SCSI inquire" of the original drive and a "SCSI mode sense" for all scsi mode pages.

Now, use sense on the destination drive to set it's setup:

select -t <destination target> -l <lun> -p 63 > save.sense

Now, reselect the destination drive with the "sense" file as follows:

select -t <destination target> -l <lun> -f drive.sense

The select programs does a "SCSI inquire" of the destination drive and compares
it to the data in the "sense" file. If they do not match, you should get messages alerting you to the fact, and requires you respond before continuing.
It then does a "SCSI sense" of the destination drive and compares it with the
"sense" file. It should check for data masks, and data values for inconsistencies and any parameter changes are reported. Then, before the "SCSI select" of the destination drive with the changed data, you are require to respond. The "SCSI select" writes the data to the current data field, so no parameters are save if the drive is powered off at this point. If you format the drive now, the parameter are then saved into the "saved" data field.
I use NeXT's "disk" program to perform the format. If the new set of parameters
do not work, then reselect the drive with the "save.sense" data file, reformat, and you are back to where you started.

===========================================================================
Notes on mtset:

I would recommend check the man page for the "st". It was my main source of tape configuration information. The mtset is a general propose version of setmtd. I was interested in using the variable block mode of my ARCHIVE Python DAT tape drive, so I added the -i mode switch to the program.

Variable block tape, but inhibit illegal length reporting. This allows you to
read tape with variable length blocks written on it. Very useful, if you were not using the fix block tape mode when you dumped your filesystem, are interested in using restore to read the tape. This is the mode that I use with my Archive Python DAT drive:

mtset -d /dev/nrst0 -i

Fix block tape with 512-byte records. Some tape drive only allow constant size blocks to be written. This causes the scsi tape driver to write in fix block mode. The last partial block written will be padded with zeroes to make a complete block.

mtset -d /dev/nrst0 -f

Fix block tape with 1024-byte records:

mtset -d /dev/nrst0 -f 1024

Reset to default scsi tape drive behavior
        (Variable, allow illegal length reporting):
	
mtset -d /dev/nrst0

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.