5.3. ボリュームグループ管理
このセクションでは、ボリュームグループ管理の各種事項を実行するためのコマンドについて説明しています。
5.3.1. ボリュームグループの作成 リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
To create a volume group from one or more physical volumes, use the
vgcreate command. The vgcreate command creates a new volume group by name and adds at least one physical volume to it.
以下のコマンドは、
vg1 と言う名前のボリュームグループを作成します。これには、物理ボリューム /dev/sdd1 と /dev/sde1 が含まれます。
vgcreate vg1 /dev/sdd1 /dev/sde1
# vgcreate vg1 /dev/sdd1 /dev/sde1
ボリュームグループの作成に物理ボリュームが使用される場合、ディスク領域はデフォルトでは 4MB のエクステントに分割されます。このエクステントは、論理ボリュームのサイズを拡張/縮小するための最小単位です。エクステントの数が多くても、論理ボリュームの I/O パフォーマンスに影響を与えることはありません。
エクステントサイズのデフォルト設定が適切でない場合、
vgcreate コマンドに -s オプションを使用して、サイズを指定することができます。vgcreate コマンドに -p と -l の引数を使用すると、ボリュームグループに追加可能な物理ボリュームまたは論理ボリュームの数を限定することができます。
By default, a volume group allocates physical extents according to common-sense rules such as not placing parallel stripes on the same physical volume. This is the
normal allocation policy. You can use the --alloc argument of the vgcreate command to specify an allocation policy of contiguous, anywhere, or cling. In general, allocation policies other than normal are required only in special cases where you need to specify unusual or nonstandard extent allocation. For further information on how LVM allocates physical extents, see 「LVM の割り当て」.
LVM ボリュームグループと配下にある論理ボリュームは、以下のような配置で
/dev ディレクトリ内のデバイス特有のファイルがあるディレクトリツリーに格納されます。
/dev/vg/lv/
/dev/vg/lv/
For example, if you create two volume groups
myvg1 and myvg2, each with three logical volumes named lv01, lv02, and lv03, six device special files are created:
The device special files are not present if the corresponding logical volume is not currently active.
LVM でのデバイスの最大サイズは、64 ビット CPU 上で 8 エクサバイトです。