1virt-df(1)                  Virtualization Support                  virt-df(1)
2
3
4

NAME

6       virt-df - Display free space on virtual filesystems
7

SYNOPSIS

9        virt-df [--options]
10
11        virt-df [--options] -d domname
12
13        virt-df [--options] -a disk.img [-a disk.img ...]
14
15       Old style:
16
17        virt-df [--options] domname
18
19        virt-df [--options] disk.img [disk.img ...]
20

DESCRIPTION

22       "virt-df" is a command line tool to display free space on virtual
23       machine filesystems.  Unlike other tools, it doesn't just display the
24       amount of space allocated to a virtual machine, but can look inside the
25       virtual machine to see how much space is really being used.
26
27       It is like the df(1) command, but for virtual machines, except that it
28       also works for Windows virtual machines.
29
30       If used without any arguments, "virt-df" checks with libvirt to get a
31       list of all active and inactive guests, and performs a "df"-type
32       operation on each one in turn, printing out the results.
33
34       If used with any argument(s), "virt-df" performs a "df"-type operation
35       on either the single named libvirt domain, or on the disk image(s)
36       listed on the command line (which must all belong to a single VM).  In
37       this mode (with arguments), "virt-df" will only work for a single
38       guest.  If you want to run on multiple guests, then you have to invoke
39       "virt-df" multiple times.
40
41       Use the "--csv" option to get a format which can be easily parsed by
42       other programs.  Other options are mostly similar to standard "df"
43       options.  See below for the complete list.
44

OPTIONS

46       --help
47           Display brief help.
48
49       -a file
50       --add file
51           Add file which should be a disk image from a virtual machine.  If
52           the virtual machine has multiple block devices, you must supply all
53           of them with separate -a options.
54
55           The format of the disk image is auto-detected.  To override this
56           and force a particular format use the --format=.. option.
57
58       -c URI
59       --connect URI
60           If using libvirt, connect to the given URI.  If omitted, then we
61           connect to the default libvirt hypervisor.
62
63           If you specify guest block devices directly (-a), then libvirt is
64           not used at all.
65
66       --csv
67           Write out the results in CSV format (comma-separated values).  This
68           format can be imported easily into databases and spreadsheets, but
69           read "NOTE ABOUT CSV FORMAT" below.
70
71       -d guest
72       --domain guest
73           Add all the disks from the named libvirt guest.
74
75       --format=raw|qcow2|..
76       --format
77           The default for the -a option is to auto-detect the format of the
78           disk image.  Using this forces the disk format for -a options which
79           follow on the command line.  Using --format with no argument
80           switches back to auto-detection for subsequent -a options.
81
82           For example:
83
84            virt-df --format=raw -a disk.img
85
86           forces raw format (no auto-detection) for "disk.img".
87
88            virt-df --format=raw -a disk.img --format -a another.img
89
90           forces raw format (no auto-detection) for "disk.img" and reverts to
91           auto-detection for "another.img".
92
93           If you have untrusted raw-format guest disk images, you should use
94           this option to specify the disk format.  This avoids a possible
95           security problem with malicious guests (CVE-2010-3851).
96
97       -h
98       --human-readable
99           Print sizes in human-readable format.
100
101           You are not allowed to use -h and --csv at the same time.
102
103       --inodes | -i
104           Print inodes instead of blocks.
105
106       --one-per-guest
107           Run one libguestfs appliance per guest.  Normally "virt-df" will
108           add the disks from several guests to a single libguestfs appliance.
109
110           You might use this option in the following circumstances:
111
112           ·   If you think an untrusted guest might actively try to exploit
113               the libguestfs appliance kernel, then this prevents one guest
114               from interfering with the stats printed for another guest.
115
116           ·   If the kernel has a bug which stops it from accessing a
117               filesystem in one guest (see for example RHBZ#635373) then this
118               allows libguestfs to continue and report stats for further
119               guests.
120
121       --uuid
122           Print UUIDs instead of names.  This is useful for following a guest
123           even when the guest is migrated or renamed, or when two guests
124           happen to have the same name.
125
126           Note that only domains that we fetch from libvirt come with UUIDs.
127           For disk images, we still print the disk image name even when this
128           option is specified.
129
130       -v
131       --verbose
132           Enable verbose messages for debugging.
133
134       -V
135       --version
136           Display version number and exit.
137
138       -x  Enable tracing of libguestfs API calls.
139

NOTE ABOUT CSV FORMAT

141       Comma-separated values (CSV) is a deceptive format.  It seems like it
142       should be easy to parse, but it is definitely not easy to parse.
143
144       Myth: Just split fields at commas.  Reality: This does not work
145       reliably.  This example has two columns:
146
147        "foo,bar",baz
148
149       Myth: Read the file one line at a time.  Reality: This does not work
150       reliably.  This example has one row:
151
152        "foo
153        bar",baz
154
155       For shell scripts, use "csvtool" (<http://merjis.com/developers/csv>
156       also packaged in major Linux distributions).
157
158       For other languages, use a CSV processing library (eg. "Text::CSV" for
159       Perl or Python's built-in csv library).
160
161       Most spreadsheets and databases can import CSV directly.
162

SHELL QUOTING

164       Libvirt guest names can contain arbitrary characters, some of which
165       have meaning to the shell such as "#" and space.  You may need to quote
166       or escape these characters on the command line.  See the shell manual
167       page sh(1) for details.
168

SEE ALSO

170       guestfs(3), guestfish(1), virt-filesystems(1), Sys::Virt(3),
171       <http://libguestfs.org/>.
172

AUTHOR

174       Richard W.M. Jones <http://people.redhat.com/~rjones/>
175
177       Copyright (C) 2009-2010 Red Hat Inc.
178
179       This program is free software; you can redistribute it and/or modify it
180       under the terms of the GNU General Public License as published by the
181       Free Software Foundation; either version 2 of the License, or (at your
182       option) any later version.
183
184       This program is distributed in the hope that it will be useful, but
185       WITHOUT ANY WARRANTY; without even the implied warranty of
186       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
187       General Public License for more details.
188
189       You should have received a copy of the GNU General Public License along
190       with this program; if not, write to the Free Software Foundation, Inc.,
191       675 Mass Ave, Cambridge, MA 02139, USA.
192
193
194
195libguestfs-1.8.15                 2011-11-10                        virt-df(1)
Impressum