ls /dev/ shows three tape devices: /dev/IBMtape(use mt command shows /dev/IBMtape: Resource temporarily unavailable), /dev/IBMtape0 and /dev/IBMtape0n. The last two device can work by using mt command.
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?
lsscsi -g
[11:0:0:0] tape IBM ULT3580-HH9 N9B1 - /dev/sg0
ls /dev/
shows three tape devices:/dev/IBMtape
(use mt command shows/dev/IBMtape: Resource temporarily unavailable
),/dev/IBMtape0
and/dev/IBMtape0n
. The last two device can work by using mt command.Run command
mt -f /dev/IBMtape0n status
, it shows like below: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:
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 numbermt -f /dev/IBMtape0n tell
, showsAt block 6
, that's right.Now check the status:
Why the
File number
field is also -1? And how to correct it?