From owner-freebsd-questions Thu Jan 9 00:25:13 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id AAA15411 for questions-outgoing; Thu, 9 Jan 1997 00:25:13 -0800 (PST) Received: from dicsmss1.jrc.it (dicsmss1.jrc.it [139.191.1.65]) by freefall.freebsd.org (8.8.4/8.8.4) with SMTP id AAA15405 for ; Thu, 9 Jan 1997 00:25:04 -0800 (PST) Received: from jrc.it (elect6.jrc.it) by dicsmss1.jrc.it (4.1/EB-950131-C) id AA01197; Thu, 9 Jan 97 09:30:21 +0100 Received: by jrc.it (5.x/EB-950213-L) id AA05740; Thu, 9 Jan 1997 09:24:08 +0100 Date: Thu, 9 Jan 1997 09:24:07 +0100 (MET) From: Dirk.vanGulik@jrc.it X-Sender: dirkx@elect6.jrc.it To: Nick Repin Cc: Rob Hartill , freebsd-questions@freebsd.org Subject: Re: Jaz drive. How to ? In-Reply-To: <2.2.32.19970108210814.0070153c@mail.ozemail.com.au> Message-Id: Reply-Path: Dirk.vanGulik@jrc.it Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Thu, 9 Jan 1997, Nick Repin wrote: > At 12:07 PM 8/01/97 +0000, you wrote: > > > >Has anyone written a step by step "how to" guide on preparing > >a jaz drive + cartridge for use under FreeBSD ? > > > On ftp.freebsd.org in incoming you find a handfull of utilities I wrote to open/close/eject/write-protect the jaz drive, it is alpfha quality, but might improve :-) To format a disk; the whole disc on the sd0c slice: disklabel -w -B sd0c auto newfs sd0c mount /dev/sd0c /mnt (This is assuming it is SCSI device 0 ! ) Sometimes the disklabel command barfs the first time round; but just try it a second or third time and all seems to be all right. If anyone knows why; let me know :-) One thing for the real hackers; the Jaz/Zip drives are really easy to recognize; so the sd0 driver could trigger on them; have the geometry hardcoded in; and thus make live a bit easier. This is the lazy way :-) you can also do it neatly and go for the s1..4 convention; the (preformatted) dos partition usualy sits on 3; so you can do a mount -t msdos /dev/sd0s3 /mnt To get the drive out under _ALL_ circumstances do something like #!/bin/sh # Dirk.vanGulik@jrc.it - will not accept # any blame :-) # # Unlock the door of the drive scsi -f /dev/rsd0.ctl -c "1e 0 0 0 0 0" # Spin up the motor; so we can move the arms scsi -f /dev/rsd0.ctl -c "1b 0 0 0 1 0" # Push it out scsi -f /dev/rsd0.ctl -c "1b 0 0 0 2 0" Or use the jaz package at freebsd; here is the manpage. One word of warning; it is quite possible; though a bit hard, to eject a drive while it is mounted... which is IMHO not a good idea ! The other thing is that you really would like some kind of write-behind timeout in the sd0 driver :-) DW. JAZCTRL(?) LOCAL JAZCTRL(?) NAME jazctrl - program to assist with Iomega Jaz devices. SYNOPSIS Usage: jazctrl eject jazctrl -v status jazctrl rw sd2 jazctrl ro /dev/rsd2.ctl jazctrl [-v] [-i] [-f] [device] The device can be symbolic, or absolute; but will always be mapped to the raw control device. DESCRIPTION The jazctrl program is used to send vendor specific SCSI commands to a Iomega jazz device. It is also might work with a Zip drive; but i've nev- er tried that. These commands allow you to eject the disc; power it up and down, and set the read/write protection bits. The password side of this is currently not working. COMMANDS eject ejects the frive up and down will power the drive up and down; mine has a tendency to be noisy and vibrates quite irritatingly. rw will set the drive in read/write mode, and thus cancels the effect of ro which sets the drive in a read-only mode. The catch here is that I've not been able to get the password side of things to work. My controller (or is it the kernel) just hangs when I try to send any ancilarry data. Please let me know if you get it to work. OPTIONS -d option turns on debuging; and generate lots of output; just like its scsi(8) friend. -v option does it all verbose. -i option cause it to ignore any errors or unexpected status conditions encountered while excecuting the command. Be carefull with this one. -h option will dump the syntax and compiled in defaults. DEVICE The device can be specified with its full name, e.g. /dev/rsd0.ctl but the programme will make educated guesses (and inform you about them with the -v flag) when you use more symbolic names such as sd0 or rsd0.ctl without the /dev pre- and .ctl postfixes. If no device is specified (and the RAWJAZDEVICE variable, see below, is also not set), the compiled in /dev/rsd0.ctl drive will be oparated upon. EXAMPLES To eject a drive: jazctrl eject To eject drive 2: jazctrl eject /dev/rsd2.ctl or jazctrl eject sd2 The RAWJAZDEVICE variable can be set to the default device to operate up- on. BUGs Quite a few; so do'nt try this on your own drives. The password stuff does not work, and there are some options for detecting different run- time names, such as jzeject. But the Makefile does not make those links. The program checks quite a few things; such as wether the disk is mounted and if it really looks like a Jaz drive. But I would not really rely on it; anyway only root can do those things anyway. Also; I cannot quite see why the drive should spin up; before you can eject it. AUTHOR Dirk-Willem van Gulik, will not take the blame if you screw up your drive, machine or life. But I'll appreciate feedback nevertheless. HISTORY The jazctrl command was developed around Xmas 96, on an 2-Alpha kernel; and borrows heavily from a Linux example, some peeking in W'95 object code and the scsi(8) and libscsi.a example. a