LoginSignup
1
1

More than 5 years have passed since last update.

仮想環境 既存LVを拡張

Posted at

はじめに

うちの環境にちょうど良くマッチする拡張手順がなかったので、
色々参考に作成

環境

RHEL6

やりかた

fdiskでパーティション作成

# fdisk -l

ディスク /dev/sdb: 59.1 GB, 59055800320 バイト
ヘッド 64, セクタ 32, シリンダ 56320
Units = シリンダ数 of 2048 * 512 = 1048576 バイト
セクタサイズ (論理 / 物理): 512 バイト / 512 バイト
I/O size (minimum/optimal): 512 bytes / 512 bytes
ディスク識別子: 0x00000000
# fdisk /dev/sdb

コマンド (m でヘルプ): n
コマンドアクション
   e   拡張
   p   基本パーティション (1-4)
p
パーティション番号 (1-4): 1
最初 シリンダ (1-56320, default 1): 1
Last シリンダ, +シリンダ数 or +size{K,M,G} (1-56320, default 56320):
Using default value 56320

コマンド (m でヘルプ): t
選択した領域 1
16進数コード (L コマンドでコードリスト表示): 8e
領域のシステムタイプを 1 から 8e (Linux LVM) に変更しました

コマンド (m でヘルプ): w
パーティションテーブルは変更されました!

ioctl() を呼び出してパーティションテーブルを再読込みします。
ディスクを同期しています。
# fdisk /dev/sdb

コマンド (m でヘルプ): p

ディスク /dev/sdb: 59.1 GB, 59055800320 バイト
ヘッド 64, セクタ 32, シリンダ 56320
Units = シリンダ数 of 2048 * 512 = 1048576 バイト
セクタサイズ (論理 / 物理): 512 バイト / 512 バイト
I/O size (minimum/optimal): 512 bytes / 512 bytes
ディスク識別子: 0x472c739f

デバイス ブート      始点        終点     ブロック   Id  システム
/dev/sdb1               1       56320    57671664   8e  Linux LVM

pvcreateでPV作成

# pvcreate /dev/sdb1
  Physical volume "/dev/sdb1" successfully created

vgextendでVG拡張

# vgextend VolGroup00 /dev/sdb1
  Volume group "VolGroup00" successfully extended

lvextendでLV拡張

# lvextend -l +100%FREE /dev/mapper/VolGroup00-LogVol02
  Size of logical volume VolGroup00/LogVol02 changed from 26.75 GiB (856 extents) to 81.72 GiB (2615 extents).
  Logical volume LogVol02 successfully resized.

resize2fsでファイルシステム拡張

# resize2fs /dev/mapper/VolGroup00-LogVol02
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/mapper/VolGroup00-LogVol02 is mounted on /; on-line resizing required
old desc_blocks = 2, new_desc_blocks = 6
Performing an on-line resize of /dev/mapper/VolGroup00-LogVol02 to 21422080 (4k) blocks.
The filesystem on /dev/mapper/VolGroup00-LogVol02 is now 21422080 blocks long.

以上

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1