Scroll to navigation

virt-format(1) Virtualization Support virt-format(1)

名前

virt-format - ディスクの消去および空のディスクの作成

書式

 virt-format [--options] -a disk.img [-a disk.img ...]

説明

Virt-format takes an existing disk file (or it can be a host partition, LV etc), erases all data on it, and formats it as a blank disk. It can optionally create partition tables, empty filesystems, logical volumes and more.

To create a disk containing data, you may be better to use virt-make-fs(1). If you are creating a blank disk to use in guestfish(1), you should instead use the guestfish -N option.

通常の使用方法はこのようになります:

 virt-format -a disk.qcow

または、このようになります:

 virt-format -a /dev/VG/LV

disk.qcow or /dev/VG/LV must exist already. Any data on these disks will be erased by these commands. These commands will create a single empty partition covering the whole disk, with no filesystem inside it.

Additional parameters can be used to control the creation of partitions, filesystems, etc. The most commonly used options are:

Create an empty filesystem ("ext3", "ntfs" etc) inside the partition.
Create a Linux LVM2 logical volume on the disk. When used with --filesystem, the filesystem is created inside the LV.

For more information about these and other options, see "OPTIONS" below.

The format of the disk is normally auto-detected, but you can also force it by using the --format option (q.v.). In situations where you do not trust the existing content of the disk, then it is advisable to use this option to avoid possible exploits.

オプション

簡単なヘルプを表示します。
ファイル、ディスクイメージ、ホストのパーティション、論理ボリューム、外部 USB ディスクなどを追加します。

ディスクイメージの形式は自動検知されます。 これを上書きして強制的に特定の形式を使用する場合、 --format=.. オプションを使用します。

ディスクにある既存のデータはすべて削除されます。

リモートディスクを追加します。 "リモートストレージの追加" in guestfish(1) 参照。
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).
Create an empty filesystem of the specified type. Many filesystem types are supported by libguestfs.
ファイルシステムを作成しません。 これがデフォルトです。
-a オプションは標準状態でディスクイメージの形式を自動検知します。 これを使用することにより、コマンドラインで後続の -a オプションのディスク形式を強制的に指定できます。 引数なしで --format を使用することにより、 後続の -a オプションに対して自動検知に戻せます。

例:

 virt-format --format=raw -a disk.img
    

forces raw format (no auto-detection) for disk.img.

 virt-format --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)。

Set the filesystem label.
Create a Linux LVM2 logical volume called /dev/VG/LV. You can change the name of the volume group and logical volume.
Create a Linux LVM2 logical volume with the default name (/dev/VG/LV).
論理ボリュームを作成しません。 これがデフォルトです。
ディスク全体をカバーする MBR または GPT パーティションを作成します。ディスク容量が < 2 TB ならば MBR が選択されます。容量が ≥ 2 TB ならば GPT が選択されます。

これがデフォルトです。

GPT パーティションを作成します。
MBR パーティションを作成します。
パーティションテーブルを作成しません。Windows はこれらのディスクを認識できないかもしれないことに注意してください。
デバッグ用の冗長なメッセージを有効にします。
バージョン番号を表示して、終了します。
Normally virt-format does not wipe data from the disk (because that takes a long time). Thus if there is data on the disk, it is only hidden and partially overwritten by virt-format, and it might be recovered by disk editing tools.

If you use this option, virt-format writes zeroes over the whole disk so that previous data is not recoverable.

libguestfs API 呼び出しのトレースを有効にします。

終了ステータス

このプログラムは、成功すると 0、失敗すると 1 を返します。

関連項目

guestfs(3), guestfish(1), virt-filesystems(1), virt-make-fs(1), virt-rescue(1), virt-resize(1), http://libguestfs.org/.

著者

Richard W.M. Jones http://people.redhat.com/~rjones/

COPYRIGHT

Copyright (C) 2012 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.
2021-03-31 libguestfs-1.44.2