Farid Ahmadian / General

How To Extend LVM Disk

The Refrence video was https://www.youtube.com/watch?v=KW1ScgdCIfs and then I wrote down usefull commands:

    pvs
    vgs
    lvs

    fdisk -l
    fdisk /dev/...

    => n
    => t
    => L


    maybe reboot!


    pvcreate /dev/sda...
    vgdisplay

    Look at free PE/Size
    if it was 0 go for:
    vgextend <VG NAME> /dev/sda...

    lvdisplay
    pvscan
    lvextend -L+<5>G /dev/.../root
    vgdisplay
    df -h

    resize2fs /dev/.../root
    or
    xfs_growfs /dev/.../root
    df -h

Example


    # With vgdisplay you can see how much unallocated space (Free  PE / Size) you have and decide how much you want to allocate
    vgdisplay

    # With lvdisplay you can find your LV path
    lvdisplay

    # Extend the size of the logical volume
    lvextend --size +<<Desire Number>>G <<LV Path>>

    # Resize the filesystem
    resize2fs <<LV Path>>

    # Check outputs and make sure everything is correct
    lvdisplay
    df -h
    dmesg -T

BY: Farid Ahmadian
TAG: LVM
DATE: 2020-01-22 17:10:00


Farid Ahmadian / General [ TXT ]

With many thanks and best wishes for dear Pejman Moghadam, someone who taught me alot in linux and life :)