[comp.sys.next] Viper 150

gn@orbus (06/12/91)

Maybe this should be added to the FAQ.

The NeXT will support the Viper 150 tape drive, in block mode. To set the Viper
150 into block mode you need to run the small program I have included here.

When using Dump with the Viper 150, you have to specify the number of feet 
as though the tape was 1600 bpi. For a 150 Meg tape that is about 7500 ft.
Hence the dump command for a level 0 archive is:

dump 0fs /dev/rst0 7500 

Warning: There appear to be problems with Restore and multi-volumes. Recovery
is possible but you need to use the interactive option. Restore DOES core 
dump.

Tar will not support multi-volumes (Why??)

Greg Noel                                           Rathe,inc
...umn-cs!rathe!orbus!gn

"Drink Alot and Drive Real Fast"		            -J. Goins
- Cut Here -

// set_fixed.c 

#include <sys/types.h>
#include <sys/file.h>
#include <nextdev/scsireg.h>

//  Set fixed block size for viper
//  cc set_fixed.c -o set_fixed

#define RAW_DEVICE_NAME "/dev/rst0"
#define FIXBLK_SIZE     512

typedef int BOOLEAN ;

void main()
{
    extern  int open(),
                ioctl(),
                close();

    int tape_block_size=FIXBLK_SIZE,
        raw_device_fid;

    BOOLEAN device_opened,
            device_set;

    raw_device_fid = open ( RAW_DEVICE_NAME, O_WRONLY );
    device_opened = raw_device_fid != (-1) ;

    if( device_opened )
    {
        device_set = ioctl( raw_device_fid, MTIOCFIXBLK, &tape_block_size );
   
        if( device_set )
        {
            printf( "Fix Block Size Set Succeeded. \n" );
        }
        else
        {
            printf( "Fix Block Size Set Failed. \n" );
        }

        close( raw_device_fid );
    }
    else
    {
        printf( "Couldn't Open Tape Drive. \n" );
    }

}