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.
You need to obtain a different version of mt which does support compression. The canonical linux
mt
ismt-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.After some reading it appears that right way to do this is to create
/etc/stinit.def
file, define modes 1-4 and then runstinit
. This will configure corresponding devices based on the settings from the file. Thest
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 ofst-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 themt-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/StinitDefYou 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