Show Table of Contents
第5章 LVM 設定の例
この章では、基本的な LVM 設定の例をいくつか紹介します。
5.1. 3つのディスク上での LVM 論理ボリューム作成
この手順例では、
/dev/sda1、/dev/sdb1、および /dev/sdc1 のディスクで構成される new_logical_volume という名前の LVM 論理ボリュームを作成します。
- ボリュームグループのディスクを使用するには、
pvcreateコマンドで、そのディスクに LVM 物理ボリュームラベルを付けます。警告
このコマンドは、/dev/sda1、/dev/sdb1、および/dev/sdc1にあるデータを破棄します。#
pvcreate /dev/sda1 /dev/sdb1 /dev/sdc1Physical volume "/dev/sda1" successfully created Physical volume "/dev/sdb1" successfully created Physical volume "/dev/sdc1" successfully created - 作成した LVM 物理ボリュームで構成されるボリュームグループを作成します。以下のコマンドを使用すると、ボリュームグループ
new_vol_groupが作成されます。#
vgcreate new_vol_group /dev/sda1 /dev/sdb1 /dev/sdc1Volume group "new_vol_group" successfully createdvgsコマンドを使用すると、作成したボリュームグループの属性を表示できます。#
vgsVG #PV #LV #SN Attr VSize VFree new_vol_group 3 0 0 wz--n- 51.45G 51.45G - 作成したボリュームグループから論理ボリュームを作成します。以下のコマンドを使用して、ボリュームグループ
new_vol_groupから、論理ボリュームnew_logical_volumeを作成します。この例では、ボリュームグループの 2 ギガバイトを使用する論理ボリュームが作成されます。#
lvcreate -L 2G -n new_logical_volume new_vol_groupLogical volume "new_logical_volume" created - 論理ボリュームにファイルシステムを作成します。以下のコマンドを使用すると、論理ボリュームに GFS2 ファイルシステムが作成されます。
#
mkfs.gfs2 -p lock_nolock -j 1 /dev/new_vol_group/new_logical_volumeThis will destroy any data on /dev/new_vol_group/new_logical_volume. Are you sure you want to proceed? [y/n]yDevice: /dev/new_vol_group/new_logical_volume Blocksize: 4096 Filesystem Size: 491460 Journals: 1 Resource Groups: 8 Locking Protocol: lock_nolock Lock Table: Syncing... All Done以下のコマンドは、論理ボリュームをマウントして、ファイルシステムディスクの領域使用率を報告します。#
mount /dev/new_vol_group/new_logical_volume /mnt#dfFilesystem 1K-blocks Used Available Use% Mounted on /dev/new_vol_group/new_logical_volume 1965840 20 1965820 1% /mnt

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.