RMT(8)
π NAME π
rmt β the remote magtape protocol module. Yep, that's her. She lives in the RMT(8) section, filed under System management commands, and she is lowkey legendary for how much she does while saying so little. π
π¦ SYNOPSIS π¦
rmt
No flags. No args. She simply is. β¨
β¨ DESCRIPTION β¨
okay so bestie, picture this: rmt is a program that gets used by the remote dump(8), restore(8) or tar(1) programs when they need to manipulate a magnetic tape drive π through an interprocess communication connection. And rmt is normally started up with an rexec(3) or rcmd(3) call, iykyk.
Here's the whole vibe: rmt accepts requests specific to the manipulation of magnetic tapes, performs the commands, then responds with a status indication. Every single response is in ASCII and comes in one of the following 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 intro(2) and error-message is the corresponding error string as printed from a call to perror(3). She said "error, but make it informative." π
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. No cap, spaces are simply not invited to this party. π
Odevice\nmode\nβ Open the specified device using the indicated mode.Deviceis a full pathname andmodeis an ASCII representation of a decimal number suitable for passing toopen(2). If a device had already been opened, it is closed before a new open is performed. Out with the old, in with the new, periodt. π₯Cdevice\nβ Close the currently open device. Thedevicespecified is ignored. She's closing regardless bestie, don't take it personally. πLwhence\noffset\nβ Perform anlseek(2)operation using the specified parameters. The response value is that returned from thelseekcall. πWcount\nβ 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 the data buffer size.rmtthen performs the requestedread(2)and responds withAcount-read\nif 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 aMTIOCOPioctl(2)command using the specified parameters. The parameters are interpreted as the ASCII representations 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 the I-1\n0\n command, a client will specify that he is using the VERSION 1 protocol. π°οΈ
For a VERSION 0 client, the operation parameter is the platform mt_op value (could be different if the client and the rmt server are on two different platforms). For a VERSION 1 client, the operation parameter 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).
ioperation\ncount\nβ Perform an extendedMTIOCOPioctl(2)command using the specified parameters. The parameters are interpreted as the ASCII representations 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 spacecountfiles to BOF).
Sβ Return the status of the open device, as obtained with aMTIOCGETioctlcall. If the operation was successful, an βackβ is sent with the size of the status buffer, then the status buffer is sent (in binary, which is non-portable between different platforms). π¨ Binary, bestie. Non-portable. Different platforms are NOT getting along here, that's just the tea.ssub-commandβ This is a replacement for the previousScommand, portable across different platforms. If the open device is a magnetic tape, return members of the magnetic tape status structure, as obtained with aMTIOCGETioctlcall. If the open device is not a magnetic tape, an error is returned. If theMTIOCGEToperation was successful, the numerical value of the structure member is returned in decimal. The following sub commands are supported:Tβ return the content of the structure membermt_typewhich contains the type of the magnetic tape device.Dβ return the content of the structure membermt_dsregwhich contains the "drive status register".Eβ return the content of the structure membermt_erregwhich contains the "error register". This structure member must be retrieved first because it is cleared after eachMTIOCGETioctl call. β οΈ First or it's gone forever, she does not wait.Rβ return the content of the structure membermt_residwhich contains the residual count of the last I/O.Fβ return the content of the structure membermt_filenowhich contains the file number of the current tape position.Bβ return the content of the structure membermt_blknowhich contains the block number of the current tape position.fβ return the content of the structure membermt_flagswhich containsMTF_flags from the driver.bβ return the content of the structure membermt_bfwhich contains the optimum blocking factor.
Any other command causes rmt to exit. π She has boundaries. Respect them.
π DIAGNOSTICS π
All responses are of the form described above. That's it, that's the whole diagnostic section, she said "you already have the format, go crazy." π
π₯ SEE ALSO π₯
rcmd(3)rexec(3)/usr/include/sys/mtio.hrdump(8)rrestore(8)
Go read those too, bestie, she's not gatekeeping. π
π BUGS π
People should be discouraged from using this for a remote file access protocol.
Like, genuinely. This is the original's own words and I'm passing them along with full eye contact: discouraged. Please. π
π AUTHOR π
The dump/restore backup suit was ported to Linux's Second Extended File System by Remy Card <card@Linux.EU.Org>. He maintained the initial versions of dump (up and including 0.4b4, released in january 1997). π«‘
Starting with 0.4b5, the new maintainer is Stelian Pop <stelian@popies.net>. π
Since release 0.4b49 the new maintainer is Tim Woodall <debianbugs@woodall.me.uk>. Newest main character, we love a succession arc. π
π AVAILABILITY π
The dump/restore backup suit is available from https://dump.sourceforge.io π
πΈ HISTORY πΈ
The rmt command appeared in 4.2BSD. Vintage. Iconic. She's been doing this since before either of us existed. π°οΈβ¨
And that's the whole page, bestie β this was RMT(8), BSD, version 0.4b55 of 10 Jun 2026. Go forth, manipulate those magnetic tapes responsibly, and remember: no spaces between the command and its arguments. Periodt. π
ππ¦
π¦ where this page comes from
- ubuntu stonking: dump 0.4b55-3 Β· BSD-3-Clause
- Copyright (c) 1983, 1991, 1993 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms