logo
Manual Pages
Table of Contents

NAME

na_rmt - remote magtape protocol module

SYNOPSIS

/etc/rmt

DESCRIPTION

/etc/rmt is a special command that can be used by remote computers to manipulate a magnetic tape drive over a network connection; for example, the UNIX dump and restore commands often can either use /etc/rmt to access a remote tape, or have rdump and rrestore variants that can do so. /etc/rmt is normally run by the rshd daemon (see na_rshd(8)) as a result of a remote machine making a request to rshd to do so. The /etc/rmt command accepts requests specific to the manipulation of magnetic tapes, performs the commands, then responds with a status indication. This protocol is provided by rmt commands on many UNIX systems, although UNIX systems may support more commands and may give more different error codes. All responses are in ASCII and in one of two forms. Successful commands have responses of: Anumber\n number is an ASCII representation of a decimal number. Unsuccessful commands are responded to with: Eerror-number\nerror-message\n error-number is one of: 2 (ENOENT)
The tape device specified in an open request did not have a valid syntax. 6 (ENXIO)
The tape device specified in an open request does not exist. 5 (EIO)
An I/O error occurred when performing the request. 25 (ENOTTY)
An invalid tape operation was specified in a ``perform special tape operation'' request. error-message is a (UNIX-style) error string for the error specified by error-number. The protocol is comprised of the following commands, which are sent as indicated - no spaces are supplied between the command and its arguments, or between its arguments, and \n indicates that a newline should be supplied: Odevice\nmode\n
Open the specified device using the indicated mode. device is a tape name of the form described in na_tape(4) and mode is an ASCII representation of a decimal number specifying how the tape is to be opened:
0
read-only
1
write-only
2
read-write
If a device had already been opened, it is closed before a new open is performed. Cdevice\n
Close the currently open device. The device specified is ignored. Lwhence\noffset\n
Performs no operation, and returns the value of offset; UNIX-style lseek operations are ignored on NetApp filer tape devices, just as they are on tape devices on many UNIX systems. Wcount\n
Write data onto the open device. If count exceeds the maximum data buffer size (64 kilobytes), it is truncated to that size. /etc/rmt then reads count bytes from the connection, aborting if a premature end-offile is encountered. The response value is the number of bytes written if the write succeeds, or -1 if the write fails. Rcount\n
Read count bytes of data from the open device. If count exceeds the maximum data buffer size (64 kilobytes), it is truncated to that size. /etc/rmt then attempts to read count bytes from the tape and responds with Acount-read\n if the read was successful; otherwise an error in the standard format is returned. If the read was successful, the data read is then sent. Ioperation\ncount\n
Perform a special tape operation on the open device using the specified parameters. The parameters are interpreted as ASCII representations of the decimal values. operation is one of:
0
write end-of-file marker
1
forward space count files
2
backward space count files
3
forward space count tape blocks
4
backward space count tape blocks
5
rewind the tape
6
rewind and unload the tape
The return value is the count parameter when the operation is successful. Any other command causes /etc/rmt to close the connection.

DIAGNOSTICS

All responses are of the form described above.

SEE ALSO

na_tape(4), na_rshd(8)
Table of Contents