게시물 1,060건
   
virt-df - Display free space on virtual filesystems
글쓴이 : 최고관리자 날짜 : 2019-03-15 (금) 15:12 조회 : 2843
글주소 :
                                
할당된 디스크 크기만 보여지는게 아니라 실제 VM에서 사용하고 있는 내용을 실시간으로 반영하여 나타낸다.

"virt-df" is a command line tool to display free space on virtual machine filesystems.  
Unlike other tools, it doesn't just display the size of disk allocated to a virtual machine, but can look inside disk images to see how much space is really being used.

If used without any -a or -d arguments, "virt-df" checks with libvirt to get a list of all active and inactive guests, and performs a "df"-type operation on each one in turn, printing out the results.

If any -a or -d arguments are specified, "virt-df" performs a "df"-type operation on either the single named libvirt domain, or on the disk image(s) listed on the command line (which must all belong to a single VM).  In this mode (with arguments), "virt-df" will only work for a single guest.  If you want to run on multiple guests, then you have to invoke "virt-df" multiple times.

Use the --csv option to get a format which can be easily parsed by other programs.  Other options are similar to the standard df(1) command.


Usage:
  virt-df [--options] -d domname
  virt-df [--options] -a disk.img [-a disk.img ...]
Options:
  -a|--add image       Add image
  -c|--connect uri     Specify libvirt URI for -d option
  --csv                Output as Comma-Separated Values
  -d|--domain guest    Add disks from libvirt guest
  --format[=raw|..]    Force disk format for -a option
  -h|--human-readable  Human-readable sizes in --long output
  --help               Display brief help
  -i|--inodes          Display inodes
  --one-per-guest      Separate appliance per guest
  -P nr_threads        Use at most nr_threads
  --uuid               Add UUIDs to --long output
  -v|--verbose         Verbose messages
  -V|--version         Display version and exit
  -x                   Trace libguestfs API calls



# apt install libguestfs-tool
# virt-df <IMAGE_FILE>
Filesystem                           1K-blocks       Used  Available  Use%
disk:/dev/sda1                        25226960    1927552   23283024    8%
disk:/dev/sda15                              0          0          0    4%

# virt-df -a <<IMAGE_FILE1> -a <IMAGE_FILE2>
Filesystem                           1K-blocks       Used  Available  Use%
disk+:/dev/sda1                       25226960    2879440   22331136   12%
disk+:/dev/sda15                             0          0          0    4%
disk+:/dev/sdb1                       25226960    1653884   23556692    7%
disk+:/dev/sdb15                             0          0          0    4%

# virt-df <IMAGE_FILE> -h
Filesystem                                Size       Used  Available  Use%
disk:/dev/sda1                             24G       2.7G        21G   12%
disk:/dev/sda15                           104M       3.3M       101M    4%

# virt-filesystems --long --blkdevs --parts -h -a disk
Name        Type       MBR  Size  Parent
/dev/sda1   partition  -    25G   /dev/sda
/dev/sda14  partition  -    4.0M  /dev/sda
/dev/sda15  partition  -    106M  /dev/sda
/dev/sda    device     -    25G   -


이름 패스워드
비밀글 (체크하면 글쓴이만 내용을 확인할 수 있습니다.)
왼쪽의 글자를 입력하세요.
   

 



 
사이트명 : 모지리네 | 대표 : 이경현 | 개인커뮤니티 : 랭키닷컴 운영체제(OS) | 경기도 성남시 분당구 | 전자우편 : mojily골뱅이chonnom.com Copyright ⓒ www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.