Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for tapes that were written in variable-block mode? #28

Open
bitsgalore opened this issue Dec 6, 2018 · 0 comments
Open

Support for tapes that were written in variable-block mode? #28

bitsgalore opened this issue Dec 6, 2018 · 0 comments

Comments

@bitsgalore
Copy link
Member

bitsgalore commented Dec 6, 2018

Apparently block size can be variable within a file that's written to tape, see:

https://github.com/torvalds/linux/blob/master/Documentation/scsi/st.rst

In variable block mode, the byte count in write() determines the size
of the physical block on tape. When reading, the drive reads the next
tape block and returns to the user the data if the read() byte count
is at least the block size. Otherwise, error ENOMEM is returned.

Don't know how common this is, but this is something to keep in mind if tapeimgr fails on a tape. In theory support for variable-block tapes could be added by reading 1-block at a time, and then do a new blockSize estimation once a block results in read errors.

TODO: see if variable-block tapes can be emulated with mhvtl, and use that for testing.

It also implies that the 'filll failed blocks' option is likely to yield corrupted content for variable-block tapes.

See also:

https://unix.stackexchange.com/a/366217/187090

and:

https://www.mkssoftware.com/docs/man4/tape.4.asp

which says:

SCSI tape drives can support variable block mode, fixed block mode, or both. Older drives typically support only fixed block mode. Newer drives often either support variable block mode only, or both variable block and fixed block modes.

So if true this means older tapes are unlikely to be affected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant