Increasing the LVM disk size

Discussion in 'Linux Admins, Storage and Virtualization' started by VlaKl, Aug 29, 2019.

  1. VlaKl

    VlaKl New Member

    Joined:
    Apr 26, 2019
    Messages:
    23
    Likes Received:
    0
    Hi

    The virtual disk is increased. How to increase LVM ?

    fdisk -l /dev/sdc

    Disk /dev/sdc: 53.7 GB, 53687091200 bytes, 104857600 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes

    Physical volume ---
    PV Name /dev/sdc
    VG Name vol_data
    PV Size 30.00 GiB / not usable 4.00 MiB
    Allocatable yes (but full)
    PE Size 4.00 MiB
    Total PE 7679
    Free PE 0
    Allocated PE 7679



    - Volume group ---
    VG Name vol_data
    System ID
    Format lvm2
    Metadata Areas 1
    Metadata Sequence No 2
    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 <30.00 GiB
    PE Size 4.00 MiB
    Total PE 7679
    Alloc PE / Size 7679 / <30.00 GiB
    Free PE / Size 0 / 0
     
    #1
  2. BoredSysadmin

    BoredSysadmin Active Member

    Joined:
    Mar 2, 2019
    Messages:
    266
    Likes Received:
    58
  3. VlaKl

    VlaKl New Member

    Joined:
    Apr 26, 2019
    Messages:
    23
    Likes Received:
    0
    Do I need to create a partition on sdc ?
     
    #3
  4. EffrafaxOfWug

    EffrafaxOfWug Radioactive Member

    Joined:
    Feb 12, 2015
    Messages:
    1,070
    Likes Received:
    354
    From what you've posted, you've created the PV direct on /dev/sdc without using a partition, so no you don't need to create a partition - but IMHO starting off using partitions makes things much easier to manage (I almost always do to be sure that alignment is correct); then before all the LVM stuff you'd also need to extend the sdc1 partition to the end of the disc. I usually do this interactively with parted.

    Assuming it's /dev/sdc you've increased to 53GB and you're not using a partition, you need to complete steps looking something like this (I'm doing this from memory so check before you run of course!):
    Get LVM the realise the PV device size has increased:
    Code:
    pvresive /dev/sdc
    pvdisplay /dev/sdc
    Once the PV is bigger, grow the volume group across the extents of the newly extended PV:
    Code:
    vgextend vol_data /dev/sdc
    vgdisplay vol_data
    Any logical volumes sitting in that VG can then be extended with lvextend. If you use the -r option, LVM will also attempt to resize the filesystem on the LV accordingly; this doesn't always work (depends on how you've got it set up basically) so be prepared to resize the filesystem manually.
    Code:
    lvextend -rv -L +10G /dev/vol_data/whatever_your_lv_is_called
     
    #4
    Last edited: Aug 29, 2019
    VlaKl likes this.
  5. VlaKl

    VlaKl New Member

    Joined:
    Apr 26, 2019
    Messages:
    23
    Likes Received:
    0
    Thanks
     
    #5
Similar Threads: Increasing disk
Forum Title Date
Linux Admins, Storage and Virtualization Extending / Creating Ext4 partition after increasing VMDK size May 5, 2016
Linux Admins, Storage and Virtualization SOLVED: duplicated zpool via send/recv, disk usage appears to be incorrect Oct 28, 2019
Linux Admins, Storage and Virtualization Different disk sets for Proxmox Ceph pools? May 29, 2019
Linux Admins, Storage and Virtualization ZFS insufficient replicas on replaced disk May 28, 2019
Linux Admins, Storage and Virtualization Size on disk is 2.3X file size Mar 9, 2019

Share This Page