I am using Leonard Zubkoff's "mt" on a Linux-box and can *not* unload
a DAT cartridge if it is write-protected (slot-2 below).

  lou1:/usr/src/mtx-1.1 # uname -a
  Linux lou1 2.2.7 #12 Wed Sep 22 14:32:23 CDT 1999 i586 unknown
  
  lou1:~ # ldd `which mtx`
        libc.so.6 => /lib/libc.so.6 (0x40007000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x2aaaa000)
  
  lou1:/usr/src/mtx-1.1 #echo $TAPE
  /dev/nst0
  
  lou1:/usr/src/mtx-1.1 # ls -l /dev/nst0
  crw-rw----   1 root     disk       9, 128 Apr 15 00:14 /dev/nst0
  
  lou1:/usr/src/mtx-1.1 # mtx status
  Data Transfer Element:        Empty
  Storage Element 1:    Full
  Storage Element 2:    Full
  Storage Element 3:    Full
  Storage Element 4:    Full
  
  lou1:/usr/src/mtx-1.1 # mtx load 1
  Loading Storage Element 1 into Data Transfer Element...done
  
  lou1:/usr/src/mtx-1.1 # mtx unload 1
  Unloading Data Transfer Element into Storage Element 1...done
  
  lou1:/usr/src/mtx-1.1 # mtx load 2
  Loading Storage Element 2 into Data Transfer Element...done
  
  lou1:/usr/src/mtx-1.1 # mtx unload 2
  mtx: cannot open SCSI device '/dev/nst0' - Read-only file system
  
  lou1:/usr/src/mtx-1.1 # mtx status
  mtx: cannot open SCSI device '/dev/nst0' - Read-only file system

The error-message was from trying to open the tape-device in read/
write mode.

After making the following change:
   static int SCSI_OpenDevice(char *DeviceName)
   {
  -  int DeviceFD = open(DeviceName, O_RDWR);
  +  int DeviceFD = open(DeviceName, O_RDONLY);
     if (DeviceFD < 0)
       FatalError("cannot open SCSI device '%s' - %m\n", DeviceName);
mtx seems to function properly.

Does anyone see any problem with my change.

Note: This problem did *not* occur with Linux 2.0.36, why I don't
      know.

Thanks.
-- 
Louis-ljl-{[EMAIL PROTECTED]}

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]

Reply via email to