0

I'm currently working with a LTO Tape drive (LTO 3 to be more specific) and I'm looking for some explanation of the block sizes.

As I know, there are two supported modes: 0 for a variable block size and any other value for a fixed one.

Now to my part:

  1. What does this even mean, a variable block size? Am I supposed to write in any multiple of 265 and than forced to use the same size to read again, so my application is choosing the block size? So I have to fill up the blocks by my self, when my data is too short?

  2. And what about fixed ones? If I've got a size of 265, do I get a exception writing something smaller than that or is the driver filling up the block automatically? Am I supposed to read the whole block (the 265 bytes) or am I able to read just what I need?

DavidPostill
  • 153,128
  • 77
  • 353
  • 394

1 Answers1

0
  1. Variable block size: It means the block size written on the tape can be changed by applications. tar -b option is an example. When you read data from the tape, you must specify the same block size as the one you used in write. Otherwise, tape drive may not return your data.

  2. Fixed block size: The tape drive uses the block size specified in device configuration. You must use a multiple of this fixed block size when writing and reading. Even in this mode, when you read data from tape, you still need to use the same block size that is used for write.

  • So using a variable blocksize would allow me to write lets say 1200 bytes. In order to read them, I would have to read 1280 bytes (5*256) at least. So basicly, I can write what I want but I have to read in multibles of 256? – Jonas Born Jun 20 '21 at 10:16
  • I am afraid that you are misunderstanding. Let's write a single file (1200 bytes) to tape with variable block size. Your application uses 512 bytes of block size (default of dd command) as an example. When writing, the file is automatically divided into 3 blocks, and total 512 bytes * 3 blocks = 1536 bytes is written in tape. In order to read them, application must use 512 bytes of block size. The tape drive will read 3 blocks (1536 bytes) from tape. – Kevin Nakamoto Jun 20 '21 at 12:52
  • 1
    Okay. Seeing that, would it I be able to write one file with a different block size than another? – Jonas Born Jun 21 '21 at 14:34
  • No, most applications, as far as I know, must use the same block size in a write/read operation. Of course, you can use a different block size in a different command. e.g., write the file to tape media with 512 bytes block size, and after the completion of this command, you can append the same file with different block size. – Kevin Nakamoto Jun 21 '21 at 18:39