OEL6.8安装虚拟带库模拟器

最近在虚拟机下搭建了一个OSB备份环境,其中使用到了虚拟带库,以下是虚拟带库的配置过程,简要记录之。

1、下载虚拟带库的源码(mhvtl-2016-03-10.tgz)。

2、解压缩源码。

# cd /tmp

# gunzip mhvtl-2016-03-10.tgz

# tar -xvf mhvtl-2016-03-10.tar

 

3、源码安装失败。

# cd /tmp/mhvtl-1.5/kernel

[root@vmtape kernel]# make

make -C /lib/modules/4.1.12-37.4.1.el6uek.x86_64/build SUBDIRS=/tmp/mhvtl-1.5/kernel modules

make: *** /lib/modules/4.1.12-37.4.1.el6uek.x86_64/build: No such file or directory. Stop.

make: *** [default] Error 2

[root@vmtape kernel]#

可见安装失败,提示缺少/lib/modules/4.1.12-37.4.1.el6uek.x86_64/build。

[root@vmtape kernels]# ll /lib/modules/4.1.12-37.4.1.el6uek.x86_64/build

lrwxrwxrwx. 1 root root 52 Dec 25 12:23 /lib/modules/4.1.12-37.4.1.el6uek.x86_64/build -> ../../../usr/src/kernels/4.1.12-37.4.1.el6uek.x86_64

[root@vmtape kernels]# cd /usr/src/kernels

[root@vmtape kernels]# ll

total 0

[root@vmtape kernels]#

发现/usr/src/kernels下没有任何内容。

解决办法:安装kernel-devel即可。

[root@vmtape kernels]# mount /dev/cdrom /mnt/cdrom

mount: block device /dev/sr0 is write-protected, mounting read-only

[root@vmtape kernels]# yum install -y kernel-devel

 

[root@vmtape kernels]# cd /usr/src/kernels

[root@vmtape kernels]# ll

total 4

drwxr-xr-x 22 root root 4096 Jan 11 22:08 2.6.32-642.el6.x86_64

[root@vmtape kernels]#

我们可以发现安装的是2.6.32-642.el6,而当前是4.1.12-37.4.1.el6uek UEK内核,只需要将当前内核切换到RedHat兼容即可。

[root@vmtape ~]# uname -a

Linux vmtape 4.1.12-37.4.1.el6uek.x86_64 #2 SMP Tue May 17 07:23:38 PDT 2016 x86_64 x86_64 x86_64 GNU/Linux

[root@vmtape ~]#

# vi /etc/grub.conf

default=0 修改为1

[root@vmtape ~]# uname -a

Linux vmtape 2.6.32-642.el6.x86_64 #1 SMP Tue May 10 12:00:56 PDT 2016 x86_64 x86_64 x86_64 GNU/Linux

[root@vmtape ~]#

 

3、修复错误后,重新源码安装。

[root@vmtape ~]# cd /tmp/mhvtl-1.5/kernel/

[root@vmtape kernel]# make

make -C /lib/modules/2.6.32-642.el6.x86_64/build SUBDIRS=/tmp/mhvtl-1.5/kernel modules

make[1]: Entering directory `/usr/src/kernels/2.6.32-642.el6.x86_64'

CC [M] /tmp/mhvtl-1.5/kernel/mhvtl.o

/tmp/mhvtl-1.5/kernel/mhvtl.c:304: warning: initialization from incompatible pointer type

Building modules, stage 2.

MODPOST 1 modules

CC /tmp/mhvtl-1.5/kernel/mhvtl.mod.o

LD [M] /tmp/mhvtl-1.5/kernel/mhvtl.ko.unsigned

NO SIGN [M] /tmp/mhvtl-1.5/kernel/mhvtl.ko

make[1]: Leaving directory `/usr/src/kernels/2.6.32-642.el6.x86_64'

[root@vmtape kernel]#

[root@vmtape kernel]# make install

install -o root -g root -m 644 mhvtl.ko /lib/modules/`uname -r`/kernel/drivers/scsi/;

depmod -a;

if [ -f "/etc/modprobe.d/unsupported-modules" ]; then

sed -i 's/^allow_unsupported_modules 0/allow_unsupported_modules 1/' /etc/modprobe.d/unsupported-modules;

fi

[root@vmtape kernel]#

 

[root@vmtape ~]# cd /tmp/mhvtl-1.5/

# make

# make install

 

4、重启操作系统。

# reboot

 

5、查看虚拟带库设备。

# lsscsi -g

……

[6:0:0:0] mediumx IBM 03584L32 4.02 - /dev/sg21

[6:0:1:0] tape IBM ULTRIUM-TD3 51TB - /dev/sg17

[6:0:2:0] tape IBM ULTRIUM-TD3 51TB - /dev/sg18

[6:0:3:0] tape IBM ULTRIUM-TD3 51TB - /dev/sg19

[6:0:4:0] tape IBM ULTRIUM-TD3 51TB - /dev/sg20

至此,虚拟带库已经安装完毕。

原文地址:https://www.cnblogs.com/missyou-shiyh/p/10381632.html