Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ftio(1)

fbackup(1M)

frecover(1M)

dump(1M)

restore(1M)

rcmd(3C)

rexec(3C)

rmt(1M)

NAME

rmt − remote magnetic-tape protocol module

SYNOPSIS

/etc/rmt

DESCRIPTION

rmt is a program used by the remote dump and restore programs for manipulating a magnetic tape drive through an interprocess communication (IPC) connection.  The fbackup and frecover commands also use rmt to achieve remote backup capability (see fbackup(1M) and frecover(1M)). rmt is normally started up with an rexec() or rcmd() call (see rexec(3C) and rcmd(3C)).

rmt accepts requests specific to the manipulation of magnetic tapes, performs the commands, then responds with a status indication.  DDS devices that emulate magnetic tapes are also supported.  All responses are in ASCII and in one of two forms.  Successful commands have responses of

Anumber\n

where number is an ASCII representation of a decimal number.  Unsuccessful commands are responded to with

Eerror-number\nerror-message\n

where error-number is one of the possible error numbers described in errno(2) and error-message is the corresponding error string as printed from a call to perror() (see perror(3C)). The protocol is comprised of the following commands (a space is present between each token):

O device mode Open the specified device using the indicated mode. device is a full pathname and mode is an ASCII representation of a decimal number suitable for passing to open() (see open(2)). If a device is already open, it is closed before a new open is performed.

o device mode Open the specified device using the indicated mode. device is a full pathname and mode is an ASCII representation of an octal number suitable for passing to open().  If a device is already open, it is closed before a new open is performed. 

C device Close the currently open device.  The device specified is ignored. 

L whence offset Perform an lseek() operation using the specified parameters (see lseek(2)). The response value is that returned from by lseek(). 

W count Write data onto the open device.  rmt reads count bytes from the connection, aborting if a premature end-of-file is encountered.  The response value is that returned from by write() (see write(2)).

R count Read count bytes of data from the open device.  If count exceeds the size of the data buffer (10 Kbytes), it is truncated to the data buffer size.  rmt then performs the requested read() and responds with Acount-read\n if the read was successful.  Otherwise an error is returned in the standard format.  If the read was successful, the data read is then sent. 

I operation count Perform a MTIOCOP ioctl() command using the specified parameters.  Parameters are interpreted as ASCII representations of the decimal values to be placed in the mt_op and mt_count fields of the structure used in the ioctl() call.  The return value is the count parameter when the operation is successful. 

S Return the status of the open device, as obtained with a MTIOCGET ioctl() call.  If the operation was successful, an ACK is sent with the size of the status buffer, then the status buffer is sent (in binary). 

s Return the status of the open device, as obtained with a fstat() call.  If the operation was successful, an ACK is sent with the size of the status buffer, then the status buffer is sent (in binary).  f Return the status of the open device, as obtained with a fstat() call.  If the operation was successful, an ACK is sent with the size of the status buffer, then the status buffer is sent in the following ASCII format:

machine<blank>value<newline>
stat_struct_member_name<blank>value<newline>

The end of the data is indicated by an ASCII NULL character.  See /usr/include/sys/stat.h for the struct stat definition.  In addition to the struct stat information, there is an entry in the buffer describing the machine type as returned from a uname() call (see uname(2)). In the above format “machine” is a key word. All fields except st_spare4 of the struct stat are returned. 

m Return the status of the open device, as obtained with a MTIOCGET ioctl() call.  If the operation was successful, an ack is sent with the size of the status buffer, then the status buffer is sent in the following ASCII format:

machine<blank>value<newline>
mtget_struct_member_name<blank>value<newline>

The end of the data is indicated by an ASCII NULL character.  See /usr/include/sys/mtio.h for the struct mtget definition.  In addition to the struct mtget information there is an entry in the buffer describing the machine type as returned from a uname() call.  In the above format “machine” is a keyword. 

Any other command causes rmt to exit. 

DIAGNOSTICS

All responses are of the form described above. 

DEPENDENCIES

Series 300/400

The device status is returned in the fields mt_dsreg1 and mt_dsreg2.  mt_dsreg1 contains the following information in the least significant byte:

Bit 7(MSB) 6 5 4 3 2 1 0(LSB)
Status EOF BOT EOT RecErr CmdRej WriteP UnErr Online

Online online status

UnErr unrecognized error

WriteP write protect

CmdRej command reject

RecErr recovered error

EOT beyond end of tape

BOT at load point

EOF at end of file

The contents of the least significant byte of the mt_dsreg2 are:

Bit 7(MSB) 6 5 4 3 2 1 0(LSB)
Status 6250 UnkDen ParErr TimErr Run Door Long ImRes

ImRes immediate response mode

Long long records supported

Door door open

Run tape runaway

TimErr data timing error

ParErr data parity error

UnkDen unknown density

6250 6250 GCR format

Series 700/800

The device status is returned in the field mt_gstat.  /usr/include/sys/mtio.h contains defined macros for checking the status bits. 

AUTHOR

rmt was developed by the University of California, Berkeley. 

SEE ALSO

ftio(1), fbackup(1M), frecover(1M), dump(1M), restore(1M), rcmd(3C), rexec(3C). 

WARNINGS

Use of this command for remote file access protocol is discouraged. 

Hewlett-Packard Company  —  HP-UX Release 9.0: August 1992

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026