Subject: Re: Reading a Solaris SPARC V2.6 tar tape on a NetBSD 1.3.3/i386 box
To: Scott R. Burns <Scott.Burns@Netcontech.Com>
From: Tom Rushworth <tbr@kopernik.dfi.tfic.bc.ca>
List: netbsd-help
Date: 03/10/1999 01:59:02
On Tue, Mar 09, 1999 at 12:24:14PM -0500, Scott R. Burns wrote:
> I have a DDS-2 DAT tape created on a Solaris V2.6.x box using a Sun DAT drive using Sun's tar. I am using:
> 
> HP 24x6 drive using Tar under V1.3.3/i386
> 
> The tape was created using all the Sun defaults I believe but I do not know for sure.
> 
> 1) I think the blocking factor for Sun/Solaris tar is 20 by default
> 2) The normal /dev/rmt/xxxx tape device was probably used (ie. not the Berkley compatible mode etc.)(Probably 0hn I think ?).
> 3) Do I have to do anything special on a tar archive coming from Solaris, SPARC platform (byte order) etc. to read this tape on my machine ?
> 4) I have tried a cleaning tape on the drive
> 5) The drive is used for our backups every night without issue, those tapes are readable.
> 5) Here are the messages generates by the HP drive when I read the tape with:

I had a similar problem with DAT drives and tapes moving between SunOS,
NetBSD and an HP system several years back.  The problem turned out to have
something to do with logical vs. physical block size for DAT tapes.  My
memory has gotten fuzzy, but it went something like:
   - The physical block size was always 1024 bytes.
   - The logical block size was different on different machings, and the
     device drivers would break up a large block to write it on a small
     block machine, but were completely unable to read a large logical
     block tape on a small logical block machine.
   - The NetBSD logical block size was 512 bytes and couldn't easily be
     changed.
   - The SunOS logical block size was one of the numbers in the drive type
     table, and could be changed by changing the number and recompiling the
     kernel.  (Hmm, must have bee SunOS 4.)  Some drive types had 512, others
     had 10240 (=20*512).

The solution was to write logical blocks of the smallest common denominator,
(512 byte), by making sure that whatever program actually wrote to the device
used a block of 512.  I used something like:

   tar cbf 1 /dev/rst0 ....

or

   tar cf - .... | dd obs=512 of=/dev/rst0

This was very slow, but I got the speed back by using a program called "team"
(obtained from somwhere on the net) in place of dd, once I had convinced
myself that 512 byte blocks were the answer.

I don't know if your problem is the same, but it should be fairly simple to
find out - write a small logical block tape using one of the methods above
on the Sun, and try reading it on the NetBSD box.

good luck...

Tom Rushworth