LVの拡張

centosという名前のVGにあるrootというLV(=17.51 GiB)をVGの空き領域全てを使用して拡張する。

作業前の状況確認

# vgdisplay
  --- Volume group ---
  VG Name               centos
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  11
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               34.51 GiB
  PE Size               4.00 MiB
  Total PE              8834
  Alloc PE / Size       4994 / 19.51 GiB
  Free  PE / Size       3840 / 15.00 GiB
  VG UUID               Vd9fR0-d6mk-ZUlE-YEG0-gikq-hHO4-J0wOCf

#
centosという名前のVGのサイズは34.51 GiBで15.00 GiBの空きがある。

状況を確認したいLVはcentosという名前のVGにあるrootというLVのみなのでLV Path(=/dev/centos/root)を指定した。

# lvdisplay /dev/centos/root
  --- Logical volume ---
  LV Path                /dev/centos/root
  LV Name                root
  VG Name                centos
  LV UUID                kkfxxC-yLzP-RUou-iwpJ-yzuq-9qqW-HVntvz
  LV Write Access        read/write
  LV Creation host, time localhost, 2014-08-03 20:35:03 +0900
  LV Status              available
  # open                 1
  LV Size                17.51 GiB
  Current LE             4482
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:1

#
LVのサイズは17.51 GiB。

LVの拡張

# lvextend  -l +100%FREE /dev/centos/root
  Extending logical volume root to 32.51 GiB
  Logical volume root successfully resized
#
lvextend
LVを拡張するコマンド
-l
拡張するサイズか拡張後のサイズを指定する。
+
指定したサイズを追加
100%FREE
VGの空き全て(=100%)を指定
作業後の状況確認

# vgdisplay
  --- Volume group ---
  VG Name               centos
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  12
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               34.51 GiB
  PE Size               4.00 MiB
  Total PE              8834
  Alloc PE / Size       8834 / 34.51 GiB
  Free  PE / Size       0 / 0
  VG UUID               Vd9fR0-d6mk-ZUlE-YEG0-gikq-hHO4-J0wOCf

# lvdisplay /dev/centos/root
  --- Logical volume ---
  LV Path                /dev/centos/root
  LV Name                root
  VG Name                centos
  LV UUID                kkfxxC-yLzP-RUou-iwpJ-yzuq-9qqW-HVntvz
  LV Write Access        read/write
  LV Creation host, time localhost, 2014-08-03 20:35:03 +0900
  LV Status              available
  # open                 1
  LV Size                32.51 GiB
  Current LE             8322
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:1

#
VGの空きは0になり、LVは32.51 GiBに拡張された。

0 件のコメント :

コメントを投稿