分类:
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-b
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-b
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-b
vmhba40:0:1:1 /dev/sdc1 44ce1155-4e
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