Chinaunix首页 | 论坛 | 博客
  • 博客访问: 680415
  • 博文数量: 291
  • 博客积分: 10025
  • 博客等级: 上将
  • 技术积分: 2400
  • 用 户 组: 普通用户
  • 注册时间: 2004-12-04 12:04
文章分类

全部博文(291)

文章存档

2008年(102)

2007年(112)

2006年(75)

2004年(2)

我的朋友

分类:

2006-08-14 15:43:47

the related command are listed as below:

vmkfstools –P /vmfs/volumes/UUID

esxcfg-vmhbadevs –m

 

sample output of above command:

[root@BI-ESX2 root]# vmkfstools -P /vmfs/volumes/44ca1e30-b2c1c8a4-236f-003048854822/

VMFS-3.21 file system spanning 1 partitions.

File system label (if any): FC-2TLUN

Mode: public

Capacity 2198217949184 (2096384 file blocks * 1048576), 2032620535808 (1938458 blocks) avail

UUID: 44ca1e30-b2c1c8a4-236f-003048854822

Partitions spanned:

        vmhba0:0:0:1

 

[root@BI-ESX2 root]# esxcfg-vmhbadevs –m

vmhba0:0:0          /dev/sda

vmhba0:0:1          /dev/sdb

vmhba40:0:1         /dev/sdc

 

 

using below shell script:

esxcfg-vmhbadevs -m|while read VMK COS UUID

do

        LABEL=$(cd /vmfs/volumes; file *|grep symbolic|grep $UUID|awk -F ":" {print $1}')

        echo $VMK $COS $UUID $LABEL

 

done

 

sample output:

vmhba0:0:0:1 /dev/sda1 44ca1e30-b2c1c8a4-236f-003048854822 FC-2TLUN

vmhba40:0:1:1 /dev/sdc1 44ce1155-4e7c1156-18af-003048854822 iSCSI-2TLUN

 

the original perl script is from:

#!/usr/bin/perl

@array = `/usr/sbin/esxcfg-vmhbadevs -m`;

foreach (@array)
{
($vmk, $cos, $uuid) = split;
($tmp, $label) = split (/:/, `/usr/sbin/vmkfstools -P /vmfs/volumes/${uuid} | grep "File system label"`);

print "$vmk \t $cos \t $uuid \t $label\n";
}

but my script is more efficient than it since I haven’t use the vmkfstools –P command

 

阅读(456) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~