7
Tape device
Tape devices are recognized as /dev/st0 and /dev/nst0.
/dev/st0 automatically rewinds the tape to the beginning after a read / write operation.
/dev/nst0 moves to the beginning of the next file after a read / write operation.
Check the tape status
Check the tape status with the ‘mt’ command:
# mt -f /dev/nst0 status
SCSI 2 tape drive:
File number = 4, block number = 0, partition = 0.
Tape block size 0 bytes. Density code 0x46 (LTO-4).
Soft error count since last status = 0
General status bits on (81010000):
EOF ONLINE IM_REP_EN
#
Tape operation
To rewind the tape, specify rewind with the ‘mt’ command:
# mt -f /dev/nst0 rewind
To move the tape to the beginning of the next file at the current position, specify fsf 1 with the
‘mt’ command:
# mt -f /dev/nst0 fsf 1
To move the tape to the beginning of the file at the current position, specify bsfm 1 with the
‘mt’ command:
# mt -f /dev/nst0 bsfm 1