xref: /freebsd/usr.sbin/rmt/rmt.8 (revision fbbd9655e5107c68e4e0146ff22b73d7350475bc)
159fe2c14SBruce Evans.\" Copyright (c) 1983, 1991, 1993
259fe2c14SBruce Evans.\"	The Regents of the University of California.  All rights reserved.
359fe2c14SBruce Evans.\"
459fe2c14SBruce Evans.\" Redistribution and use in source and binary forms, with or without
559fe2c14SBruce Evans.\" modification, are permitted provided that the following conditions
659fe2c14SBruce Evans.\" are met:
759fe2c14SBruce Evans.\" 1. Redistributions of source code must retain the above copyright
859fe2c14SBruce Evans.\"    notice, this list of conditions and the following disclaimer.
959fe2c14SBruce Evans.\" 2. Redistributions in binary form must reproduce the above copyright
1059fe2c14SBruce Evans.\"    notice, this list of conditions and the following disclaimer in the
1159fe2c14SBruce Evans.\"    documentation and/or other materials provided with the distribution.
12*fbbd9655SWarner Losh.\" 3. Neither the name of the University nor the names of its contributors
1359fe2c14SBruce Evans.\"    may be used to endorse or promote products derived from this software
1459fe2c14SBruce Evans.\"    without specific prior written permission.
1559fe2c14SBruce Evans.\"
1659fe2c14SBruce Evans.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
1759fe2c14SBruce Evans.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1859fe2c14SBruce Evans.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1959fe2c14SBruce Evans.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2059fe2c14SBruce Evans.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2159fe2c14SBruce Evans.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2259fe2c14SBruce Evans.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2359fe2c14SBruce Evans.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2459fe2c14SBruce Evans.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2559fe2c14SBruce Evans.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2659fe2c14SBruce Evans.\" SUCH DAMAGE.
2759fe2c14SBruce Evans.\"
2859fe2c14SBruce Evans.\"     @(#)rmt.8	8.3 (Berkeley) 6/1/94
2997d92980SPeter Wemm.\" $FreeBSD$
3059fe2c14SBruce Evans.\"
3159fe2c14SBruce Evans.Dd June 1, 1994
3259fe2c14SBruce Evans.Dt RMT 8
33a4c37c81SRuslan Ermilov.Os
3459fe2c14SBruce Evans.Sh NAME
3559fe2c14SBruce Evans.Nm rmt
3659fe2c14SBruce Evans.Nd remote magtape protocol module
3759fe2c14SBruce Evans.Sh SYNOPSIS
38e97407b4SRuslan Ermilov.Nm
3959fe2c14SBruce Evans.Sh DESCRIPTION
40490d5836SPhilippe CharnierThe
41490d5836SPhilippe Charnier.Nm
42490d5836SPhilippe Charnierutility is used by the remote dump and restore programs
4359fe2c14SBruce Evansin manipulating a magnetic tape drive through an interprocess
4407bfccd7SRuslan Ermilovcommunication connection.
4507bfccd7SRuslan ErmilovIt is normally started up with an
4659fe2c14SBruce Evans.Xr rcmd 3
4759fe2c14SBruce Evanscall.
4859fe2c14SBruce Evans.Pp
4959fe2c14SBruce EvansThe
5012873ebfSPhilippe Charnier.Nm
51490d5836SPhilippe Charnierutility accepts requests specific to the manipulation of
5259fe2c14SBruce Evansmagnetic tapes, performs the commands, then responds with
5307bfccd7SRuslan Ermilova status indication.
5407bfccd7SRuslan ErmilovAll responses are in
5559fe2c14SBruce Evans.Tn ASCII
5659fe2c14SBruce Evansand in
5759fe2c14SBruce Evansone of two forms.
5859fe2c14SBruce EvansSuccessful commands have responses of:
5946eea498SRuslan Ermilov.Bd -ragged -offset indent
6059fe2c14SBruce Evans.Sm off
6159fe2c14SBruce Evans.Sy A Ar number No \en
6259fe2c14SBruce Evans.Sm on
6359fe2c14SBruce Evans.Ed
6459fe2c14SBruce Evans.Pp
6559fe2c14SBruce Evans.Ar Number
6659fe2c14SBruce Evansis an
6759fe2c14SBruce Evans.Tn ASCII
6859fe2c14SBruce Evansrepresentation of a decimal number.
6959fe2c14SBruce EvansUnsuccessful commands are responded to with:
7046eea498SRuslan Ermilov.Bd -ragged -offset indent
7159fe2c14SBruce Evans.Sm off
7259fe2c14SBruce Evans.Xo Sy E Ar error-number
7359fe2c14SBruce Evans.No \en Ar error-message
7459fe2c14SBruce Evans.No \en
7559fe2c14SBruce Evans.Xc
7659fe2c14SBruce Evans.Sm on
7759fe2c14SBruce Evans.Ed
7859fe2c14SBruce Evans.Pp
7959fe2c14SBruce Evans.Ar Error-number
8059fe2c14SBruce Evansis one of the possible error
8159fe2c14SBruce Evansnumbers described in
8259fe2c14SBruce Evans.Xr intro 2
8359fe2c14SBruce Evansand
8459fe2c14SBruce Evans.Ar error-message
8559fe2c14SBruce Evansis the corresponding error string as printed
8659fe2c14SBruce Evansfrom a call to
8759fe2c14SBruce Evans.Xr perror 3 .
8859fe2c14SBruce EvansThe protocol is comprised of the
8959fe2c14SBruce Evansfollowing commands, which are sent as indicated - no spaces are supplied
9059fe2c14SBruce Evansbetween the command and its arguments, or between its arguments, and
9159fe2c14SBruce Evans.Ql \en
9259fe2c14SBruce Evansindicates that a newline should be supplied:
9359fe2c14SBruce Evans.Bl -tag -width Ds
9459fe2c14SBruce Evans.Sm off
9559fe2c14SBruce Evans.It Xo Sy \&O Ar device
9659fe2c14SBruce Evans.No \en Ar mode No \en
9759fe2c14SBruce Evans.Xc
98610a5778SRuslan Ermilov.Sm on
9959fe2c14SBruce EvansOpen the specified
10059fe2c14SBruce Evans.Ar device
10159fe2c14SBruce Evansusing the indicated
10259fe2c14SBruce Evans.Ar mode .
10359fe2c14SBruce Evans.Ar Device
10459fe2c14SBruce Evansis a full pathname and
10559fe2c14SBruce Evans.Ar mode
10659fe2c14SBruce Evansis an
10759fe2c14SBruce Evans.Tn ASCII
10859fe2c14SBruce Evansrepresentation of a decimal
10959fe2c14SBruce Evansnumber suitable for passing to
11059fe2c14SBruce Evans.Xr open 2 .
11159fe2c14SBruce EvansIf a device had already been opened, it is
11259fe2c14SBruce Evansclosed before a new open is performed.
113610a5778SRuslan Ermilov.Sm off
11459fe2c14SBruce Evans.It Xo Sy C Ar device No \en
11559fe2c14SBruce Evans.Xc
116610a5778SRuslan Ermilov.Sm on
11707bfccd7SRuslan ErmilovClose the currently open device.
11807bfccd7SRuslan ErmilovThe
11959fe2c14SBruce Evans.Ar device
12059fe2c14SBruce Evansspecified is ignored.
121610a5778SRuslan Ermilov.Sm off
12259fe2c14SBruce Evans.It Xo Sy L
12359fe2c14SBruce Evans.Ar whence No \en
12459fe2c14SBruce Evans.Ar offset No \en
12559fe2c14SBruce Evans.Xc
12659fe2c14SBruce Evans.Sm on
12759fe2c14SBruce EvansPerform an
12859fe2c14SBruce Evans.Xr lseek 2
12959fe2c14SBruce Evansoperation using the specified parameters.
13059fe2c14SBruce EvansThe response value is that returned from the
131aae2e035SPhilippe Charnier.Xr lseek 2
13259fe2c14SBruce Evanscall.
13359fe2c14SBruce Evans.Sm off
13459fe2c14SBruce Evans.It Sy W Ar count No \en
13559fe2c14SBruce Evans.Sm on
13659fe2c14SBruce EvansWrite data onto the open device.
137490d5836SPhilippe CharnierThe
138490d5836SPhilippe Charnier.Nm
139490d5836SPhilippe Charnierutility reads
14059fe2c14SBruce Evans.Ar count
14159fe2c14SBruce Evansbytes from the connection, aborting if
14259fe2c14SBruce Evansa premature end-of-file is encountered.
14359fe2c14SBruce EvansThe response value is that returned from
14459fe2c14SBruce Evansthe
14559fe2c14SBruce Evans.Xr write 2
14659fe2c14SBruce Evanscall.
14759fe2c14SBruce Evans.Sm off
14859fe2c14SBruce Evans.It Sy R Ar count No \en
14959fe2c14SBruce Evans.Sm on
15059fe2c14SBruce EvansRead
15159fe2c14SBruce Evans.Ar count
15259fe2c14SBruce Evansbytes of data from the open device.
15359fe2c14SBruce EvansIf
15459fe2c14SBruce Evans.Ar count
15559fe2c14SBruce Evansexceeds the size of the data buffer (10 kilobytes), it is
15659fe2c14SBruce Evanstruncated to the data buffer size.
157490d5836SPhilippe CharnierThe
158490d5836SPhilippe Charnier.Nm
159490d5836SPhilippe Charnierutility then performs the requested
16059fe2c14SBruce Evans.Xr read 2
16159fe2c14SBruce Evansand responds with
16259fe2c14SBruce Evans.Sm off
16359fe2c14SBruce Evans.Sy A Ar count-read No \en
16459fe2c14SBruce Evans.Sm on
16559fe2c14SBruce Evansif the read was
16659fe2c14SBruce Evanssuccessful; otherwise an error in the
16707bfccd7SRuslan Ermilovstandard format is returned.
16807bfccd7SRuslan ErmilovIf the read
16959fe2c14SBruce Evanswas successful, the data read is then sent.
17059fe2c14SBruce Evans.Sm off
17159fe2c14SBruce Evans.It Xo Sy I Ar operation
17259fe2c14SBruce Evans.No \en Ar count No \en
17359fe2c14SBruce Evans.Xc
17459fe2c14SBruce Evans.Sm on
17559fe2c14SBruce EvansPerform a
17659fe2c14SBruce Evans.Dv MTIOCOP
17759fe2c14SBruce Evans.Xr ioctl 2
17859fe2c14SBruce Evanscommand using the specified parameters.
17959fe2c14SBruce EvansThe parameters are interpreted as the
18059fe2c14SBruce Evans.Tn ASCII
18159fe2c14SBruce Evansrepresentations of the decimal values
18259fe2c14SBruce Evansto place in the
18359fe2c14SBruce Evans.Ar mt_op
18459fe2c14SBruce Evansand
18559fe2c14SBruce Evans.Ar mt_count
18659fe2c14SBruce Evansfields of the structure used in the
187af20a13dSPhilippe Charnier.Xr ioctl 2
18807bfccd7SRuslan Ermilovcall.
18907bfccd7SRuslan ErmilovThe return value is the
19059fe2c14SBruce Evans.Ar count
19159fe2c14SBruce Evansparameter when the operation is successful.
19259fe2c14SBruce Evans.It Sy S
19359fe2c14SBruce EvansReturn the status of the open device, as
19459fe2c14SBruce Evansobtained with a
19559fe2c14SBruce Evans.Dv MTIOCGET
196af20a13dSPhilippe Charnier.Xr ioctl 2
19707bfccd7SRuslan Ermilovcall.
19807bfccd7SRuslan ErmilovIf the operation was successful,
19959fe2c14SBruce Evansan ``ack'' is sent with the size of the
20059fe2c14SBruce Evansstatus buffer, then the status buffer is
20159fe2c14SBruce Evanssent (in binary).
20259fe2c14SBruce Evans.El
20359fe2c14SBruce Evans.Pp
20459fe2c14SBruce EvansAny other command causes
20512873ebfSPhilippe Charnier.Nm
20659fe2c14SBruce Evansto exit.
20759fe2c14SBruce Evans.Sh DIAGNOSTICS
20859fe2c14SBruce EvansAll responses are of the form described above.
20959fe2c14SBruce Evans.Sh SEE ALSO
21059fe2c14SBruce Evans.Xr rcmd 3 ,
21159fe2c14SBruce Evans.Xr mtio 4 ,
21259fe2c14SBruce Evans.Xr rdump 8 ,
21359fe2c14SBruce Evans.Xr rrestore 8
21459fe2c14SBruce Evans.Sh HISTORY
21559fe2c14SBruce EvansThe
21659fe2c14SBruce Evans.Nm
217490d5836SPhilippe Charnierutility appeared in
21859fe2c14SBruce Evans.Bx 4.2 .
21959a3c79dSRuslan Ermilov.Sh BUGS
22059a3c79dSRuslan ErmilovPeople should be discouraged from using this for a remote
22159a3c79dSRuslan Ermilovfile access protocol.
222