0

I am running a Centos 6 server, which has 3 Physical Volumes. Each of these Physical volumes as a Volume Group associated to it, and each of those Volume Groups, has a Logical Volume associated to it.

Physical Volumes

--- Physical volume ---
PV Name               /dev/xvdc
VG Name               vg_applogs
PV Size               80.00 GiB / not usable 4.00 MiB
Allocatable           yes (but full)
PE Size               4.00 MiB
Total PE              20479
Free PE               0
Allocated PE          20479
PV UUID               cy7tNX-QwbJ-4ceZ-XKv1-VwSp-38S4-oLIeNF

--- Physical volume ---
PV Name               /dev/xvdb
VG Name               vg_app
PV Size               35.00 GiB / not usable 4.00 MiB
Allocatable           yes
PE Size               4.00 MiB
Total PE              8959
Free PE               7679
Allocated PE          1280
PV UUID               zbXMCG-Q49f-l1GI-3A7d-AL7m-CwZq-gawtS2

--- Physical volume ---
PV Name               /dev/xvda2
VG Name               VolGroup
PV Size               19.51 GiB / not usable 3.00 MiB
Allocatable           yes (but full)
PE Size               4.00 MiB
Total PE              4994
Free PE               0
Allocated PE          4994
PV UUID               rK3R1r-zw5i-Jk2v-IO3d-nsg8-UpkW-Kbt6Q2

Volume Groups

--- Volume group ---
VG Name               vg_applogs
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               80.00 GiB
PE Size               4.00 MiB
Total PE              20479
Alloc PE / Size       20479 / 80.00 GiB
Free  PE / Size       0 / 0
VG UUID               UlMQlU-pG3Y-sSDa-ZWnV-1ZqO-D9vG-3aeQTq

--- Volume group ---
VG Name               vg_app
System ID
Format                lvm2
Metadata Areas        1
Metadata Sequence No  3
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               35.00 GiB
PE Size               4.00 MiB
Total PE              8959
Alloc PE / Size       1280 / 5.00 GiB
Free  PE / Size       7679 / 30.00 GiB
VG UUID               Su9Uqv-eim1-bqXR-H5FJ-t0iq-pKq7-DpuAJw

--- Volume group ---
VG Name               VolGroup
System ID
Format                lvm2
Metadata Areas        1
Metadata Sequence No  3
VG Access             read/write
VG Status             resizable
MAX LV                0
Cur LV                2
Open LV               2
Max PV                0
Cur PV                1
Act PV                1
VG Size               19.51 GiB
PE Size               4.00 MiB
Total PE              4994
Alloc PE / Size       4994 / 19.51 GiB
Free  PE / Size       0 / 0
VG UUID               cUsYpP-nKG3-r18W-rdcv-Cw3u-8eWh-KUfaFm

Logical Volumes

--- Logical volume ---
LV Path                /dev/vg_applogs/lv_applogs
LV Name                lv_applogs
VG Name                vg_applogs
LV UUID                rcQVDe-vSMY-eUHy-VSZy-3453-nsCS-L7llXF
LV Write Access        read/write
LV Creation host, time grdvla2100, 2017-05-09 19:34:35 +0100
LV Status              available
# open                 1
LV Size                80.00 GiB
Current LE             20479
Segments               1
Allocation             inherit
Read ahead sectors     auto
- currently set to     256
Block device           253:2

--- Logical volume ---
LV Path                /dev/vg_app/lv_app
LV Name                lv_app
VG Name                vg_app
LV UUID                rwze2a-DdK1-yUAw-JcCO-LStU-0S1m-C7AVKD
LV Write Access        read/write
LV Creation host, time grdvla2100, 2017-05-09 19:24:15 +0100
LV Status              available
# open                 1
LV Size                5.00 GiB
Current LE             1280
Segments               1
Allocation             inherit
Read ahead sectors     auto
- currently set to     256
Block device           253:3

--- Logical volume ---
LV Path                /dev/VolGroup/lv_root
LV Name                lv_root
VG Name                VolGroup
LV UUID                7QbtNM-bob5-KP3H-5GZe-ySuc-2q3c-GPj4DM
LV Write Access        read/write
LV Creation host, time localhost.localdomain, 2017-05-09 17:20:08 +0100
LV Status              available
# open                 1
LV Size                17.51 GiB
Current LE             4482
Segments               1
Allocation             inherit
Read ahead sectors     auto
- currently set to     256
Block device           253:0

I am looking to use the spare capacity available in Physical Volume /dev/xvdb (Volume Group: vg_app) and utilise it in the Volume Group vg_applogs as the Logical Volume lv_applogs gets filled up very quickly.

What is the best way to extend the logical volume (lv_applogs) / volume group (vg_applogs) and use the spare capacity that is available in the Volume Group (vg_app)?

PS: I don't think /dev/xvdb has any partition tables at the moment:

fdisk -l

Disk /dev/xvda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00094f24

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/xvda2              64        2611    20458496   8e  Linux LVM

Disk /dev/xvdc: 85.9 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/xvdd: 120 MB, 120254464 bytes
255 heads, 63 sectors/track, 14 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/xvdb: 37.6 GB, 37580963840 bytes
255 heads, 63 sectors/track, 4568 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/VolGroup-lv_root: 18.8 GB, 18798870528 bytes
255 heads, 63 sectors/track, 2285 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/VolGroup-lv_swap: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_applogs-lv_applogs: 85.9 GB, 85895151616 bytes
255 heads, 63 sectors/track, 10442 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_app-lv_app: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

1 Answer 1

2

In short, you can't. LVs must be contained entirely within a single VG, you can't have one LV occupying space in multiple VGs.

1
  • Thank You for the swift response! I deleted the lv_app and vg_app volume groups altogether. And ran a vgextend from vg_applogs to /dev/xvdb1 to extend the volume. Created a 5GB lv_app volume within vg_applogs. And utilised lvextend to use the rest of the space within vg_applogs for /applogs :-) Dec 13, 2017 at 14:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .