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

COLUMNS

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

NOTE ABOUT CSV FORMAT

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

EXIT STATUS

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

SEE ALSO

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

AUTHOR

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

LICENSE

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

BUGS

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