/ linux

Resize vmdk LVM disk without reboot

  • resize the vmdk disk in vmware
  • scan for changes disk geometry with:
    echo 1 > /sys/block/sdb/device/rescan
  • use fdisk /dev/sdb to create a new partition with type Linux LVM/8e (n 2 default default -> t 2 8e -> w)
    yum install parted && partprobe && partx -v -a /dev/sdb
  • pvcreate /dev/sdb2
  • vgextend VolGroup00 /dev/sdb2
  • find free PE with vgdisplay (e.g. 481)
    lvextend -l+481 /dev/vg_data/lv_data or
    lvcreate -n lv_data -l 100%FREE vg_data
  • resize2fs -p /dev/vg_data/lv_data