Man page - virt-df(1)
Packages contains this manual
- virt-resize(1)
- virt-diff(1)
- virt-builder(1)
- virt-sparsify(1)
- virt-log(1)
- virt-inspector(1)
- virt-format(1)
- virt-customize(1)
- virt-filesystems(1)
- virt-get-kernel(1)
- virt-index-validate(1)
- virt-df(1)
- virt-builder-repository(1)
- virt-ls(1)
- guestfs-tools-release-notes-1.50(1)
- virt-cat(1)
- virt-make-fs(1)
- virt-edit(1)
- virt-win-reg(1)
- virt-tail(1)
- guestfs-tools-release-notes-1.48(1)
- virt-sysprep(1)
- virt-alignment-scan(1)
- virt-drivers(1)
- guestfs-tools-release-notes-1.52(1)
apt-get install guestfs-tools
Available languages:
en ja ukManual
virt-df
名 前書 式
説 明
例
オ プ シ ョ ン
STATVFS NUMBERS
CSV 形 式 に 関 す る 注 意
終 了 ス テ ー タ ス
関 連 項 目
著 者
COPYRIGHT
LICENSE
BUGS
名 前
virt-df - 仮 想 フ ァ イ ル シ ス テ ム の 使 用 状 況 の 表 示
書 式
す べ て の 仮 想 マ シ ン :
virt-df [--options]
単 一 の 仮 想 マ シ ン :
virt-df
[--options] -d domname
virt-df [--options] -a disk.img [-a disk.img ...]
古 い 形 式 :
virt-df
[--options] domname
virt-df [--options] disk.img [disk.img ...]
説 明
"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.
例
Show disk usage for a single libvirt guest called "F14x64". Make the output human-readable:
# virt-df -d
F14x64 -h
Filesystem Size Used Available Use%
F14x64:/dev/sda1 484M 66M 393M 14%
F14x64:/dev/vg_f13x64/lv_root 7.4G 3.4G 4.0G 46%
Show disk usage for a disk image file called test.img :
$ virt-df -a
test1.img
Filesystem 1K-blocks Used Available Use%
test1.img:/dev/sda1 99099 1551 92432 2%
If a single guest has multiple disks, use the -a option repeatedly. A plus sign ("+") is displayed for each additional disk. Note: Do not do this with unrelated guest disks.
$ virt-df -a
Win7x32TwoDisks-a -a Win7x32TwoDisks-b
Filesystem 1K-blocks Used Available Use%
Win7x32TwoDisks-a+:/dev/sda1 102396 24712 77684 25%
Win7x32TwoDisks-a+:/dev/sda2 12478460 7403416 5075044 60%
Win7x32TwoDisks-a+:/dev/sdb1 521212 55728 465484 11%
オ プ シ ョ ン
--help
簡 単 な ヘ ル プ を 表 示 し ま す 。
-a
FILE
--add
FILE
Add "FILE" 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 -a options.
デ ィ ス ク イ メ ー ジ の 形 式 は 自 動 検 知 さ れ ま す 。 こ れ を 上 書 き し て 強 制 的 に 特 定 の 形 式 を 使 用 す る 場 合 、 --format=.. オ プ シ ョ ン を 使 用 し ま す 。
-a
URI
--add
URI
リ モ ー ト デ ィ ス ク を 追 加 し ま す 。 "リ モ ー ト ス ト レ ー ジ の 追 加 " in guestfish (1) 参 照 。
--blocksize=512
--blocksize=4096
--blocksize
This parameter sets the sector size of the disk image. It affects all explicitly added subsequent disks after this parameter. Using --blocksize with no argument switches the disk sector size to the default value which is usually 512 bytes. See also "guestfs_add_drive_opts" in guestfs (3).
-c
URI
--connect
URI
libvirt を 使 用 し て い る と 、 指 定 さ れ た URI に 接 続 し ま す 。 省 略 す る と 、 デ フ ォ ル ト の libvirt ハ イ パ ー バ イ ザ ー に 接 続 し ま す 。
ゲ ス ト の ブ ロ ッ ク デ バ イ ス を 直 接 指 定 し て い る と ( ( -a )) 、 libvirt は 何 も 使 用 さ れ ま せ ん 。
--csv
Write out the results in CSV format (comma-separated values). This format can be imported easily into databases and spreadsheets, but read "NOTE ABOUT CSV FORMAT" below.
-d
guest
--domain
guest
名 前 付 き の libvirt 仮 想 マ シ ン か ら す べ て の デ ィ ス ク を 追 加 し ま す 。 名 前 の 代 わ り に 仮 想 マ シ ン の UUID を 使 用 で き ま す 。
--format=raw|qcow2|..
--format
-a オ プ シ ョ ン は 標 準 状 態 で デ ィ ス ク イ メ ー ジ の 形 式 を 自 動 検 知 し ま す 。 こ れ を 使 用 す る こ と に よ り 、 コ マ ン ド ラ イ ン で 後 続 の -a オ プ シ ョ ン の デ ィ ス ク 形 式 を 強 制 的 に 指 定 で き ま す 。 引 数 な し で --format を 使 用 す る こ と に よ り 、 後 続 の -a オ プ シ ョ ン に 対 し て 自 動 検 知 に 戻 せ ま す 。
例 :
virt-df --format=raw -a disk.img
forces raw format (no auto-detection) for disk.img .
virt-df --format=raw -a disk.img --format -a another.img
forces raw format (no auto-detection) for disk.img and reverts to auto-detection for another.img .
仮 想 マ シ ン の デ ィ ス ク イ メ ー ジ が 信 頼 で き な い raw 形 式 で あ る 場 合 、 デ ィ ス ク 形 式 を 指 定 す る た め に こ の オ プ シ ョ ン を 使 用 す べ き で す 。 こ れ に よ り 、 悪 意 の あ る 仮 想 マ シ ン に よ り 起 こ り 得 る セ キ ュ リ テ ィ 問 題 を 回 避 で き ま す (CVE-2010-3851)。
|
-h |
--human-readable
読 み や す い 形 式 で 容 量 を 表 示 し ま す 。
-h と --csv を 同 時 に 使 用 す る こ と は で き ま せ ん 。
|
-i |
--inodes
ブ ロ ッ ク の 代 わ り に inode を 表 示 し ま す 。
--one-per-guest
Since libguestfs 1.22, this is the default. This option does nothing and is left here for backwards compatibility with older scripts.
-P nr_threads
Since libguestfs 1.22, virt-df is multithreaded and examines guests in parallel. By default the number of threads to use is chosen based on the amount of free memory available at the time that virt-df is started. You can force virt-df to use at most "nr_threads" by using the -P option.
Note that -P 0 means to autodetect, and -P 1 means to use a single thread.
--uuid
名 前 の 代 わ り に UUID を 表 示 し ま す 。 仮 想 マ シ ン が マ イ グ レ ー シ ョ ン ま た は 名 前 変 更 さ れ た と き 、 ま た は 偶 然 2 つ の 仮 想 マ シ ン が 同 じ 名 前 を 持 つ と き 、 仮 想 マ シ ン に 使 用 さ せ る た め に 有 用 で す 。
Note that only domains that we fetch from libvirt come with UUIDs. For disk images, we still print the disk image name even when this option is specified.
|
-v |
--verbose
デ バ ッ グ 用 の 冗 長 な メ ッ セ ー ジ を 有 効 に し ま す 。
|
-V |
--version
バ ー ジ ョ ン 番 号 を 表 示 し て 、 終 了 し ま す 。
|
-x |
libguestfs API 呼 び 出 し の ト レ ー ス を 有 効 に し ま す 。 |
STATVFS NUMBERS
"virt-df"
(and
df
(1)) get information by issuing a
statvfs
(3) system call. You can get the same
information directly, either from the host (using
libguestfs) or inside the guest:
ホ ス ト か ら
こ の コ マ ン ド を 実 行 し て く だ さ い :
guestfish --ro -d GuestName -i statvfs /
(change / to see stats for other filesystems).
仮 想 マ シ ン の 中 か ら
こ の コ マ ン ド を 実 行 し て く だ さ い :
python -c 'import os; s = os.statvfs ("/"); print s'
(change / to see stats for other filesystems).
CSV 形 式 に 関 す る 注 意
Comma-separated values (CSV) is a deceptive format. It seems like it should be easy to parse, but it is definitely not easy to parse.
神 話 : た だ コ ン マ で 項 目 を 区 切 る 。 真 実 : こ れ は 正 し く 動 き ま せ ん 。 こ の 例 は 2 つ の 列 が あ り ま す :
"foo,bar",baz
神 話 : 同 時 に フ ァ イ ル の 1 行 を 読 み 込 み ま す 。 真 実 : こ れ は 正 し く 動 き ま せ ん 。 こ の 例 は 1 つ の 行 が あ り ま す :
"foo
bar",baz
For shell scripts, use "csvtool" (https://github.com/Chris00/ocaml-csv also packaged in major Linux distributions).
For other languages, use a CSV processing library (eg. "Text::CSV" for Perl or Python’s built-in csv library).
Most spreadsheets and databases can import CSV directly.
終 了 ス テ ー タ ス
こ の プ ロ グ ラ ム は 、 成 功 す る と 0 を 、 エ ラ ー が あ る と 0 以 外 を 返 し ま す 。
関 連 項 目
df (1), guestfs (3), guestfish (1), virt-drivers (1), virt-filesystems (1), http://libguestfs.org/.
著 者
Richard W.M. Jones http://people.redhat.com/˜rjones/
COPYRIGHT
Copyright (C) 2009-2023 Red Hat Inc.
LICENSE
BUGS
To get a list of bugs against libguestfs, use this link: https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools
To report a new bug against libguestfs, use this link: https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools
When reporting a bug, please supply:
|
• |
The version of libguestfs. |
||
|
• |
Where you got libguestfs (eg. which Linux distro, compiled from source, etc) |
||
|
• |
Describe the bug accurately and give a way to reproduce it. |
||
|
• |
Run libguestfs-test-tool (1) and paste the complete, unedited output into the bug report. |