0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

LVMのLogical Volumeの拡張

Posted at

前書き

本記事は私的な備忘録です。
記載内容について保証はしません。

手順

以下、コマンドの出力結果が拡張後のものです。すみません。

  1. 物理ボリューム(PV)とボリュームグループ(VG)の関係を確認する

    sudo pvdisplay
      --- Physical volume ---
      PV Name               /dev/sda3
      VG Name               ubuntu-vg
      PV Size               <62.00 GiB / not usable 0
      Allocatable           yes (but full)
      PE Size               4.00 MiB
      Total PE              15871
      Free PE               0
      Allocated PE          15871
      PV UUID               ZpyMMc-SDPB-rMNe-2B7b-ir7q-ZDu3-TZWJam
    

    この例では、/dev/sda3ubuntu-vgが存在することがわかる。

  2. ボリュームグループを確認する

    sudo vgdisplay
      --- Volume group ---
      VG Name               ubuntu-vg
      System ID
      Format                lvm2
      Metadata Areas        1
      Metadata Sequence No  3
      VG Access             read/write
      VG Status             resizable
      MAX LV                0
      Cur LV                1
      Open LV               1
      Max PV                0
      Cur PV                1
      Act PV                1
      VG Size               <62.00 GiB
      PE Size               4.00 MiB
      Total PE              15871
      Alloc PE / Size       15871 / <62.00 GiB
      Free  PE / Size       0 / 0
      VG UUID               NEomDc-Hxm4-HA2V-7bh4-DE6F-Spnm-xFb2kR
    
  3. 論理ボリューム(LV)を確認する

    sudo lvdisplay
     --- Logical volume ---
     LV Path                /dev/ubuntu-vg/ubuntu-lv
     LV Name                ubuntu-lv
     VG Name                ubuntu-vg
     LV UUID                UVxTDt-Ge9o-229h-bwpa-OhTZ-qyUa-z1kN3E
     LV Write Access        read/write
     LV Creation host, time ubuntu-server, 2022-09-02 14:50:27 +0000
     LV Status              available
     # open                 1
     LV Size                <62.00 GiB
     Current LE             15871
     Segments               1
     Allocation             inherit
     Read ahead sectors     auto
     - currently set to     256
     Block device           253:0
    
  4. LVを拡張する

    sudo lvextend -l +100%FREE <VG Name>/<LV Name>
    

    この場合、空き領域すべてを使って拡張される。容量の指定方法はman lvextend参照。

  5. LVの拡張に合わせてパーティションを拡張する

    sudo resize2fs <Partition Name>
    
  6. 確認

    df -h
    
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?