Score:0

Centos 6.10 - How to increase allocated PE size to take up Free P/E size

cn flag

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?

Score:2
cn flag
dsz

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.

cn flag
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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.