1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401
|
.\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Podwrapper::Man 1.52.3 (Pod::Simple 3.45)
.\"
.\" 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
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. 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
.\"
.\" Required to disable full justification in groff 1.23.0.
.if n .ds AD l
.\" ========================================================================
.\"
.IX Title "virt-alignment-scan 1"
.TH virt-alignment-scan 1 2025-02-18 guestfs-tools-1.52.3 "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 名前
.IX Header "名前"
virt\-alignment\-scan \- 仮想マシンのパーティションにおけるアライメントの確認
.SH 書式
.IX Header "書式"
.Vb 1
\& virt\-alignment\-scan [\-\-options] \-d domname
\&
\& virt\-alignment\-scan [\-\-options] \-a disk.img [\-a disk.img ...]
\&
\& virt\-alignment\-scan [\-\-options]
.Ve
.SH 説明
.IX Header "説明"
古いオペレーティングシステムが自身をインストールするとき、パーティションツールが基礎となるストレージと一致しないセクターにパーティションを配置します (一般的に最初のパーティションはセクター \f(CW63\fR から始まります)。一致しないパーティションにより、必要以上に I/O を発生させるというオペレーティングシステムの問題を引き起こします。
.PP
virt\-alignment\-scan ツールは、仮想マシンおよびディスクイメージにあるパーティションの配置を確認します。配置に問題があれば警告します。
.PP
現在、配置の問題を修正するための仮想化ツールはありません。ゲストオペレーティングシステムを再インストールすることだけができます。以下の NetApp のドキュメントが、問題と取り得る解決策をまとめています: http://media.netapp.com/documents/tr\-3747.pdf
.SH 出力
.IX Header "出力"
このツールをディスクイメージにおいて直接実行するには、\fI\-a\fR オプションを使用します:
.PP
.Vb 2
\& $ virt\-alignment\-scan \-a winxp.img
\& /dev/sda1 32256 512 bad (alignment < 4K)
\&
\& $ virt\-alignment\-scan \-a fedora16.img
\& /dev/sda1 1048576 1024K ok
\& /dev/sda2 2097152 2048K ok
\& /dev/sda3 526385152 2048K ok
.Ve
.PP
libvirt が把握している仮想マシンにおいてツールを実行するには、\fI\-d\fR オプションおよびおそらく \fI\-c\fR オプションを使用します:
.PP
.Vb 3
\& # virt\-alignment\-scan \-d RHEL5
\& /dev/sda1 32256 512 bad (alignment < 4K)
\& /dev/sda2 106928640 512 bad (alignment < 4K)
\&
\& $ virt\-alignment\-scan \-c qemu:///system \-d Win7TwoDisks
\& /dev/sda1 1048576 1024K ok
\& /dev/sda2 105906176 1024K ok
\& /dev/sdb1 65536 64K ok
.Ve
.PP
すべての libvirt 仮想マシンをスキャンするには \fI\-a\fR や \fI\-d\fR オプションをつけずに virt\-alignment\-scan を実行します。
.PP
.Vb 4
\& # virt\-alignment\-scan
\& F16x64:/dev/sda1 1048576 1024K ok
\& F16x64:/dev/sda2 2097152 2048K ok
\& F16x64:/dev/sda3 526385152 2048K ok
.Ve
.PP
出力は 4 つまたはそれより多い、空白区切りの項目から構成されます。プログラムからこれを構文解析する場合、最初の 4 列のみが重要です。各項目は次のとおりです:
.IP "1 列目" 4
.IX Item "1 列目"
The device and partition name (eg. \fI/dev/sda1\fR meaning the first partition on the first block device).
.Sp
すべての libvirt 仮想マシンを一覧表示するとき (\fI\-a\fR や \fI\-d\fR オプションなし)、この列は libvirt 名または UUID が先頭につきます (\fI\-\-uuid\fR が指定されていると)。例: \f(CW\*(C`WinXP:/dev/sda1\*(C'\fR
.IP "2 列目" 4
.IX Item "2 列目"
パーティションの開始位置(バイト単位)
.IP "3 列目" 4
.IX Item "3 列目"
バイトまたはキロバイト単位のアライメント(例: \f(CW512\fR, \f(CW\*(C`4K\*(C'\fR)
.IP "4 列目" 4
.IX Item "4 列目"
アライメントが最適なパフォーマンスの場合に \f(CW\*(C`ok\*(C'\fR、アライメントがパフォーマンスの問題を引き起こす可能性がある場合に \f(CW\*(C`bad\*(C'\fR。
.IP "5 列目以降" 4
.IX Item "5 列目以降"
オプションの自由なテキスト説明。
.PP
プログラムからの終了コードは、不適切に配置されたパーティションが見つかったかどうかに依存して変わります。以下の "終了ステータス" を参照してください。
.PP
出力なしで終了コードを欲しいならば、\fI\-q\fR オプションを使用してください。
.SH オプション
.IX Header "オプション"
.IP \fB\-\-help\fR 4
.IX Item "--help"
簡単なヘルプを表示します。
.IP "\fB\-a\fR file" 4
.IX Item "-a file"
.PD 0
.IP "\fB\-\-add\fR file" 4
.IX Item "--add file"
.PD
仮想マシンからディスクイメージの \fIfile\fR を追加します。
.Sp
ディスクイメージの形式は自動検知されます。 これを上書きして強制的に特定の形式を使用する場合、 \fI\-\-format=..\fR オプションを使用します。
.IP "\fB\-a URI\fR" 4
.IX Item "-a URI"
.PD 0
.IP "\fB\-\-add URI\fR" 4
.IX Item "--add URI"
.PD
リモートディスクを追加します。 "リモートストレージの追加" in \fBguestfish\fR\|(1) 参照。
.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
"guestfs_add_drive_opts" in \fBguestfs\fR\|(3).
.IP "\fB\-c\fR URI" 4
.IX Item "-c URI"
.PD 0
.IP "\fB\-\-connect\fR URI" 4
.IX Item "--connect URI"
.PD
libvirt を使用していると、指定された \fIURI\fR に接続します。 省略すると、デフォルトの libvirt ハイパーバイザーに接続します。
.Sp
ゲストのブロックデバイスを直接指定していると((\fI\-a\fR))、libvirt は何も使用されません。
.IP "\fB\-d\fR guest" 4
.IX Item "-d guest"
.PD 0
.IP "\fB\-\-domain\fR guest" 4
.IX Item "--domain guest"
.PD
名前付きの libvirt 仮想マシンからすべてのディスクを追加します。 名前の代わりに仮想マシンの UUID を使用できます。
.IP \fB\-\-format=raw|qcow2|..\fR 4
.IX Item "--format=raw|qcow2|.."
.PD 0
.IP \fB\-\-format\fR 4
.IX Item "--format"
.PD
\&\fI\-a\fR オプションは標準状態でディスクイメージの形式を自動検知します。 これを使用することにより、コマンドラインで後続の \fI\-a\fR オプションのディスク形式を強制的に指定できます。 引数なしで \fI\-\-format\fR を使用することにより、 後続の \fI\-a\fR オプションに対して自動検知に戻せます。
.Sp
例:
.Sp
.Vb 1
\& virt\-alignment\-scan \-\-format=raw \-a disk.img
.Ve
.Sp
forces raw format (no auto\-detection) for \fIdisk.img\fR.
.Sp
.Vb 1
\& virt\-alignment\-scan \-\-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
仮想マシンのディスクイメージが信頼できない raw 形式である場合、 ディスク形式を指定するためにこのオプションを使用すべきです。 これにより、悪意のある仮想マシンにより起こり得る セキュリティ問題を回避できます (CVE\-2010\-3851)。
.IP "\fB\-P\fR nr_threads" 4
.IX Item "-P nr_threads"
Since libguestfs 1.22, virt\-alignment\-scan 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\-alignment\-scan is started. You can force virt\-alignment\-scan to use at most \f(CW\*(C`nr_threads\*(C'\fR by using the \fI\-P\fR option.
.Sp
Note that \fI\-P 0\fR means to autodetect, and \fI\-P 1\fR means to use a single thread.
.IP \fB\-q\fR 4
.IX Item "-q"
.PD 0
.IP \fB\-\-quiet\fR 4
.IX Item "--quiet"
.PD
Don’t produce any output. Just set the exit code (see "EXIT STATUS" below).
.IP \fB\-\-uuid\fR 4
.IX Item "--uuid"
名前の代わりに UUID を表示します。仮想マシンがマイグレーションまたは名前変更されたとき、または偶然 2 つの仮想マシンが同じ名前を持つとき、仮想マシンに使用させるために有用です。
.Sp
すべての libvirt 仮想マシンを一覧表示するとき (\fI\-a\fR や \fI\-d\fR オプションが指定されていないとき)、 このオプションのみが適用されます。
.IP \fB\-v\fR 4
.IX Item "-v"
.PD 0
.IP \fB\-\-verbose\fR 4
.IX Item "--verbose"
.PD
デバッグ用の冗長なメッセージを有効にします。
.IP \fB\-V\fR 4
.IX Item "-V"
.PD 0
.IP \fB\-\-version\fR 4
.IX Item "--version"
.PD
バージョン番号を表示して、終了します。
.IP \fB\-x\fR 4
.IX Item "-x"
libguestfs API 呼び出しのトレースを有効にします。
.SH 推奨されるアライメント
.IX Header "推奨されるアライメント"
Windows 2008 および ca.2010 以前のLinux よりも古いオペレーティングシステムは、512 バイトのセクター容量でセクター 63 に、第 1 パーティションの第1セクターを配置しなければいけません。これは古くからの障害によるものです。ドライブは BIOS にシリンダー/ヘッド/セクター (CHS) の配置を通知する必要があります。配置は最近のドライブにおいては意味がありませんが、必ずトラックあたり 63 セクターを持つことをときどき通知します。そのため、オペレーティングシステムはセクター 63 にある、第 2 "トラック" の先頭にある第 1 パーティションに置かれます。
.PP
ゲスト OS が仮想化されているとき、ホストオペレーティングシステムおよびハイパーバイザーは以下のどれかにアライメントされていることが好ましいでしょう。
.IP \(bu 4
512 バイト
.Sp
ホスト OS がハードディスクのパーティションに直接ローカルストレージを使用して、ハードディスクが 512 バイトの物理セクターを持っている場合。
.IP \(bu 4
4 K バイト
.Sp
4K バイトの物理セクターを持つ新規ハードディスクにおけるローカルストレージ向け。 4K バイトのブロック容量を持つファイルシステムにおけるファイル形式のストレージ向け。もしくは、何種類かのネットワークストレージ(NAS)向け。
.IP \(bu 4
64 K バイト
.Sp
ハイエンドの NAS 向け。いくつかの NetApp ハードウェアに最適なブロックサイズです。
.IP \(bu 4
1 M バイト
.Sp
以下の "1 MB パーティションアライメント" 参照。
.PP
基礎となるストレージに正しくアライメントされていないパーティションは余計な I/O を引き起こします。たとえば:
.PP
.Vb 8
\& sect#63
\& ┌──────────────────────────┬ ─ ─ ─ ─
\& │ guest │
\& │ filesystem block │
\& ─ ┬──────────────────┴──────┬───────────────────┴─────┬ ─ ─
\& │ host block │ host block │
\& │ │ │
\& ─ ┴─────────────────────────┴─────────────────────────┴ ─ ─
.Ve
.PP
この例では、4K ブロックが読み込まれるたびに、ホストにある 2 つのブロックにアクセスする必要があります(そのため I/O が 2 倍になります)。仮想マシンの 4K ブロックが書き込まれるとき、まず 2 つのホストブロックを読み込む必要があり、古いデータと新しいデータが結合され、2 つのブロックが書き込まれます(4 倍の I/O)。
.SS "Linux ホストブロック"
.IX Subsection "Linux ホストブロック"
新しいバージョンの Linux カーネルは、物理ブロック容量、論理ブロック容量および最小かつ推奨の I/O サイズを明らかにします。
.PP
一般的な 512 バイトセクターのハードディスク向け:
.PP
.Vb 10
\& $ cat /sys/block/sda/queue/hw_sector_size
\& 512
\& $ cat /sys/block/sda/queue/physical_block_size
\& 512
\& $ cat /sys/block/sda/queue/logical_block_size
\& 512
\& $ cat /sys/block/sda/queue/minimum_io_size
\& 512
\& $ cat /sys/block/sda/queue/optimal_io_size
\& 0
.Ve
.PP
新しい 4K バイトセクターのハードディスク向け:
.PP
.Vb 10
\& $ cat /sys/block/sda/queue/hw_sector_size
\& 4096
\& $ cat /sys/block/sda/queue/physical_block_size
\& 4096
\& $ cat /sys/block/sda/queue/logical_block_size
\& 4096
\& $ cat /sys/block/sda/queue/minimum_io_size
\& 4096
\& $ cat /sys/block/sda/queue/optimal_io_size
\& 0
.Ve
.PP
NetApp LUN 向け:
.PP
.Vb 8
\& $ cat /sys/block/sdc/queue/logical_block_size
\& 512
\& $ cat /sys/block/sdc/queue/physical_block_size
\& 512
\& $ cat /sys/block/sdc/queue/minimum_io_size
\& 4096
\& $ cat /sys/block/sdc/queue/optimal_io_size
\& 65536
.Ve
.PP
NetApp は、最小の 4K I/O サイズより好ましい 512 バイトアクセスが可能です(しかし、非常に効率が悪いです)、しかし最適な I/O サイズは 64K です。
.PP
これらの数字の意味に関する詳細は http://docs.redhat.com/docs/en\-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/newstorage\-iolimits.html を参照してください。
.PP
[4K ドライブデータを提供してくれた Matt Booth に感謝します。NetApp のデータと追加情報を提供してくれた Mike Snitzer に感謝します。]
.SS "1 MB パーティションアライメント"
.IX Subsection "1 MB パーティションアライメント"
Microsoft は Windows Server 2008 以降、すべてのパーティションに対してデフォルトのアライメントとして 1 MB を選択しました。 Linux はこれに従ってきました。
.PP
仮想マシンにおいて 512 バイトのセクターと仮定すると、セクター 2048 に開始されている最初のパーティションを参照してください。また、(もしあれば)後続のパーティションは 2048 セクターの倍数から始まります。
.PP
1 MB アライメントはすべての現行アライメント要求 (4K, 64K) と互換性があります。また、物理ブロック容量における将来的な拡張の余地を残します。
.SS アライメントの設定法
.IX Subsection "アライメントの設定法"
\&\fBvirt\-resize\fR\|(1) can change the alignment of the partitions of some guests. Currently it can fully align all the partitions of all Windows guests, and it will fix the bootloader where necessary. For Linux guests, it can align the second and subsequent partitions, so the majority of OS accesses except at boot will be aligned.
.PP
Another way to correct partition alignment problems is to reinstall your guest operating systems. If you install operating systems from templates, ensure these have correct partition alignment too.
.PP
古いバージョンの Windows は、次の NetApp ドキュメントに有用な情報があります: http://media.netapp.com/documents/tr\-3747.pdf
.PP
For Red Hat Enterprise Linux ≤ 5, use a Kickstart script that contains an explicit \f(CW%pre\fR section that creates aligned partitions using \fBparted\fR\|(8). Do not use the Kickstart \f(CW\*(C`part\*(C'\fR command. The NetApp document above contains an example.
.SH 終了ステータス
.IX Header "終了ステータス"
このプログラムは以下を返します:
.IP \(bu 4
0
.Sp
正常終了、すべてのパーティションが最高のパフォーマンスのために ≥ 64K に配置されています
.IP \(bu 4
1
.Sp
ディスクイメージまたは仮想マシンのスキャン中にエラーが発生しました
.IP \(bu 4
2
.Sp
正常終了、いくつかのパーティションがハイエンドのネットワークストレージにおいてパフォーマンスの悪い < 64K のアライメントを持ちます
.IP \(bu 4
3
.Sp
正常終了、いくつかのパーティションが多くのハイパーバイザーにおいてパフォーマンスの悪い < 4K のアライメントを持ちます
.SH 関連項目
.IX Header "関連項目"
\&\fBguestfs\fR\|(3), \fBguestfish\fR\|(1), \fBvirt\-filesystems\fR\|(1), \fBvirt\-rescue\fR\|(1), \fBvirt\-resize\fR\|(1), http://libguestfs.org/.
.SH 著者
.IX Header "著者"
Richard W.M. Jones http://people.redhat.com/~rjones/
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright (C) 2011 Red Hat Inc.
.SH LICENSE
.IX Header "LICENSE"
.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.
|