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

NAME

6       virt-filesystems - List filesystems, partitions, block devices, LVM in
7       a virtual machine or disk image
8

SYNOPSIS

10        virt-filesystems [--options] -d domname
11
12        virt-filesystems [--options] -a disk.img [-a disk.img ...]
13

DESCRIPTION

15       This tool allows you to discover filesystems, partitions, logical
16       volumes, and their sizes in a disk image or virtual machine.  It is a
17       replacement for virt-list-filesystems(1) and virt-list-partitions(1).
18
19       One use for this tool is from shell scripts to iterate over all
20       filesystems from a disk image:
21
22        for fs in $(virt-filesystems -a disk.img); do
23          # ...
24        done
25
26       Another use is to list partitions before using another tool to modify
27       those partitions (such as virt-resize(1)).  If you are curious about
28       what an unknown disk image contains, use this tool along with
29       virt-inspector(1).
30
31       Various command line options control what this program displays.  You
32       need to give either -a or -d options to specify the disk image or
33       libvirt guest respectively.  If you just specify that then the program
34       shows filesystems found, one per line, like this:
35
36        $ virt-filesystems -a disk.img
37        /dev/sda1
38        /dev/vg_guest/lv_root
39
40       If you add -l or --long then the output includes extra information:
41
42        $ virt-filesystems -a disk.img -l
43        Name                   Type         VFS   Label  Size
44        /dev/sda1              filesystem   ext4  boot   524288000
45        /dev/vg_guest/lv_root  filesystem   ext4  root   10212081664
46
47       If you add --extra then non-mountable (swap, unknown) filesystems are
48       shown as well:
49
50        $ virt-filesystems -a disk.img --extra
51        /dev/sda1
52        /dev/vg_guest/lv_root
53        /dev/vg_guest/lv_swap
54        /dev/vg_guest/lv_data
55
56       If you add --partitions then partitions are shown instead of
57       filesystems:
58
59        $ virt-filesystems -a disk.img --partitions
60        /dev/sda1
61        /dev/sda2
62
63       Similarly you can use --logical-volumes, --volume-groups,
64       --physical-volumes, --block-devices to list those items.
65
66       You can use these options in combination as well (if you want a
67       combination including filesystems, you have to add --filesystems).
68       Notice that some items fall into several categories (eg. "/dev/sda1"
69       might be both a partition and a filesystem).  These items are listed
70       several times.  To get a list which includes absolutely everything that
71       virt-filesystems knows about, use the --all option.
72
73       UUIDs (because they are quite long) are not shown by default.  Add the
74       --uuid option to display device and filesystem UUIDs in the long
75       output.
76
77       --all --long --uuid is a useful combination to display all possible
78       information about everything.
79
80        $ virt-filesystems -a win.img --all --long --uuid -h
81        Name      Type       VFS  Label           Size Parent   UUID
82        /dev/sda1 filesystem ntfs System Reserved 100M -        F81C92571C92112C
83        /dev/sda2 filesystem ntfs -               20G  -        F2E8996AE8992E3B
84        /dev/sda1 partition  -    -               100M /dev/sda -
85        /dev/sda2 partition  -    -               20G  /dev/sda -
86        /dev/sda  device     -    -               20G  -        -
87
88       For machine-readable output, use --csv to get Comma-Separated Values.
89

OPTIONS

91       --help
92           Display brief help.
93
94       -a file
95       --add file
96           Add file which should be a disk image from a virtual machine.  If
97           the virtual machine has multiple block devices, you must supply all
98           of them with separate -a options.
99
100           The format of the disk image is auto-detected.  To override this
101           and force a particular format use the --format=.. option.
102
103       --all
104           Display everything.  This is currently the same as specifying these
105           options: --filesystems, --extra, --partitions, --block-devices,
106           --logical-volumes, --volume-groups, --physical-volumes.  (More may
107           be added to this list in future).
108
109           See also --long.
110
111       --blkdevs
112       --block-devices
113           Display block devices.
114
115       -c URI
116       --connect URI
117           If using libvirt, connect to the given URI.  If omitted, then we
118           connect to the default libvirt hypervisor.
119
120           If you specify guest block devices directly (-a), then libvirt is
121           not used at all.
122
123       --csv
124           Write out the results in CSV format (comma-separated values).  This
125           format can be imported easily into databases and spreadsheets, but
126           read "NOTE ABOUT CSV FORMAT" below.
127
128       -d guest
129       --domain guest
130           Add all the disks from the named libvirt guest.  Domain UUIDs can
131           be used instead of names.
132
133       --echo-keys
134           When prompting for keys and passphrases, virt-filesystems normally
135           turns echoing off so you cannot see what you are typing.  If you
136           are not worried about Tempest attacks and there is no one else in
137           the room you can specify this flag to see what you are typing.
138
139       --extra
140           This causes filesystems that are not ordinary, mountable
141           filesystems to be displayed.  This category includes swapspace, and
142           filesystems that are empty or contain unknown data.
143
144           This option implies --filesystems.
145
146       --filesystems
147           Display mountable filesystems.  If no display option was selected
148           then this option is implied.
149
150           With --extra, non-mountable filesystems are shown too.
151
152       --format=raw|qcow2|..
153       --format
154           The default for the -a option is to auto-detect the format of the
155           disk image.  Using this forces the disk format for -a options which
156           follow on the command line.  Using --format with no argument
157           switches back to auto-detection for subsequent -a options.
158
159           For example:
160
161            virt-filesystems --format=raw -a disk.img
162
163           forces raw format (no auto-detection) for "disk.img".
164
165            virt-filesystems --format=raw -a disk.img --format -a another.img
166
167           forces raw format (no auto-detection) for "disk.img" and reverts to
168           auto-detection for "another.img".
169
170           If you have untrusted raw-format guest disk images, you should use
171           this option to specify the disk format.  This avoids a possible
172           security problem with malicious guests (CVE-2010-3851).
173
174       -h
175       --human-readable
176           In --long mode, display sizes in human-readable format.
177
178       --keys-from-stdin
179           Read key or passphrase parameters from stdin.  The default is to
180           try to read passphrases from the user by opening "/dev/tty".
181
182       -l
183       --long
184           Display extra columns of data ("long format").
185
186           A title row is added unless you also specify --no-title.
187
188           The extra columns displayed depend on what output you select, and
189           the ordering of columns may change in future versions.  Use the
190           title row, --csv output and/or csvtool(1) to match columns to data
191           in external programs.
192
193           Use -h if you want sizes to be displayed in human-readable format.
194           The default is to show raw numbers of bytes.
195
196           Use --uuid to display UUIDs too.
197
198       --lvs
199       --logvols
200       --logical-volumes
201           Display LVM logical volumes.  In this mode, these are displayed
202           irrespective of whether the LVs contain filesystems.
203
204       --no-title
205           In --long mode, don't add a title row.
206
207           Note that the order of the columns is not fixed, and may change in
208           future versions of virt-filesystems, so using this option may give
209           you unexpected surprises.
210
211       --parts
212       --partitions
213           Display partitions.  In this mode, these are displayed irrespective
214           of whether the partitions contain filesystems.
215
216       --pvs
217       --physvols
218       --physical-volumes
219           Display LVM physical volumes.
220
221       --uuid
222       --uuids
223           In --long mode, display UUIDs as well.
224
225       -v
226       --verbose
227           Enable verbose messages for debugging.
228
229       -V
230       --version
231           Display version number and exit.
232
233       --vgs
234       --volgroups
235       --volume-groups
236           Display LVM volume groups.
237
238       -x  Enable tracing of libguestfs API calls.
239

COLUMNS

241       Note that columns in the output are subject to reordering and change in
242       future versions of this tool.
243
244       Name
245           The filesystem, partition, block device or LVM name.
246
247           For device and partition names these are displayed as canonical
248           libguestfs names, so that for example "/dev/sda2" is the second
249           partition on the first device.
250
251           If the --long option is not specified, then only the name column is
252           shown in the output.
253
254       Type
255           The object type, for example "filesystem", "lv", "device" etc.
256
257       VFS If there is a filesystem, then this column displays the filesystem
258           type if one could be detected, eg. "ext4".
259
260       Label
261           If the object has a label (used for identifying and mounting
262           filesystems) then this column contains the label.
263
264       MBR The partition type byte, displayed as a two digit hexadecimal
265           number.  A comprehensive list of partition types can be found here:
266           http://www.win.tue.nl/~aeb/partitions/partition_types-1.html
267
268           This is only applicable for DOS (MBR) partitions.
269
270       Size
271           The size of the object in bytes.  If the --human option is used
272           then the size is displayed in a human-readable form.
273
274       Parent
275           The parent column records the parent relationship between objects.
276
277           For example, if the object is a partition, then this column
278           contains the name of the containing device.  If the object is a
279           logical volume, then this column is the name of the volume group.
280
281           If there is more than one parent, then this column is (internal to
282           the column) a comma-separated list, eg. "/dev/sda,/dev/sdb".
283
284       UUID
285           If the object has a UUID (used for identifying and mounting
286           filesystems and block devices) then this column contains the UUID
287           as a string.
288
289           The UUID is only displayed if the --uuid option is given.
290

NOTE ABOUT CSV FORMAT

292       Comma-separated values (CSV) is a deceptive format.  It seems like it
293       should be easy to parse, but it is definitely not easy to parse.
294
295       Myth: Just split fields at commas.  Reality: This does not work
296       reliably.  This example has two columns:
297
298        "foo,bar",baz
299
300       Myth: Read the file one line at a time.  Reality: This does not work
301       reliably.  This example has one row:
302
303        "foo
304        bar",baz
305
306       For shell scripts, use "csvtool" (http://merjis.com/developers/csv also
307       packaged in major Linux distributions).
308
309       For other languages, use a CSV processing library (eg. "Text::CSV" for
310       Perl or Python's built-in csv library).
311
312       Most spreadsheets and databases can import CSV directly.
313

SHELL QUOTING

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

EXIT STATUS

321       This program returns 0 if successful, or non-zero if there was an
322       error.
323

SEE ALSO

325       guestfs(3), guestfish(1), virt-cat(1), virt-df(1),
326       virt-list-filesystems(1), virt-list-partitions(1), csvtool(1),
327       http://libguestfs.org/.
328

AUTHOR

330       Richard W.M. Jones http://people.redhat.com/~rjones/
331
333       Copyright (C) 2010-2012 Red Hat Inc.
334

LICENSE

336       This program is free software; you can redistribute it and/or modify it
337       under the terms of the GNU General Public License as published by the
338       Free Software Foundation; either version 2 of the License, or (at your
339       option) any later version.
340
341       This program is distributed in the hope that it will be useful, but
342       WITHOUT ANY WARRANTY; without even the implied warranty of
343       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
344       General Public License for more details.
345
346       You should have received a copy of the GNU General Public License along
347       with this program; if not, write to the Free Software Foundation, Inc.,
348       51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
349

BUGS

351       To get a list of bugs against libguestfs, use this link:
352       https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools
353
354       To report a new bug against libguestfs, use this link:
355       https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools
356
357       When reporting a bug, please supply:
358
359       ·   The version of libguestfs.
360
361       ·   Where you got libguestfs (eg. which Linux distro, compiled from
362           source, etc)
363
364       ·   Describe the bug accurately and give a way to reproduce it.
365
366       ·   Run libguestfs-test-tool(1) and paste the complete, unedited output
367           into the bug report.
368
369
370
371libguestfs-1.20.11                2013-08-27               virt-filesystems(1)
Impressum