1RMT(8)                    System management commands                    RMT(8)
2
3
4

NAME

6       rmt - remote magtape protocol module
7

SYNOPSIS

9       rmt
10

DESCRIPTION

12       Rmt  is a program used by the remote dump(8), restore(8) or tar(1) pro‐
13       grams in manipulating a magnetic tape  drive  through  an  interprocess
14       communication  connection.  Rmt is normally started up with an rexec(3)
15       or rcmd(3) call.
16
17       The rmt program accepts requests specific to the manipulation  of  mag‐
18       netic tapes, performs the commands, then responds with a status indica‐
19       tion.  All responses are in ASCII and  in  one  of  the  following  two
20       forms.
21
22       Successful commands have responses of:
23              Anumber\n
24
25       where number is an ASCII representation of a decimal number.
26
27       Unsuccessful commands are responded to with:
28              Eerror-number\nerror-message\n
29
30       where  error-number  is  one of the possible error numbers described in
31       intro(2) and error-message is the corresponding error string as printed
32       from a call to perror(3).
33
34       The  protocol is comprised of the following commands, which are sent as
35       indicated - no spaces are supplied between the command  and  its  argu‐
36       ments, or between its arguments, and \n indicates that a newline should
37       be supplied:
38
39       Odevice\nmode\n
40              Open the specified device using the indicated mode.  Device is a
41              full  pathname  and mode is an ASCII representation of a decimal
42              number suitable for passing to open(2).  If a device had already
43              been opened, it is closed before a new open is performed.
44
45       Cdevice\n
46              Close  the  currently  open  device.   The  device  specified is
47              ignored.
48
49       Lwhence\noffset\n
50              Perform an lseek(2) operation using  the  specified  parameters.
51              The response value is that returned from the lseek call.
52
53       Wcount\n
54              Write data onto the open device.  Rmt reads count bytes from the
55              connection, aborting if a premature end-of-file is  encountered.
56              The response value is that returned from the write(2) call.
57
58       Rcount\n
59              Read  count bytes of data from the open device. If count exceeds
60              the size of the data buffer (10 kilobytes), it is  truncated  to
61              the  data  buffer size.  Rmt then performs the requested read(2)
62              and responds with Acount-read\n if the read was successful; oth‐
63              erwise  an error in the standard format is returned. If the read
64              was successful, the data read is then sent.
65
66       Ioperation\ncount\n
67              Perform a MTIOCOP ioctl(2) command using the  specified  parame‐
68              ters.   The  parameters are interpreted as the ASCII representa‐
69              tions of the decimal values to place in the mt_op  and  mt_count
70              fields  of  the  structure  used  in the ioctl call.  The return
71              value is the count parameter when the operation is successful.
72
73              By issuing the I-1\n0\n command, a client will specify  that  he
74              is using the VERSION 1 protocol.
75
76              For  a VERSION 0 client, the operation parameter is the platform
77              mt_op value (could be different if the client and the rmt server
78              are  on  two  different  platforms). For a VERSION 1 client, the
79              operation parameter is standardized as below:
80
81              0      Issue a MTWEOF command (write count end-of-file records).
82
83              1      Issue a MTFSF command  (forward  space  over  count  file
84                     marks).
85
86              2      Issue  a  MTBSF  command  (backward space over count file
87                     marks).
88
89              3      Issue a MTFSR command (forward space  count  inter-record
90                     gaps).
91
92              4      Issue  a MTBSR command (backward space count inter-record
93                     gaps).
94
95              5      Issue a MTREW command (rewind).
96
97              6      Issue a MTOFFL command (rewind and  put  the  drive  off‐
98                     line).
99
100              7      Issue a MTNOP command (no operation, set status only).
101
102       ioperation\ncount\n
103              Perform an extended MTIOCOP ioctl(2) command using the specified
104              parameters. The parameters are interpreted as the  ASCII  repre‐
105              sentations  of  the  decimal  values  to  place in the mt_op and
106              mt_count fields of the structure used in the  ioctl  call.   The
107              return  value  is the count parameter when the operation is suc‐
108              cessful. The possible operations are:
109
110              0      Issue a MTCACHE command (switch cache on).
111
112              1      Issue a MTNOCACHE command (switch cache off).
113
114              2      Issue a MTRETEN command (retension the tape).
115
116              3      Issue a MTERASE command (erase the entire tape).
117
118              4      Issue a MTEOM command (position to end of media).
119
120              5      Issue a MTNBSF command (backward  space  count  files  to
121                     BOF).
122
123       S      Return  the  status  of the open device, as obtained with a MTI‐
124              OCGET ioctl call.  If the operation was successful, an “ack”  is
125              sent  with the size of the status buffer, then the status buffer
126              is sent (in binary,  which  is  non-portable  between  different
127              platforms).
128
129       ssub-command
130              This  is  a  replacement  for  the  previous S command, portable
131              across different platforms. If the open  device  is  a  magnetic
132              tape,  return  members of the magnetic tape status structure, as
133              obtained with a MTIOCGET ioctl call. If the open device is not a
134              magnetic  tape,  an error is returned. If the MTIOCGET operation
135              was successful, the numerical value of the structure  member  is
136              returned in decimal. The following sub commands are supported:
137
138              T      return  the content of the structure member mt_type which
139                     contains the type of the magnetic tape device.
140
141              D      return the content of the structure member mt_dsreg which
142                     contains the "drive status register".
143
144              E      return the content of the structure member mt_erreg which
145                     contains the "error register". This structure member must
146                     be  retrieved first because it is cleared after each MTI‐
147                     OCGET ioctl call.
148
149              R      return the content of the structure member mt_resid which
150                     contains the residual count of the last I/O.
151
152              F      return  the  content  of  the  structure member mt_fileno
153                     which contains the file number of the current tape  posi‐
154                     tion.
155
156              B      return the content of the structure member mt_blkno which
157                     contains the block number of the current tape position.
158
159              f      return the content of the structure member mt_flags which
160                     contains MTF_ flags from the driver.
161
162              b      return  the  content  of the structure member mt_bf which
163                     contains the optimum blocking factor.
164
165       Any other command causes rmt to exit.
166

DIAGNOSTICS

168       All responses are of the form described above.
169

SEE ALSO

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

BUGS

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

AUTHOR

178       The dump/restore backup suit was ported to Linux's Second Extended File
179       System by Remy Card <card@Linux.EU.Org>. He maintained the initial ver‐
180       sions of dump (up and including 0.4b4, released in january 1997).
181
182       Starting    with   0.4b5,   the   new   maintainer   is   Stelian   Pop
183       <stelian@popies.net>.
184

AVAILABILITY

186       The dump/restore backup suit  is  available  from  <http://dump.source
187       forge.net>
188

HISTORY

190       The rmt command appeared in 4.2BSD.
191
192
193
194BSD                     version 0.4b43 of June 11, 2010                 RMT(8)
Impressum