Tape devices usually have two device files a rewind and a no-rewind device. For example on Linux the first tape drive can be accessed using either /dev/st0 or /dev/nst0. Similarly on FreeBSD we have /dev/sr0 and /dev/nsr0. This article describes the difference between the two.

When accessing a rewind device, the high level tape driver will issue a rewind command to the tape drive. Therefore after the completion of a mt command the tape will be positioned at the beginning at the tape. When accessing a no-rewind tape device, a rewind command is not issued. An example of this behaviour is as follows

# mt -f /dev/st0 fsr 100
# mt -f /dev/st0 status
SCSI 2 tape drive:
File number=0, block number=0, partition=0.
Tape block size 262144 bytes. Density code 0x4a (no translation).
Soft error count since last status=0
General status bits on (41010000):
 BOT ONLINE IM_REP_EN

 

In the above sequence of commands, although the fsr command indicates to position the tape after 100 tape blocks (records), upon completion of the command, the mt command closes the tape device file (/dev/st0) and the high level driver (Linux st driver) issues a rewind to the tape drive internally. This is the reason that the tape is still positioned at the beginning of the tape as seen in the status (File number=0, block number=0, partition=0)
Now lets see the difference when we use the /dev/nst0 device

# mt -f /dev/nst0 fsr 100
# mt -f /dev/nst0 status
SCSI 2 tape drive:
File number=0, block number=100, partition=0.
Tape block size 262144 bytes. Density code 0x4a (no translation).
Soft error count since last status=0
General status bits on (1010000):
 ONLINE IM_REP_EN

 

It should be noted that irrespective of what command you issue to the rewind device, when closing the device a rewind command is always issued to the tape drive. For example in the above sequence of commands we left the tape drive positioned after 100 blocks/record on tape. If we now issue a status command to the tape drive using /dev/st0, a rewind command will be issued to the tape as seen below

# mt -f /dev/st0 status
SCSI 2 tape drive:
File number=0, block number=100, partition=0.
Tape block size 0 bytes. Density code 0x4a (no translation).
Soft error count since last status=0
General status bits on (1010000):
 ONLINE IM_REP_EN

# mt -f /dev/nst0 status
SCSI 2 tape drive:
File number=0, block number=0, partition=0.
Tape block size 0 bytes. Density code 0x4a (no translation).
Soft error count since last status=0
General status bits on (41010000):
 BOT ONLINE IM_REP_EN

 

In the above two mt commands, when we first issued the status command, the tape was positioned after 100 blocks hence the status is reported as File number=0, block number=100, partition=0. However when closing the device file a rewind command is issued, which is why when we query the status again, this time using the /dev/nst0 we get File number=0, block number=0, partition=0.