<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.scott5.org/index.php?action=history&amp;feed=atom&amp;title=How_to_use_a_tape_drive</id>
	<title>How to use a tape drive - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.scott5.org/index.php?action=history&amp;feed=atom&amp;title=How_to_use_a_tape_drive"/>
	<link rel="alternate" type="text/html" href="https://wiki.scott5.org/index.php?title=How_to_use_a_tape_drive&amp;action=history"/>
	<updated>2026-04-13T00:34:02Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://wiki.scott5.org/index.php?title=How_to_use_a_tape_drive&amp;diff=336&amp;oldid=prev</id>
		<title>Scott: /* Moving data directly from a tape drive to a remote host */</title>
		<link rel="alternate" type="text/html" href="https://wiki.scott5.org/index.php?title=How_to_use_a_tape_drive&amp;diff=336&amp;oldid=prev"/>
		<updated>2011-02-02T23:32:39Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Moving data directly from a tape drive to a remote host&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
== Setup ==&lt;br /&gt;
On Red Hat systems, install the &amp;lt;code&amp;gt;mt-st&amp;lt;/code&amp;gt; package to get the &amp;lt;code&amp;gt;mt&amp;lt;/code&amp;gt; command. &lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
If you refer to the tape drive as /dev/st0, it will automatically rewind after the command has finished. Refer to it as /dev/nst0 if you don&amp;#039;t want it to rewind.&lt;br /&gt;
&lt;br /&gt;
To see where you are on the tape:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mt -f /dev/nst0 status&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To explicitly rewind the tape:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mt -f /dev/st0 rewind&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To skip ahead to the next record:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mt -f /dev/nst0 fsf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To copy data to the tape:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tar cf /dev/st0 /etc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To read data from the tape (and write to disk):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tar xf /dev/st0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To erase the tape:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mt -f /dev/st0 erase&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To eject the tape:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mt -f /dev/st0 eject&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other &amp;lt;code&amp;gt;mt&amp;lt;/code&amp;gt; options that may or may not work:&lt;br /&gt;
* &amp;lt;code&amp;gt;fsf&amp;lt;/code&amp;gt; - Forward space count files. The tape is positioned on the first block of the next file.&lt;br /&gt;
* &amp;lt;code&amp;gt;fsfm&amp;lt;/code&amp;gt; - Forward space count files. The tape is positioned on the last block of the previous file.&lt;br /&gt;
* &amp;lt;code&amp;gt;bsf&amp;lt;/code&amp;gt; - Backward space count files. The tape is positioned on the last block of the previous file.&lt;br /&gt;
* &amp;lt;code&amp;gt;bsfm&amp;lt;/code&amp;gt; - Backward space count files. The tape is positioned on the first block of the next file. &lt;br /&gt;
  &lt;br /&gt;
== Moving data directly from a tape drive to a remote host ==&lt;br /&gt;
On the remote host (assuming barney can access the tape drive on koala): &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tar --rsh-command=/usr/bin/ssh -xf barney@koala:/dev/st0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(or xzf if the tape is compressed)&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
	</entry>
</feed>