I am trying to determine if a tape is full because on 2 different tapes, im receiving 2 different kind of errors:
# uname
SunOS
# /bin/tar cvf /dev/rmt/0n /export/home
a /export/home/jerry/wlserver_10.0.tar.gz 28528 tape blocks
tar: write error: unexpected EOF
# mt -f /dev/rmt/0n status
HP DDS-4 DAT (Sun) tape drive:
sense key(0x13)= EOT residual= 0 retries= 0
file no= 8 block no= 0
#
provadm@01:provadm/tmp%tar cvf /dev/rmt/0n add.sh
a add.sh 1 tape blocks
tar: close error: I/O error
provadm@01:provadm/tmp%mt -f /dev/rmt/0n status
HP DAT-72 tape drive:
sense key(0x13)= EOT residual= 0 retries= 0
file no= 3778 block no= 0
provadm@01:provadm/tmp%
Both status shows "sense key(0x13)= EOT" unfortunately, the tar error on both append are different. any suggestion if both actually meant that the tape is full?
I am not an Solaris expert, but the first error is most definitely a "tape full" error. In disks you have a fixed amount of space you know in advance. So the OS can keep track of the decreasing number of free space during a write operation and once this number hits zero it can tell you "disk full".
There is no such thing with a tape: a tape is of indefinite length (at least from the OS point of view) and therefore of indefinite capacity. For the running tar it is like this: it writes a piece of data, then further winds the tape, then writes the next piece, ... . At the end of the tape the tape drive will tell the OS (tar) that there is no more tape to wind - but for the OS this will be "unexpected", because it can't expect the end of tape like it could expect the exhaustion of disk space.
The second error more looks like a tape error: the magnetic coating of the tape might be damaged or the head of the drive might be dirty or nearing their end-of-life or whatever - the data haven't been written for some reason and it was the fault of something between the tape drive and the tape.
Normally you would tell tar the capacity of the tape drive using a switch on the tar command depending on which Unix O/S it is.
See the man page for your respective tar command.
For example, if your man page tells you the switch is -L and your tape capacity (with compression) is, say, 80GB then you would include -L 80000000 in the command. Tar would then write 80000000 1k blocks before asking for the next tape volume.
The 2 tapes are on 2 different servers. What i would like to confirm is, although the errors are different, both are showing EOT when i did the status check.
Just want to know if both means End of Tape? because the 2nd tape shows an IO error..