0

I recently had to shrink a Clonezilla image, but overdid it an now have to recover some unused free space.

Here is the output of vgadisplay:

  --- Volume group ---
  VG Name               vg_centos6svr
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  27
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                4
  Open LV               4
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               1.78 TiB
  PE Size               4.00 MiB
  Total PE              466366
  Alloc PE / Size       406298 / 1.55 TiB
  Free  PE / Size       60068 / 234.64 GiB
  VG UUID    

I need to expand the Allocated PE/Size to include the Free PE size.

This is the partial output of lvdisplay:

  --- Logical volume ---
  LV Path                /dev/vg_centos6svr/lv_mysql
  LV Name                lv_mysql
  VG Name                vg_centos6svr
  LV UUID                VwpGH0-DLnA-Ouf0-StWs-us8Y-rDwk-GLL2A9
  LV Write Access        read/write
  LV Creation host, time Centos6svr, 2018-09-28 07:31:11 -0400
  LV Status              available
  # open                 1
  LV Size                1.46 TiB
  Current LE             384000
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     1024
  Block device           253:2

This is the one I need to expand to include the re-allocated space.

/dev/vg_centos6svr/lv_mysql

What's the process here? Just increase /dev/vg_centos6svr/lv_mysql? What is the command - pvresize?

1 Answers1

2

I think you're confusing the Physical Volumes (PVs) and Logical Volumes (LVs).

If you're restoring a Clonezilla partition image, then you need a LV partition big enough to receive it.

So that would be an lvresize. You'll be able to expand the LV into all of the free space on all of the PVs in your Volume Group (VG).

LVs are allocated from VGs; VGs get their storage from PVs.

Harking back to a previous question of yours, this didn't need any "defraging" of the PV, as LVs can grow across fragmented extents - that's one of the main points of LVM - the allocation of LVs doesn't have to be contiguous, or even all on the same PV.

dsz
  • 181
  • 3
  • Thanks - the lvmresize with the --resizefs worked like a charm. Btw, do you know anything about RAID? I have an inactive RAID array somehow that I'd like to get rid of. Please check https://serverfault.com/questions/1074559/how-to-delete-an-inactive-raid-array-centos-6. – Jack BeNimble Aug 14 '21 at 14:26