iustin / mt-st

Magnetic tape control tools for Linux SCSI tapes
Other
41 stars 12 forks source link

File number field shows -1 whatever I do any operations, but the mt command and the tape driver works. #27

Open CherryYang05 opened 1 year ago

CherryYang05 commented 1 year ago

Run command mt -f /dev/IBMtape0n status, it shows like below:

SCSI 2 tape drive:
File number=-1, block number=0, partition=0.
Tape block size 0 bytes. Density code 0x60 (no translation).
Soft error count since last status=0
General status bits on (41000000):
 BOT ONLINE

The File number equals -1. Does it work correctly?

Then I setup the blocksize: mt -f /dev/IBMtape0n setblk 512

Run as above, it shows:

SCSI 2 tape drive:
File number=-1, block number=0, partition=0.
Tape block size 512 bytes. Density code 0x60 (no translation).
Soft error count since last status=0
General status bits on (41000000):
 BOT ONLINE

And then I try to write a 1KB file(filename is "1k") to the tape, using command tar cbvf 1 /dev/IBMtape0n 1k, and check its block number mt -f /dev/IBMtape0n tell, shows At block 6, that's right.

Now check the status:

SCSI 2 tape drive:
File number=-1, block number=6, partition=0.
Tape block size 512 bytes. Density code 0x60 (no translation).
Soft error count since last status=0
General status bits on (1000000):
 ONLINE

Why the File number field is also -1? And how to correct it?