Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > M


HP-UX 11i Version 3: February 2007

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index


mt — magnetic tape manipulating program


mt [-f tapename] command [count]


mt [-t tapename] command [count]


mt is used to give commands to the tape drive. If tapename is not specified, the environment variable TAPE is used; if TAPE is not defined, the default drive is used.

mt winds the tape in the requested direction (forward or backward), stopping after the specified count EOF marks or records are passed. If count is not specified, one is assumed. Each EOF mark counts as one record. When winding backwards, the tape always stops at the BOT marker, regardless of the number remaining in count.

mt accepts the following commands:


Write count EOF marks.


Forward space count files.


Forward space count records.


Backward space count files.


Backward space count records.


Rewind tape.


Rewind tape and go offline.


Seek to end of data (DDS and QIC drives only).


Write count setmarks (DDS drives only).


Forward space count setmarks (DDS drives only).


Backward space count setmarks (DDS drives only).


Print status information about the tape drive.


Reserve tape drive for sole use by the host issuing the mt command (stape or estape driver only).


Release tape drive from sole use by the host issuing the mt command (stape or estape driver only).

Spacing operations (back or forward space file or record) leave the tape positioned past the object being spaced to in the direction of motion. That is, backspacing a file leaves the the tape positioned before the file mark, forward spacing a file leaves the tape positioned after the file mark. This is consistent with all classical usage on tapes.


Only raw, no-rewind Berkeley-type devices should be specified. This type of device will not reposition the tape upon close. An example of such a device is /dev/rmt/0mnb or /dev/rtape/tape1_BESTnb. See mt(7) for more details.

It is possible to wind the tape beyond the EOT marker and off the end of the reel.

A reservation may only be cleared with a release by the host that issued the original reserve. In the event that the host that holds the reservation is no longer available, the st command may be used to reclaim the device by issuing a bus device reset. See st(1M) for more details.

The reserve/release functionality can only be issued to drives using the stape or estape driver.


Rewind the tape associated with the device file /dev/rmt/0mnb or /dev/rtape/tape1_BESTnb (if legacy DSF is disabled):

mt -f /dev/rmt/0mnb rew



Raw magnetic tape interface (stape)


Raw magnetic tape interface (estape)


Default tape interface. If legacy DSF is disabled, the default value is /dev/rtape/tape1_BESTnb.


mt was developed by the University of California, Berkeley.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.