The project needs to use the tape library, first installs the Virtual tape library MHVTL to simulate, below is the detailed installation step, needs the friend to be possible to refer to under
1 Download source
From the website https://sites.google.com/site/linuxvtl2/home#mhvtl-download download the latest version of MHVTL, I am under the latest mhvtl-2013-10-20.tgz version.
2 Ensure kernel versions are consistent
Make sure your kernel is open and your system is running a version of the kernel, because MHVTL has a kernel module that compiles it, if the kernel is open and your system is running a kernel that is not a version, the kernel module in the installation MHVTL is not loaded into the kernel, Although it can be modified by the vermagic_string in the include/linux/vermagic.h of the source code to match the current PC kernel uname-r, it is not recommended.
3 Extract Source code
Tar Xvfz mhvtl-2013-10-20.tgz
4 Install four packages LSSCSI,SG3_UTILS,LIBLZO2-DEV,MTX directly with the Apt-get Install command to install it
Apt-get LSSCSI sg3_utils Liblzo2-dev MTX
The Liblzo2-dev package is not loaded when you compile MHVTL, you are prompted not to find the file lzo/lzoconf.h
5 Create MHVTL groups and users
/usr/sbin/groupadd--system VTL
/usr/sbin/useradd--system-c "vitrual Tape Library"-d/opt/vtl-g vtl-m VTL
6 Compiling kernel modules
CD Mhvtl-2013-10-20/kernel
Make
Make install
7 Compiling User space code
CD mhvtl-2013-10-20
Make
Make install
8 Modify/OPT/MHVTL and/ETC/MHVTL directory owners, do not modify the start MHVTL
Chown-r VTL:VTL/OPT/MHVTL
Chown-r VTL:VTL/ETC/MHVTL
/ETC/MHVTL is the configuration file path,/OPT/MHVTL is the virtual tape Library storage path
9 Starting the MHVTL daemon
/ETC/INIT.D/MHVTL start
10 View Virtual Tape library status information
Lsscsi-g
We can see that our virtual device is hanging on the hba#6, where the MEDIUMX type of device is the picker, in this case the/DEV/SG13,/DEV/SG14.
Run command mtx-f/DEV/SG13 status