This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: /dev/nst0: Permission denied


On Wed, Sep 05, 2001 at 01:02:51PM +0100, Mark Himsley wrote:
> Hi,
> 
> I have a tape device problem. I'm running on Win2K pro SP1 + all M$
> recommended patches and I've just installed the latest Cygwin.
> 
> I mounted the DAT drive with
> 
> mount -s -f -b //./tape0 /dev/nst0
> 
> and it seems to be working, I can write to a DAT and read the data back.
> 
> BUT, if I put in a tape I wrote on Linux I get the following:
> 
> $ cat /dev/nst0
> cat: /dev/nst0: Permission denied
> 
> Why is this, and how can I read the DAT tape.

Wrong blocksize. Call `mt -f /dev/nst0 status 2' with tape in
drive.  It will show you the blocksize currently set in the
NT tape device driver (often 512), e.g.:

$ mt -f /dev/nst0 status 2
tape capacity    :  1953251 KB          remaining        :  1953251 KB
current block    :        0             write protected  :       no             datcompression   :       on
min block size   :        1             max block size   :    65536
def block size   :    16384             cur block size   :      512
report setmarks  :      off                  

The current blocksize is obviously reported in `cur block size'.

To get rid of that you either have to know the blocksize which
is used when the tape has been written by Linux (probably 5120)

$ mt -f /dev/nst0 setblk 5120

or you set your tape device driver to `variable block length'
which let the device drive figure out the size of the next
block on the tape by itself:

$ mt -f /dev/nst0 setblk 0

Note that not all device drivers are able to deal with variable
block size. Howver, the standard DAT driver on NT (4mmdat.sys)
is able to do that.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]