There is no simple command to display the total amount of VxVM disk space (i.e., the total size of all the public regions or the sum of the free and allocated disk space under VxVM control).
Listed below are a few examples of how it is possible to use the vxprint and vxdisk commands to find the amount of VxVM disk space:
1.) To find the total amount of VxVM disk space (free and used) in a particular disk group, expressed in 512K blocks:
# vxprint -g name_of_disk_group -dF "%publen" | awk 'BEGIN {s = 0} {s += $1} END {print s, "512K blocks"}'
For the output in Gigabytes, use:
# vxprint -g name_of_disk_group -dF "%publen" | awk 'BEGIN {s = 0} {s += $1} END {print s/2097152, "GB"}'
Henceforth all output will be in GigaBytes. Adjust the commands for blocks if you wish.
2.) To find the total amount of VxVM disk space for all disk groups:
# vxprint -AQqdF "%publen" | awk 'BEGIN {s = 0} {s += $1} END {print s/2097152, "GB"}'
3.) To include the space on disks that were in a disk group that was deported, or space that was not associated with any disk groups but were already under VxVM or in other words, to find out the total space or capacity of all VxVM disks, use vxdisk:
# vxdisk -q list | awk '{ if ($5 == "online") print $1}' | xargs vxdisk list | grep "^public:" | awk -F'=' 'BEGIN {s=0} {s+=$NF} END {print s/2097152, "GB"}'
4.) To determine the total amount of free space in a disk group:
# vxassist -g
Комментариев нет:
Отправить комментарий