3

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.

Jonas Stein
  • 406
  • 5
  • 14
dtoubelis
  • 4,677
  • 1
  • 29
  • 32

3 Answers3

4

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.

Phil Hollenback
  • 14,947
  • 4
  • 35
  • 52
1

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 define 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.

Update: Here is reference to stinit.def file https://wiki.debian.org/StinitDef

dtoubelis
  • 4,677
  • 1
  • 29
  • 32
0

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:

http://linux.die.net/man/1/tapeinfo

http://linux.die.net/man/1/mt

Beel
  • 149
  • 1
  • 9