Rocky lvm disk expand

  1. Expand in your hypervisor

fdisk /dev/sda 
  1. Create new partition etc

  2. Set disk type 8e, Linux LVM

  3. Create PV volume (/dev/sda3 in my example)

pvcreate /dev/sda3 
  1. Check what PVS you want to expand

pvs

  PV         VG Fmt  Attr PSize   PFree
  /dev/sda2  rl lvm2 a--  <63.00g     0
  /dev/sda3     lvm2 ---   36.00g 36.00g

In my case, volumegroup "rl"

  1. Extend volumegroup

vgextend rl /dev/sda3
  1. Check which LV you want to expand

lvdisplay

  --- Logical volume ---
  LV Path                /dev/rl/swap
  LV Name                swap
  VG Name                rl
<Removed unnecessary info>

  --- Logical volume ---
  LV Path                /dev/rl/home
  LV Name                home
  VG Name                rl
<Removed unnecessary info>

  --- Logical volume ---
  LV Path                /dev/rl/root
  LV Name                root
  VG Name                rl
<Removed unnecessary info>

in my case I want to expand "/dev/rl/root"

  1. Extend

  1. Resize filesystem

  1. Verify that /dev/mapper/rl-root has grown

Last updated