.\" Automatically generated by Podwrapper::Man 1.44.2 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "virt-filesystems 1" .TH virt-filesystems 1 "2021-09-07" "libguestfs-1.44.2" "Virtualization Support" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" virt\-filesystems \- List filesystems, partitions, block devices, LVM in a virtual machine or disk image .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& virt\-filesystems [\-\-options] \-d domname \& \& virt\-filesystems [\-\-options] \-a disk.img [\-a disk.img ...] .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This tool allows you to discover filesystems, partitions, logical volumes, and their sizes in a disk image or virtual machine. It is a replacement for \fBvirt\-list\-filesystems\fR\|(1) and \&\fBvirt\-list\-partitions\fR\|(1). .PP One use for this tool is from shell scripts to iterate over all filesystems from a disk image: .PP .Vb 3 \& for fs in $(virt\-filesystems \-a disk.img); do \& # ... \& done .Ve .PP Another use is to list partitions before using another tool to modify those partitions (such as \fBvirt\-resize\fR\|(1)). If you are curious about what an unknown disk image contains, use this tool along with \&\fBvirt\-inspector\fR\|(1). .PP Various command line options control what this program displays. You need to give either \fI\-a\fR or \fI\-d\fR options to specify the disk image or libvirt guest respectively. If you just specify that then the program shows filesystems found, one per line, like this: .PP .Vb 3 \& $ virt\-filesystems \-a disk.img \& /dev/sda1 \& /dev/vg_guest/lv_root .Ve .PP If you add \fI\-l\fR or \fI\-\-long\fR then the output includes extra information: .PP .Vb 4 \& $ virt\-filesystems \-a disk.img \-l \& Name Type VFS Label Size \& /dev/sda1 filesystem ext4 boot 524288000 \& /dev/vg_guest/lv_root filesystem ext4 root 10212081664 .Ve .PP If you add \fI\-\-extra\fR then non-mountable (swap, unknown) filesystems are shown as well: .PP .Vb 5 \& $ virt\-filesystems \-a disk.img \-\-extra \& /dev/sda1 \& /dev/vg_guest/lv_root \& /dev/vg_guest/lv_swap \& /dev/vg_guest/lv_data .Ve .PP If you add \fI\-\-partitions\fR then partitions are shown instead of filesystems: .PP .Vb 3 \& $ virt\-filesystems \-a disk.img \-\-partitions \& /dev/sda1 \& /dev/sda2 .Ve .PP Similarly you can use \fI\-\-logical\-volumes\fR, \fI\-\-volume\-groups\fR, \&\fI\-\-physical\-volumes\fR, \fI\-\-block\-devices\fR to list those items. .PP You can use these options in combination as well (if you want a combination including filesystems, you have to add \fI\-\-filesystems\fR). Notice that some items fall into several categories (eg. \fI/dev/sda1\fR might be both a partition and a filesystem). These items are listed several times. To get a list which includes absolutely everything that virt-filesystems knows about, use the \fI\-\-all\fR option. .PP UUIDs (because they are quite long) are not shown by default. Add the \&\fI\-\-uuid\fR option to display device and filesystem UUIDs in the long output. .PP \&\fI\-\-all \-\-long \-\-uuid\fR is a useful combination to display all possible information about everything. .PP .Vb 7 \& $ virt\-filesystems \-a win.img \-\-all \-\-long \-\-uuid \-h \& Name Type VFS Label Size Parent UUID \& /dev/sda1 filesystem ntfs System Reserved 100M \- F81C92571C92112C \& /dev/sda2 filesystem ntfs \- 20G \- F2E8996AE8992E3B \& /dev/sda1 partition \- \- 100M /dev/sda \- \& /dev/sda2 partition \- \- 20G /dev/sda \- \& /dev/sda device \- \- 20G \- \- .Ve .PP For machine-readable output, use \fI\-\-csv\fR to get Comma-Separated Values. .SH "OPTIONS" .IX Header "OPTIONS" .IP "\fB\-\-help\fR" 4 .IX Item "--help" Display brief help. .IP "\fB\-a\fR file" 4 .IX Item "-a file" .PD 0 .IP "\fB\-\-add\fR file" 4 .IX Item "--add file" .PD Add \fIfile\fR which should be a disk image from a virtual machine. If the virtual machine has multiple block devices, you must supply all of them with separate \fI\-a\fR options. .Sp The format of the disk image is auto-detected. To override this and force a particular format use the \fI\-\-format=..\fR option. .IP "\fB\-a \s-1URI\s0\fR" 4 .IX Item "-a URI" .PD 0 .IP "\fB\-\-add \s-1URI\s0\fR" 4 .IX Item "--add URI" .PD Add a remote disk. See \*(L"\s-1ADDING REMOTE STORAGE\*(R"\s0 in \fBguestfish\fR\|(1). .IP "\fB\-\-all\fR" 4 .IX Item "--all" Display everything. This is currently the same as specifying these options: \fI\-\-filesystems\fR, \fI\-\-extra\fR, \fI\-\-partitions\fR, \&\fI\-\-block\-devices\fR, \fI\-\-logical\-volumes\fR, \fI\-\-volume\-groups\fR, \&\fI\-\-physical\-volumes\fR. (More may be added to this list in future). .Sp See also \fI\-\-long\fR. .IP "\fB\-\-blkdevs\fR" 4 .IX Item "--blkdevs" .PD 0 .IP "\fB\-\-block\-devices\fR" 4 .IX Item "--block-devices" .PD Display block devices. .IP "\fB\-\-blocksize=512\fR" 4 .IX Item "--blocksize=512" .PD 0 .IP "\fB\-\-blocksize=4096\fR" 4 .IX Item "--blocksize=4096" .IP "\fB\-\-blocksize\fR" 4 .IX Item "--blocksize" .PD This parameter sets the sector size of the disk image. It affects all explicitly added subsequent disks after this parameter. Using \&\fI\-\-blocksize\fR with no argument switches the disk sector size to the default value which is usually 512 bytes. See also \&\*(L"guestfs_add_drive_opts\*(R" in \fBguestfs\fR\|(3). .IP "\fB\-c\fR \s-1URI\s0" 4 .IX Item "-c URI" .PD 0 .IP "\fB\-\-connect\fR \s-1URI\s0" 4 .IX Item "--connect URI" .PD If using libvirt, connect to the given \fI\s-1URI\s0\fR. If omitted, then we connect to the default libvirt hypervisor. .Sp If you specify guest block devices directly (\fI\-a\fR), then libvirt is not used at all. .IP "\fB\-\-csv\fR" 4 .IX Item "--csv" Write out the results in \s-1CSV\s0 format (comma-separated values). This format can be imported easily into databases and spreadsheets, but read \*(L"\s-1NOTE ABOUT CSV FORMAT\*(R"\s0 below. .IP "\fB\-d\fR guest" 4 .IX Item "-d guest" .PD 0 .IP "\fB\-\-domain\fR guest" 4 .IX Item "--domain guest" .PD Add all the disks from the named libvirt guest. Domain UUIDs can be used instead of names. .IP "\fB\-\-echo\-keys\fR" 4 .IX Item "--echo-keys" When prompting for keys and passphrases, virt-filesystems normally turns echoing off so you cannot see what you are typing. If you are not worried about Tempest attacks and there is no one else in the room you can specify this flag to see what you are typing. .IP "\fB\-\-extra\fR" 4 .IX Item "--extra" This causes filesystems that are not ordinary, mountable filesystems to be displayed. This category includes swapspace, and filesystems that are empty or contain unknown data. .Sp This option implies \fI\-\-filesystems\fR. .IP "\fB\-\-filesystems\fR" 4 .IX Item "--filesystems" Display mountable filesystems. If no display option was selected then this option is implied. .Sp With \fI\-\-extra\fR, non-mountable filesystems are shown too. .IP "\fB\-\-format=raw|qcow2|..\fR" 4 .IX Item "--format=raw|qcow2|.." .PD 0 .IP "\fB\-\-format\fR" 4 .IX Item "--format" .PD The default for the \fI\-a\fR option is to auto-detect the format of the disk image. Using this forces the disk format for \fI\-a\fR options which follow on the command line. Using \fI\-\-format\fR with no argument switches back to auto-detection for subsequent \fI\-a\fR options. .Sp For example: .Sp .Vb 1 \& virt\-filesystems \-\-format=raw \-a disk.img .Ve .Sp forces raw format (no auto-detection) for \fIdisk.img\fR. .Sp .Vb 1 \& virt\-filesystems \-\-format=raw \-a disk.img \-\-format \-a another.img .Ve .Sp forces raw format (no auto-detection) for \fIdisk.img\fR and reverts to auto-detection for \fIanother.img\fR. .Sp If you have untrusted raw-format guest disk images, you should use this option to specify the disk format. This avoids a possible security problem with malicious guests (\s-1CVE\-2010\-3851\s0). .IP "\fB\-h\fR" 4 .IX Item "-h" .PD 0 .IP "\fB\-\-human\-readable\fR" 4 .IX Item "--human-readable" .PD In \fI\-\-long\fR mode, display sizes in human-readable format. .IP "\fB\-\-keys\-from\-stdin\fR" 4 .IX Item "--keys-from-stdin" Read key or passphrase parameters from stdin. The default is to try to read passphrases from the user by opening \fI/dev/tty\fR. .Sp If there are multiple encrypted devices then you may need to supply multiple keys on stdin, one per line. .IP "\fB\-l\fR" 4 .IX Item "-l" .PD 0 .IP "\fB\-\-long\fR" 4 .IX Item "--long" .PD Display extra columns of data (\*(L"long format\*(R"). .Sp A title row is added unless you also specify \fI\-\-no\-title\fR. .Sp The extra columns displayed depend on what output you select, and the ordering of columns may change in future versions. Use the title row, \&\fI\-\-csv\fR output and/or \fBcsvtool\fR\|(1) to match columns to data in external programs. .Sp Use \fI\-h\fR if you want sizes to be displayed in human-readable format. The default is to show raw numbers of \fIbytes\fR. .Sp Use \fI\-\-uuid\fR to display UUIDs too. .IP "\fB\-\-lvs\fR" 4 .IX Item "--lvs" .PD 0 .IP "\fB\-\-logvols\fR" 4 .IX Item "--logvols" .IP "\fB\-\-logical\-volumes\fR" 4 .IX Item "--logical-volumes" .PD Display \s-1LVM\s0 logical volumes. In this mode, these are displayed irrespective of whether the LVs contain filesystems. .IP "\fB\-\-no\-title\fR" 4 .IX Item "--no-title" In \fI\-\-long\fR mode, don’t add a title row. .Sp Note that the order of the columns is not fixed, and may change in future versions of virt-filesystems, so using this option may give you unexpected surprises. .IP "\fB\-\-parts\fR" 4 .IX Item "--parts" .PD 0 .IP "\fB\-\-partitions\fR" 4 .IX Item "--partitions" .PD Display partitions. In this mode, these are displayed irrespective of whether the partitions contain filesystems. .IP "\fB\-\-pvs\fR" 4 .IX Item "--pvs" .PD 0 .IP "\fB\-\-physvols\fR" 4 .IX Item "--physvols" .IP "\fB\-\-physical\-volumes\fR" 4 .IX Item "--physical-volumes" .PD Display \s-1LVM\s0 physical volumes. .IP "\fB\-\-uuid\fR" 4 .IX Item "--uuid" .PD 0 .IP "\fB\-\-uuids\fR" 4 .IX Item "--uuids" .PD In \fI\-\-long\fR mode, display UUIDs as well. .IP "\fB\-v\fR" 4 .IX Item "-v" .PD 0 .IP "\fB\-\-verbose\fR" 4 .IX Item "--verbose" .PD Enable verbose messages for debugging. .IP "\fB\-V\fR" 4 .IX Item "-V" .PD 0 .IP "\fB\-\-version\fR" 4 .IX Item "--version" .PD Display version number and exit. .IP "\fB\-\-vgs\fR" 4 .IX Item "--vgs" .PD 0 .IP "\fB\-\-volgroups\fR" 4 .IX Item "--volgroups" .IP "\fB\-\-volume\-groups\fR" 4 .IX Item "--volume-groups" .PD Display \s-1LVM\s0 volume groups. .IP "\fB\-x\fR" 4 .IX Item "-x" Enable tracing of libguestfs \s-1API\s0 calls. .SH "COLUMNS" .IX Header "COLUMNS" Note that columns in the output are subject to reordering and change in future versions of this tool. .IP "\fBName\fR" 4 .IX Item "Name" The filesystem, partition, block device or \s-1LVM\s0 name. .Sp For device and partition names these are displayed as canonical libguestfs names, so that for example \fI/dev/sda2\fR is the second partition on the first device. .Sp If the \fI\-\-long\fR option is \fBnot\fR specified, then only the name column is shown in the output. .IP "\fBType\fR" 4 .IX Item "Type" The object type, for example \f(CW\*(C`filesystem\*(C'\fR, \f(CW\*(C`lv\*(C'\fR, \f(CW\*(C`device\*(C'\fR etc. .IP "\fB\s-1VFS\s0\fR" 4 .IX Item "VFS" If there is a filesystem, then this column displays the filesystem type if one could be detected, eg. \f(CW\*(C`ext4\*(C'\fR. .IP "\fBLabel\fR" 4 .IX Item "Label" If the object has a label (used for identifying and mounting filesystems) then this column contains the label. .IP "\fB\s-1MBR\s0\fR" 4 .IX Item "MBR" The partition type byte, displayed as a two digit hexadecimal number. A comprehensive list of partition types can be found here: http://www.win.tue.nl/~aeb/partitions/partition_types\-1.html .Sp This is only applicable for \s-1DOS\s0 (\s-1MBR\s0) partitions. .IP "\fBSize\fR" 4 .IX Item "Size" The size of the object in bytes. If the \fI\-\-human\fR option is used then the size is displayed in a human-readable form. .IP "\fBParent\fR" 4 .IX Item "Parent" The parent column records the parent relationship between objects. .Sp For example, if the object is a partition, then this column contains the name of the containing device. If the object is a logical volume, then this column is the name of the volume group. .Sp If there is more than one parent, then this column is (internal to the column) a comma-separated list, eg. \f(CW\*(C`/dev/sda,/dev/sdb\*(C'\fR. .IP "\fB\s-1UUID\s0\fR" 4 .IX Item "UUID" If the object has a \s-1UUID\s0 (used for identifying and mounting filesystems and block devices) then this column contains the \s-1UUID\s0 as a string. .Sp The \s-1UUID\s0 is only displayed if the \fI\-\-uuid\fR option is given. .SH "NOTE ABOUT CSV FORMAT" .IX Header "NOTE ABOUT CSV FORMAT" Comma-separated values (\s-1CSV\s0) is a deceptive format. It \fIseems\fR like it should be easy to parse, but it is definitely not easy to parse. .PP Myth: Just split fields at commas. Reality: This does \fInot\fR work reliably. This example has two columns: .PP .Vb 1 \& "foo,bar",baz .Ve .PP Myth: Read the file one line at a time. Reality: This does \fInot\fR work reliably. This example has one row: .PP .Vb 2 \& "foo \& bar",baz .Ve .PP For shell scripts, use \f(CW\*(C`csvtool\*(C'\fR (https://github.com/Chris00/ocaml\-csv also packaged in major Linux distributions). .PP For other languages, use a \s-1CSV\s0 processing library (eg. \f(CW\*(C`Text::CSV\*(C'\fR for Perl or Python’s built-in csv library). .PP Most spreadsheets and databases can import \s-1CSV\s0 directly. .SH "EXIT STATUS" .IX Header "EXIT STATUS" This program returns 0 if successful, or non-zero if there was an error. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBguestfs\fR\|(3), \&\fBguestfish\fR\|(1), \&\fBvirt\-cat\fR\|(1), \&\fBvirt\-df\fR\|(1), \&\fBvirt\-list\-filesystems\fR\|(1), \&\fBvirt\-list\-partitions\fR\|(1), \&\fBcsvtool\fR\|(1), http://libguestfs.org/. .SH "AUTHOR" .IX Header "AUTHOR" Richard W.M. Jones http://people.redhat.com/~rjones/ .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (C) 2010\-2012 Red Hat Inc. .SH "LICENSE" .IX Header "LICENSE" This program is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. .PP This program is distributed in the hope that it will be useful, but \&\s-1WITHOUT ANY WARRANTY\s0; without even the implied warranty of \&\s-1MERCHANTABILITY\s0 or \s-1FITNESS FOR A PARTICULAR PURPOSE.\s0 See the \s-1GNU\s0 General Public License for more details. .PP You should have received a copy of the \s-1GNU\s0 General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, \s-1MA 02110\-1301 USA.\s0 .SH "BUGS" .IX Header "BUGS" To get a list of bugs against libguestfs, use this link: https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools .PP To report a new bug against libguestfs, use this link: https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools .PP When reporting a bug, please supply: .IP "\(bu" 4 The version of libguestfs. .IP "\(bu" 4 Where you got libguestfs (eg. which Linux distro, compiled from source, etc) .IP "\(bu" 4 Describe the bug accurately and give a way to reproduce it. .IP "\(bu" 4 Run \fBlibguestfs\-test\-tool\fR\|(1) and paste the \fBcomplete, unedited\fR output into the bug report.