Copy fist file
[root@dga1 backup]# tar -cvf /dev/nst0 /root/first.txt
tar: Removing leading `/' from member names
/root/first.txt
[root@dga1 backup]#
Move head to end of tape, and copy 2nd file
[root@dga1 backup]# mt -f /dev/nst0 eof
[root@dga1 backup]# tar -cvf /dev/nst0 /root/second.txt
tar: Removing leading `/' from member names
/root/second.txt
[root@dga1 backup]#
Move head to end of tape, and copy 3rd file
[root@dga1 backup]# mt -f /dev/nst0 eof
[root@dga1 backup]# tar -cvf /dev/nst0 /root/third.txt
tar: Removing leading `/' from member names
/root/third.txt
[root@dga1 backup]#
Rewind the tape to the beginging
[root@dga1 backup]# mt -f /dev/st0 rewind
[root@dga1 backup]#
checking what was recorded, we see the contents of "file number 0" which was the first file.
[root@dga1 backup]# mt -f /dev/st0 status
SCSI 2 tape drive:
File number=0, block number=0, partition=0.
Tape block size 0 bytes. Density code 0x5c (no translation).
Soft error count since last status=0
General status bits on (41010000):
BOT ONLINE IM_REP_EN
[root@dga1 backup]#
[root@dga1 backup]# tar -tvf /dev/nst0
-rw-r--r-- root/root 2966 2018-01-16 12:57 root/first.txt
[root@dga1 backup]#
First move the head one forward, then review the status to confirm we're now in slot 1 (Second slot), and confirm that this is the second file.
[root@dga1 backup]# mt -f /dev/nst0 fsf 1
[root@dga1 backup]# mt -f /dev/nst0 status
SCSI 2 tape drive:
File number=1, block number=0, partition=0.
Tape block size 0 bytes. Density code 0x5c (no translation).
Soft error count since last status=0
General status bits on (81010000):
EOF ONLINE IM_REP_EN
[root@dga1 backup]# tar -tvf /dev/nst0
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
[root@dga1 backup]# tar -tvf /dev/nst0
-rw-r--r-- root/root 512679 2018-01-16 12:57 root/second.txt
[root@dga1 backup]#
Then the third time:
[root@dga1 backup]# mt -f /dev/nst0 fsf 1
[root@dga1 backup]# mt -f /dev/nst0 status
SCSI 2 tape drive:
File number=3, block number=0, partition=0.
Tape block size 0 bytes. Density code 0x5c (no translation).
Soft error count since last status=0
General status bits on (81010000):
EOF ONLINE IM_REP_EN
[root@dga1 backup]# tar -tvf /dev/nst0
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
[root@dga1 backup]# tar -tvf /dev/nst0
-rw-r--r-- root/root 3076074 2018-01-16 12:58 root/third.txt
[root@dga1 backup]#