AWS 95: Using tar with DAT Tape Drive

We have an Apple Workgroup Server (AWS) 95 and we're trying to tar and untar files from the built-in 4mm DAT tape drive. We are using the command tar -cvf /dev/rmt/tc2 <filename> to tar a file to a new tape, which gives us a tape write error. We verified that the record lock tab on the cassette was in place. We also have a tar-ed file on another DAT tape and when trying to read that file we get a tape read error also. What's wrong?
The problem is the tar command being used. The A/UX tc driver has to be accessed in 8K blocks, therefore you must specify the blocking factor as part of the tar command. The command you used needs to be modified from


tar -cvf /dev/rmt/tc2 <filename>

to

tar -cvfb /dev/rmt/tc2 16 <filename>


To read the tar archive created, the command also needs to contain the specification for the block size.

List contents of tar archive:

tar -tvfb /dev/rmt/tc2 16

Extract contents of tar archive:

tar -xvfb /dev/rmt/tc2 16

Extract specific file from the contents of tar archive:

tar -tvfb /dev/rmt/tc2 16 <filename>

If you are trying to perform backups from UNIX, any of the following commands will also work. Keep in mind that none of them use the hardware compression abilities of the 4MM DAT drive, which is the reason we use the compress command as part of the examples.

The following command can be used create a backup of the root file system:

dump.bsd 0bsf 8k 2000m /dev/rmt/tc2 /dev/dsk/c0d0s0

The following command is used to restore the backup:

restore -xyvbf 8k /dev/rmt/tc2

Create Archive:

find . -print | cpio -ocv | tcb > /dev/rmt/tc2
Read Archive:

tcb < /dev/rmt/tc2 | cpio -icv

Create Archive:

find . -print | cpio -oc | compress | tcb > /dev/rmt/tc2
Read Archive:

tcb < /dev/rmt/tc2 | compress -d | cpio -icv

Create Archive:

tar -cvf - . | dd of=/dev/rmt/tc2 obs=8kx40
Read Archive:

dd if=/dev/rmt/tc2 ibs=8kx40  |  tar -xvf -

Create Archive:

tar -cvf - / | tcb > /dev/rmt/tc2
Read Archive:

tcb < /dev/rmt/tc2 |  tar -xvf -  

Published Date: Feb 19, 2012