public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ujval Lodha" <ujval@gdc-tech.com>
To: tonyb@cybernetics.com, linux-scsi@vger.kernel.org
Subject: Re: Writing to tape from C system calls
Date: Sat, 13 Dec 2003 00:18:04 +0800	[thread overview]
Message-ID: <002d01c3c0cb$85c266f0$7b00a8c0@pluto> (raw)
In-Reply-To: 03Dec12.101354est.332511@cyborg.cybernetics.com


Thanks for your reply. That clears up my understanding.

I've already read the man page. That is how I got so far, in fact. It seems
to require some understanding of the functionality of tape drives. The
description of some of the options seems very cryptic to me - as I dont know
much of the jargon associated with tape drives. Any material that would help
understand tape devices and tape as a medium - filemarks, setmarks, and the
order of operations one is expected to perform.

Also, I wonder if it absolutely not possible to use the tape in the manner I
intended. I am using the tape without compression - and I dont mind making
'sub-optimal' use of the capacity of the tape.

Thanks again.

Regards,
Ujval


----- Original Message ----- 
From: "Tony Battersby" <tonyb@cybernetics.com>
To: "'Ujval Lodha'" <ujval@gdc-tech.com>; <linux-scsi@vger.kernel.org>
Sent: Friday, December 12, 2003 11:14 PM
Subject: RE: Writing to tape from C system calls


> > When I write to it at any block that block becomes the last
> > block on the device. I am unable to seek to any block after
> > that on the tape.
>
> > Is this normal? Is it not possible to use the tape device -
> > and modify data at any block by seeking to it and writing?
>
> It is completely normal.  All modern tape drives work this way.  Unlike
> a disk drive, a block address on tape does not correspond to a
> predefined location on the medium.  The tape drive (re)formats the
> medium while it writes, which invalidates anything past the last written
> point on tape.  So, you can seek/read/write the tape from the beginning
> of the tape up to just after the last written block, but the tape medium
> after that point is not considered to be formatted and cannot be used
> (again) until it is reached while writing.
>
> As you observed, writing to tape in the middle of valid data will cause
> the contents of the tape to be truncated at the write point.  That's the
> way the technology works.  There is no way to update a block in the
> middle of the valid data without losing everything that comes after it.
> The only way around this is to use multiple partitions, but not all tape
> drives support partitions, and changing partitions takes time.
>
> > Is there some source of information where I can read about
> > programming tape devices from C? So far, I havent been able
> > to find one.
>
> man st
>
> But that's pretty low-level, of course.
>
> Anthony J. Battersby
> Cybernetics
>



  reply	other threads:[~2003-12-12 16:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <033701c3c0ac$97659270$aa00a8c0@ASTERIX>
2003-12-12 12:39 ` Writing to tape from C system calls Ujval Lodha
2003-12-12 15:14   ` Tony Battersby
2003-12-12 16:18     ` Ujval Lodha [this message]
2003-12-12 16:38       ` Tony Battersby

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='002d01c3c0cb$85c266f0$7b00a8c0@pluto' \
    --to=ujval@gdc-tech.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=tonyb@cybernetics.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox