2010-01-07 磁盘阵列、tar和磁带机使用的若干问题(linux)

一、识别新连接的磁盘阵列上的LUN

一台IBM xSeries 366服务器,安装Redhat Enterprise Linux AS 4.3操作系统。服务器运行中,将一台IBM TotalStorage DS4300磁盘阵列连接到它的Qlogic 2340光纤卡上,光纤卡使用Redhat自带的驱动程序。通过使用Qlogic提供的工具,可以在不重启服务器的情况下,让系统识别盘阵上的LUN。
在Qlogic官方网站的Downloads页下部,依次选择产品类型、型号、操作系统平台。我选择的是“Fibre Channel Adapters”-“QLA2340”-“Linux Red Hat(32-bit)”,点击Go按钮。接下来的一页,在“Management Tools”一栏里,找到“Linux Tools”下面的“Linux Utilities”,这是一个工具集,下载之。
解开下载到的压缩包,发现LinuxTools目录下还有几个压缩包,其中有一个名为ql-dynamic-tgt-lun-disc-2.16.tgz的,Qlogic官网上的描述是“Scans for newly added LUNs”。将这个压缩包解开:

[@more@][root@redhat-db software]# tar -zxf qlafc-linux-8.02.23-3-install.tgz
[root@redhat-db software]# ls
qlafc-linux-8.02.23-3-install qlafc-linux-8.02.23-3-install.tgz
[root@redhat-db software]# cd qlafc-linux-8.02.23-3-install
[root@redhat-db qlafc-linux-8.02.23-3-install]# ls
agents qla2xxx-v8.02.23-3.noarch.rpm ql-pci.ids scli-1.7.2-7.i386.rpm scli-1.7.2-7.ppc64.rpm
LinuxTools qlinstall README.qlinstall.txt scli-1.7.2-7.ia64.rpm set_driver_param
[root@redhat-db qlafc-linux-8.02.23-3-install]# cd LinuxTools/
[root@redhat-db LinuxTools]# ls
ql-dynamic-tgt-lun-disc-2.17.tgz ql-hba-snapshot-1.14.tgz ql-set-cmd-timeout-1.8.tgz
ql-hba-collect-1.10.tgz ql-lun-state-online-1.6.tgz uncompress_all.sh
[root@redhat-db LinuxTools]# tar -zxf ql-dynamic-tgt-lun-disc-2.17.tgz
[root@redhat-db LinuxTools]# cd ql-dynamic-tgt-lun-disc-2.17
[root@redhat-db ql-dynamic-tgt-lun-disc-2.17]# ls
COPYING README.ql-dynamic-tgt-lun-disc.txt sg3_utils-1.23.tgz
ql-dynamic-tgt-lun-disc.sh revision.qldynamic.txt

运行其中的ql-dynamic-tgt-lun-disc.sh脚本即可,更多使用方法可参考README.ql-dynamic-tgt-lun-disc.txt。

二、tar使用绝对文件名

tar的基本语法是:tar []
例如:tar -c -f test.tar test.txt
也可简写作:tar -cvf test.tar test.txt

正常情况下,tar会将成员名称当作相对文件名处理。如果使用绝对文件名,最前面的 / 会被去掉,提示“tar: Removing leading `/' from member

names”。见下例:

[root@redhat-db tmp]# pwd
/tmp
[root@redhat-db tmp]# touch test.txt
[root@redhat-db tmp]# ls test.txt
test.txt
[root@redhat-db tmp]# tar -cvf test.tar /tmp/test.txt
tar: Removing leading `/' from member names
/tmp/test.txt
[root@redhat-db tmp]# tar -tvf test.tar
-rw-r--r-- root/root 0 2010-01-06 22:16:52 tmp/test.txt

可以看到tar包中的内容不只是test.txt,外层还有个目录tmp。释放tar包中的内容:

[root@redhat-db tmp]# rm test.txt
rm: remove regular empty file `test.txt'? y
[root@redhat-db tmp]# tar -xvf test.tar
tmp/test.txt
[root@redhat-db tmp]# ls test.txt
ls: test.txt: No such file or directory
[root@redhat-db tmp]# cd tmp
[root@redhat-db tmp]# pwd
/tmp/tmp
[root@redhat-db tmp]# ls test.txt
test.txt
[root@redhat-db tmp]# cd ..
[root@redhat-db tmp]#

如果要使用绝对文件名,需要指定 -P 选项。

[root@redhat-db tmp]# pwd
/tmp
[root@redhat-db tmp]# mv tmp/test.txt ./
[root@redhat-db tmp]# rmdir tmp
[root@redhat-db tmp]# rm test.tar
rm: remove regular file `test.tar'? y
[root@redhat-db tmp]# tar -cvPf test.tar /tmp/test.txt
/tmp/test.txt
[root@redhat-db tmp]# tar -tvf test.tar
-rw-r--r-- root/root 0 2010-01-06 22:16:52 /tmp/test.txt

从tar包中释放内容时如果不指定 -P 选项,成员名称最前面的 / 还是会被去掉。

[root@redhat-db tmp]# rm test.txt
rm: remove regular empty file `test.txt'? y
[root@redhat-db tmp]# tar -xvf test.tar
/tmp/test.txt
tar: Removing leading `/' from member names
[root@redhat-db tmp]# ls test.txt
ls: test.txt: No such file or directory
[root@redhat-db tmp]# cd tmp
[root@redhat-db tmp]# ls test.txt
test.txt
[root@redhat-db tmp]# cd ..
[root@redhat-db tmp]#

使用 -P 选项进行释放:

[root@redhat-db tmp]# pwd
/tmp
[root@redhat-db tmp]# rm -rf tmp
[root@redhat-db tmp]# tar -xvPf test.tar
/tmp/test.txt
[root@redhat-db tmp]# ls test.txt
test.txt
[root@redhat-db tmp]# ls tmp
ls: tmp: No such file or directory


三、磁带的容量

一台IBM TotalStorage 3580磁带机,通过查看磁带颜色就可以确定磁带容量。ULtrium 1为黑色,100GB;ULtrium 2为紫色,200GB;Ultrium 3为暗蓝灰色,400GB。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11662464/viewspace-1030374/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/11662464/viewspace-1030374/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值