主要参考man page
virt-df 列出虚机文件系统的剩余空间
virt-df - Display free space on virtual filesystems
-a:后接镜像
[root@cloudmanager datapool]# virt-df -a centos56x64
Filesystem 1K-blocks Used Available Use%
centos56x64:/dev/sda1 194442 12858 171545 7%
centos56x64:/dev/vmvg/root 5872136 2155876 3413156 37%
-d:后接domain,就是虚机名
[root@cloudmanager ~]# virt-df cacti
Filesystem 1K-blocks Used Available Use%
cacti:/dev/sda1 495844 52884 417360 11%
cacti:/dev/VolGroup/lv_root 47033288 2281128 42362964 5%
-h:以M,G显示分区大小,可读性较强
[root@cloudmanager datapool]# virt-df -a centos56x64 -h
Filesystem Size Used Available Use%
centos56x64:/dev/sda1 190M 13M 168M 7%
centos56x64:/dev/vmvg/root 5.6G 2.1G 3.3G 37%
--csv:以表格的形式显示结果,这样可以导入数据库和电子表格里
[root@cloudmanager datapool]# virt-df -a centos56x64 --csv
VirtualMachine,Filesystem,1K-blocks,Used,Available,Use%
centos56x64,/dev/sda1,194442,12858,171545,6.6
centos56x64,/dev/vmvg/root,5872136,2155876,3413156,36.7
-i:显示inode
[root@cloudmanager datapool]# virt-df -a centos56x64 -i
Filesystem Inodes IUsed IFree IUse%
centos56x64:/dev/sda1 50200 35 50165 1%
centos56x64:/dev/vmvg/root 1516032 87962 1428070 6%
-V:显示版本号
[root@cloudmanager datapool]# virt-df -a centos56x64 -V
virt-df 1.16.19rhel=6,release=1.el6
-x:显示trace信息
[root@cloudmanager datapool]# virt-df -a centos56x64 -x
SEE ALSO
df(1), guestfs(3), guestfish(1), virt-filesystems(1), <http://libguestfs.org/>.