Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an LTO-4 tape connected to a Linux host and Linux creates all the usual devices for this tape as follows:

  • /dev/nst0
  • /dev/nst0a
  • /dev/nst0l
  • /dev/nst0m
  • /dev/st0
  • /dev/st0a
  • /dev/st0l
  • /dev/st0m

I normally use /dev/st0 and /dev/nst0 devices for writing to the tape but now I want to try hardware compression. I assumed that I simply need to use one of the other devices but here is the question - which one? I read trough documentation and I even looked at source code of the driver but I could not find a straight answer. So, ideas are welcome.

share|improve this question

You need to obtain a different version of mt which does support compression. The canonical linux mt is mt-st. Here's the source for mt-st.

Here's a howto with some good info on using tape drives in linux.

You can use mt status to determine if compression is turned on for a particular device.

share|improve this answer
up vote 1 down vote accepted

After some reading it appears that right way to do this is to create /etc/stinit.def file, define modes 1-4 and then run stinit. This will configure corresponding devices based on the settings from the file. The st driver will give some reasonable defaults for tape devices event without this file but apparently there is no way to know what those are. The /etc/stinit.def is a good place to dfine them explicitly. SLES11 comes with version 0.9b of st-mt package and it does not have an init script to run at boot time, so some manual scripting is required. It seems that with the latest version 1.1 of the mt-st package the init script is already included, so only configuration file is needed.

share|improve this answer
Wow that sounds a lot different from how CentOS works. – Phil Hollenback Apr 20 '11 at 7:40
Centos also has v0.9b of mt-st package from default repos, so it should work identically. You can of course change compression settings on the fly with mt but I just want something more permanent. – dtoubelis Apr 20 '11 at 20:10

You can probably just set the COMPRESSION attribute by using the linux "mt" command. And the "tapeinfo" utility will verify that compression is on.

Here are places to read the details:

share|improve this answer
Strangelly enough, on SLES11 mt does not have compress option and there is no tapeinfo at all. – dtoubelis Apr 20 '11 at 4:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.