Scroll to navigation

RMT(8) System management commands RMT(8)

NAME

rmt - remote magtape protocol module

SYNOPSIS

rmt

DESCRIPTION

Rmtis a program used by the remotedump(8),restore(8)ortar(1)programs in manipulating a magnetic tape drive through an interprocesscommunication connection.Rmtis normally started up with anrexec(3)orrcmd(3)call.

Thermtprogram accepts requests specific to the manipulation of magnetic tapes,performs the commands, then responds with a status indication. All responsesare inASCIIand in one of the following two forms.

Successful commands have responses of:

Anumber\n

wherenumberis anASCIIrepresentation of a decimal number.

Unsuccessful commands are responded to with:

Eerror-number\nerror-message\n

whereerror-numberis one of the possible error numbers described inintro(2)anderror-messageis the corresponding error string as printed from a call toperror(3).

The protocol is comprised of the following commands, which are sent asindicated - no spaces are supplied between the command and its arguments, orbetween its arguments, and \n indicates that a newline should be supplied:

Open the specifieddeviceusing the indicatedmode.Deviceis a full pathname andmodeis anASCIIrepresentation of a decimal number suitable for passing toopen(2).If a device had already been opened, it is closed before a new open isperformed.
Close the currently open device. Thedevicespecified is ignored.
Perform anlseek(2)operation using the specified parameters. The response value is that returnedfrom thelseekcall.
Write data onto the open device.Rmtreadscountbytes from the connection, aborting if a premature end-of-file is encountered.The response value is that returned from thewrite(2)call.
Rcount\n
Readcountbytes of data from the open device. Ifcountexceeds the size of the data buffer (10 kilobytes), it is truncated to thedata buffer size.Rmtthen performs the requestedread(2)and responds withAcount-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.
Perform aMTIOCOPioctl(2)command using the specified parameters. The parameters are interpreted as theASCIIrepresentations of the decimal values to place in themt_opandmt_countfields of the structure used in theioctlcall. The return value is thecountparameter when the operation is successful.
By issuing theI-1\n0\ncommand, a client will specify that he is using the VERSION 1 protocol.
For a VERSION 0 client, theoperationparameter is the platformmt_opvalue (could be different if the client and thermtserver are on two different platforms). For a VERSION 1 client, theoperationparameter is standardized as below:
0
Issue aMTWEOFcommand (writecountend-of-file records).
1
Issue aMTFSFcommand (forward space overcountfile marks).
2
Issue aMTBSFcommand (backward space overcountfile marks).
3
Issue aMTFSRcommand (forward spacecountinter-record gaps).
4
Issue aMTBSRcommand (backward spacecountinter-record gaps).
5
Issue aMTREWcommand (rewind).
6
Issue aMTOFFLcommand (rewind and put the drive offline).
7
Issue aMTNOPcommand (no operation, set status only).
Perform an extendedMTIOCOPioctl(2)command using the specified parameters. The parameters are interpreted as theASCIIrepresentations of the decimal values to place in themt_opandmt_countfields of the structure used in theioctlcall. The return value is thecountparameter when the operation is successful. The possible operations are:
0
Issue aMTCACHEcommand (switch cache on).
1
Issue aMTNOCACHEcommand (switch cache off).
2
Issue aMTRETENcommand (retension the tape).
3
Issue aMTERASEcommand (erase the entire tape).
4
Issue aMTEOMcommand (position to end of media).
5
Issue aMTNBSFcommand (backward space count files to BOF).
Return the status of the open device, as obtained with aMTIOCGETioctlcall. If the operation was successful, an “ack” is sent with the sizeof the status buffer, then the status buffer is sent (in binary, which isnon-portable between different platforms).
This is a replacement for the previousScommand, portable across different platforms. If the open device is a magnetictape, return members of the magnetic tape status structure, as obtained with aMTIOCGETioctl call. If the open device is not a magnetic tape, an error is returned. IftheMTIOCGEToperation was successful, the numerical value of the structure member isreturned in decimal. The following sub commands are supported:
return the content of the structure membermt_typewhich contains the type of the magnetic tape device.
return the content of the structure membermt_dsregwhich contains the "drive status register".
return the content of the structure membermt_erregwhich contains the "error register". This structure member must be retrievedfirst because it is cleared after eachMTIOCGETioctl call.
return the content of the structure membermt_residwhich contains the residual count of the last I/O.
return the content of the structure membermt_filenowhich contains the file number of the current tape position.
return the content of the structure membermt_blknowhich contains the block number of the current tape position.
return the content of the structure membermt_flagswhich contains MTF_ flags from the driver.
return the content of the structure membermt_bfwhich contains the optimum blocking factor.

Any other command causesrmtto exit.

DIAGNOSTICS

All responses are of the form described above.

SEEALSO

rcmd(3),rexec(3),/usr/include/sys/mtio.h,rdump(8),rrestore(8)

BUGS

People should be discouraged from using this for a remote file access protocol.

AUTHOR

Thedump/restorebackup suit was ported to Linux's Second Extended File System by Remy Card<card@Linux.EU.Org>. He maintained the initial versions ofdump(up and including 0.4b4, released in january 1997).

Starting with 0.4b5, the new maintainer is Stelian Pop <stelian@popies.net>.

AVAILABILITY

Thedump/restorebackup suit is available from <https://dump.sourceforge.io>

HISTORY

Thermtcommand appeared in 4.2BSD.

version 0.4b47 of 1 Jan 2021 BSD