tape tar error

Hi,

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?

Many Thanks!

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.

I hope this helps.

bakunin

unfortunately, when i check the /var/adm message, i see the following for the 2nd tape:

Oct 11 13:31:19 01 scsi: [ID 107833 kern.warning] WARNING: /pci@1f,700000/pci@0/scsi@2/st@0,0 (st0):
Oct 11 13:31:19 01        Error for Command: write file mark         Error Level: Fatal
Oct 11 13:31:19 01 scsi: [ID 107833 kern.notice]  Requested Block: 1                         Error Block: 1
Oct 11 13:31:19 01 scsi: [ID 107833 kern.notice]  Vendor: HP                                 Serial Number:    9   $DR-1
Oct 11 13:31:19 01 scsi: [ID 107833 kern.notice]  Sense Key: Volume Overflow
Oct 11 13:31:19 01 scsi: [ID 107833 kern.notice]  ASC: 0x0 (end of partition/medium detected), ASCQ: 0x2, FRU: 0x0
Oct 11 13:31:19 01 scsi: [ID 107833 kern.notice]  End-of-Media Detected

is this still io error? or tape full? because both tapes shows EOT....

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..

Yes, "EOT" is "End of Tape". Rewind the tape to clear that condition.

I hope this helps.

bakunin