public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Tony Battersby" <tonyb@cybernetics.com>
To: 'Ujval Lodha' <ujval@gdc-tech.com>, linux-scsi@vger.kernel.org
Subject: RE: Writing to tape from C system calls
Date: Fri, 12 Dec 2003 10:14:01 -0500	[thread overview]
Message-ID: <03Dec12.101354est.332511@cyborg.cybernetics.com> (raw)
In-Reply-To: <035701c3c0ac$f1ccbae0$aa00a8c0@ASTERIX>

> 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 15:14 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 [this message]
2003-12-12 16:18     ` Ujval Lodha
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=03Dec12.101354est.332511@cyborg.cybernetics.com \
    --to=tonyb@cybernetics.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=ujval@gdc-tech.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